diff --git a/.github/workflows/update-lint-and-build.yml b/.github/workflows/update-lint-and-build.yml deleted file mode 100644 index 0e955283c..000000000 --- a/.github/workflows/update-lint-and-build.yml +++ /dev/null @@ -1,140 +0,0 @@ -name: Translation and Linting Workflow - -on: - schedule: - - cron: '0 * * * *' - push: - branches: - - '*' - workflow_dispatch: - -jobs: - update-translation: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - version: [3.13, 3.12, 3.11, '3.10', 3.9] - steps: - - uses: styfle/cancel-workflow-action@main - with: - access_token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/setup-python@master - with: - python-version: 3 - - name: Install dependencies - run: | - sudo apt-get install -y gettext - pip install requests cogapp polib transifex-python sphinx-intl blurb six - curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash - working-directory: /usr/local/bin - - uses: actions/checkout@master - with: - ref: ${{ matrix.version }} - fetch-depth: 0 - - name: Recreate Transifex config - run: ./manage_translation.py recreate_tx_config - env: - TX_TOKEN: ${{ secrets.TX_TOKEN }} - - name: Fetch translations - run: ./manage_translation.py fetch - env: - TX_TOKEN: ${{ secrets.TX_TOKEN }} - - name: Update README.md - run: python -Werror -m cogapp -rP README.md - if: ${{ hashFiles('README.md') != '' }} - env: - TX_TOKEN: ${{ secrets.TX_TOKEN }} - - name: Update README.en.md - run: python -Werror -m cogapp -rP README.en.md - if: ${{ hashFiles('README.en.md') != '' }} - env: - TX_TOKEN: ${{ secrets.TX_TOKEN }} - - run: git config --local user.email github-actions@github.com - - run: git config --local user.name "GitHub Action's update-translation job" - - name: Check changes significance - run: | - ! git diff -I'^"POT-Creation-Date: ' \ - -I'^"Language-Team: ' \ - -I'^# ' -I'^"Last-Translator: ' \ - --exit-code \ - && echo "SIGNIFICANT_CHANGES=1" >> $GITHUB_ENV || exit 0 - - run: git add . - - run: git commit -m 'Update translation from Transifex' - if: env.SIGNIFICANT_CHANGES - - name: Push commit - uses: ad-m/github-push-action@master - if: env.SIGNIFICANT_CHANGES - with: - branch: ${{ matrix.version }} - github_token: ${{ secrets.GITHUB_TOKEN }} - - lint: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - version: [3.13, 3.12, 3.11] - needs: ['update-translation'] - continue-on-error: true - steps: - - uses: actions/setup-python@master - with: - python-version: 3 - - run: pip install sphinx-lint - - uses: actions/checkout@master - with: - ref: ${{ matrix.version }} - - uses: rffontenelle/sphinx-lint-problem-matcher@v1.0.0 - - run: sphinx-lint - - build-translation: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - version: [3.13, 3.12, 3.11, '3.10', 3.9, 3.8] - format: [html, latex] - needs: ['update-translation'] - steps: - - uses: actions/setup-python@master - with: - python-version: 3.12 # pin for Sphinx 3.4.3 in 3.10 branch (see #63) - - uses: actions/checkout@master - with: - repository: python/cpython - ref: ${{ matrix.version }} - - run: make venv - working-directory: ./Doc - - uses: actions/checkout@master - with: - ref: ${{ matrix.version }} - path: Doc/locales/pl/LC_MESSAGES - - run: git pull - working-directory: ./Doc/locales/pl/LC_MESSAGES - - uses: sphinx-doc/github-problem-matcher@v1.1 - - run: make -e SPHINXOPTS="--color -D language='pl' -W --keep-going" ${{ matrix.format }} - working-directory: ./Doc - - uses: actions/upload-artifact@master - if: success() || failure() - with: - name: build-${{ matrix.version }}-${{ matrix.format }} - path: Doc/build/${{ matrix.format }} - - output-pdf: - runs-on: ubuntu-latest - strategy: - matrix: - version: [3.13, 3.12, 3.11, '3.10', 3.9, 3.8] - needs: ['build-translation'] - steps: - - uses: actions/download-artifact@master - with: - name: build-${{ matrix.version }}-latex - - run: sudo apt-get update - - run: sudo apt-get install -y latexmk texlive-xetex fonts-freefont-otf xindy - - run: make - - uses: actions/upload-artifact@master - with: - name: build-${{ matrix.version }}-pdf - path: . diff --git a/manage_translation.py b/manage_translation.py index 7a49d282e..8fe60f90c 100755 --- a/manage_translation.py +++ b/manage_translation.py @@ -49,7 +49,7 @@ def _call(command: str): exit(return_code) -PROJECT_SLUG = 'python-newest' +PROJECT_SLUG = 'python-313' VERSION = '3.13' diff --git a/update_switcher_chart.py b/update_switcher_chart.py deleted file mode 100644 index 7ddca16b3..000000000 --- a/update_switcher_chart.py +++ /dev/null @@ -1,35 +0,0 @@ -# EOL code, saving as this can be repurposed for a chart with the total translation progress - -from datetime import datetime -from re import search - -from git import Repo, GitCommandError -from matplotlib import pyplot -from matplotlib.ticker import PercentFormatter - -repo = Repo('.') -progress, dates = [], [] -for commit in repo.iter_commits(): - try: - readme_content = repo.git.show('{}:{}'.format(commit.hexsha, 'README.md')) - except GitCommandError: - continue - found = search(r'!\[(\d\d.\d\d)% przełącznika języków]', readme_content) - if not found: - found = search(r'!\[(\d+.\d\d)% language switchera]', readme_content) - if not found: - found = search(r'!\[(\d+.\d\d)% do language switchera]', readme_content) - if not found: - print(readme_content) - continue - number = float(found.group(1)) - progress.append(number) - dates.append(datetime.fromtimestamp(commit.authored_date)) - -pyplot.plot_date(dates, progress, linestyle='-', marker='') -pyplot.ylim(ymin=0) -pyplot.grid() -pyplot.gcf().autofmt_xdate() -pyplot.gca().yaxis.set_major_formatter(PercentFormatter()) -pyplot.title("Postęp tłumaczenia do dodania do przełącznika języków") -pyplot.savefig("language-switcher-progress.svg")