Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize the bootstrapper and tests #2

Merged
merged 9 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: pre-commit checks

on: [push, pull_request, workflow_dispatch]

permissions:
contents: read

jobs:
check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- uses: pre-commit/[email protected]
19 changes: 7 additions & 12 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
name: Tests
on:
workflow_dispatch:
push:
branches:
- "**"
pull_request:
branches:
- "**"

on: [push, pull_request, workflow_dispatch]

jobs:
test:
Expand All @@ -15,11 +9,12 @@ jobs:
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
python-version: ["3.10", "3.11", "3.12-dev"]
python-version: ["3.11", "3.12-dev"]
egeakman marked this conversation as resolved.
Show resolved Hide resolved
build-version: ["3.11", "3.12"]

steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -41,8 +36,8 @@ jobs:
- name: Install the package
run: pip install .

- name: Run the package
run: bootstrapper tr -b 3.12
- name: Run the bootstrapper
run: bootstrapper tr -b ${{ matrix.build-version }}

- name: See results (non-Windows)
if: matrix.os != 'windows-latest'
Expand Down
8 changes: 5 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ repos:
- id: isort
name: isort (python)

- repo: https://github.com/psf/black
rev: 23.7.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1
hooks:
- id: black
name: black (python)

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-case-conflict
- id: check-merge-conflict
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This repository contains the scripts and data used to bootstrap a new translation of the Python documentation.

## Why python-docs-bootstrapper?

...

## Installation

```bash
Expand Down
7 changes: 3 additions & 4 deletions bootstrapper/bootstrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,18 @@ def setup_cpython_repo(self) -> None:
"clone",
"https://github.com/python/cpython.git",
self.cpython_repo,
f"--branch={self.branch}",
"-q",
],
check=True,
)
print("✅")

subprocess.run(
["git", "-C", self.cpython_repo, "checkout", self.branch, "-q"], check=True
)
subprocess.run(
["git", "-C", self.cpython_repo, "pull", "--ff-only", "-q"], check=True
)

print("✅")

logger.info("Building gettext files...")
subprocess.run(
[
Expand Down
4 changes: 1 addition & 3 deletions bootstrapper/data/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
# - make clean # To remove build artifacts
# - make fuzzy # To find fuzzy strings
#
# Modes are: autobuild-stable, autobuild-dev, and autobuild-html,
# documented in gen/src/3.6/Doc/Makefile as we're only delegating the
# real work to the Python Doc Makefile.
# Modes are: autobuild-stable, autobuild-dev, and autobuild-html

# Configuration

Expand Down
13 changes: 11 additions & 2 deletions bootstrapper/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@

Hello! This is the repository of the {{translation.language}} translation of the Python documentation.

You can refer to the following resources throughout this journey:
**You can refer to the following resources throughout this journey:**

- [DevGuide Translating Section](https://devguide.python.org/documentation/translating/) (add your translation to the list!)
- [PEP 545](https://www.python.org/dev/peps/pep-0545/) (the PEP that describes the translation process)
- [Other Translations](https://github.com/orgs/python/repositories?q=python-docs) (see how other translations are doing it)
- [Python Docs Discord Server](https://discord.com/invite/sMWqvzXvde) (especially the `#translations` channel)

**Tips for the maintainers:**

...

**The ultimate checklist to get you started:**

...


## Documentation Contribution Agreement
Python's documentation is maintained using a global network of volunteers. By posting this project on Transifex, Github, and other public places, and inviting you to participate, we are proposing an agreement that you will provide your improvements to Python's documentation or the translation of Python's documentation for the PSF's use under the CC0 license (available at https://creativecommons.org/publicdomain/zero/1.0/legalcode). In return, you may publicly claim credit for the portion of the translation you contributed and if your translation is accepted by the PSF, you may (but are not required to) submit a patch including an appropriate annotation in the Misc/ACKS or TRANSLATORS file. Although nothing in this Documentation Contribution Agreement obligates the PSF to incorporate your textual contribution, your participation in the Python community is welcomed and appreciated.

You signify acceptance of this agreement by submitting your work to the PSF for inclusion in the documentation.

**Do not forget to replace this file with your own README that describes your translation and community!**
***Do not forget to replace this file with your own README that describes your translation and community, while keeping the above agreement!***
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import find_packages, setup

version = "0.1.1"
version = "0.1.2"

with open("README.md", "r", encoding="utf-8") as f:
long_description = f.read()
Expand Down