From 2797f58ed3f6debf1e35019121889eb85fbc54b4 Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Wed, 29 Nov 2023 08:43:49 -0300 Subject: [PATCH 01/11] Error on unset variable in scritps (#339) * Error on unset variable in build.sh * Error on unset variable in update.sh --- .github/scripts/build.sh | 3 ++- .github/scripts/update.sh | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/scripts/build.sh b/.github/scripts/build.sh index 4e9b1556c..64b6cc9fc 100755 --- a/.github/scripts/build.sh +++ b/.github/scripts/build.sh @@ -1,6 +1,7 @@ #!/bin/bash set -e +set -u set -o pipefail error() { @@ -14,4 +15,4 @@ cd cpython/Doc || exit 1 mkdir -p locales/"$LOCALE"/ ln -sfn "$(realpath ../../docs)" locales/"$LOCALE"/LC_MESSAGES pip3 install -q -r requirements.txt -sphinx-build -b dummy -d build/doctrees -j auto -D language=$LOCALE -D gettext_compact=0 -W --keep-going -W . build/html 2> >(error) \ No newline at end of file +sphinx-build -b dummy -d build/doctrees -j auto -D language=$LOCALE -D gettext_compact=0 -W --keep-going -W . build/html 2> >(error) diff --git a/.github/scripts/update.sh b/.github/scripts/update.sh index 4a15d3095..0f2231d9f 100755 --- a/.github/scripts/update.sh +++ b/.github/scripts/update.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -u + cd cpython || exit 1 # Restore git timestamp for enabling build cache From 4a41046a506f8af897175cf2077df6c02cac36e7 Mon Sep 17 00:00:00 2001 From: A <5249513+Dumeng@users.noreply.github.com> Date: Sat, 2 Mar 2024 01:53:49 +0800 Subject: [PATCH 02/11] Update the tx config format --- .github/scripts/generate_tx_config.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/scripts/generate_tx_config.py b/.github/scripts/generate_tx_config.py index ca3bb39e4..ebcc3b2dd 100755 --- a/.github/scripts/generate_tx_config.py +++ b/.github/scripts/generate_tx_config.py @@ -59,6 +59,10 @@ def patch_config(path: str): cwd = os.getcwd() os.chdir(path) config_content = FILTER_PATTERN.sub(name_replacer, config_content) + config_content = re.sub(r'replace_edited_strings.*\n','', config_content) + config_content = re.sub(r'keep_translations.*\n','', config_content) + config_content = re.sub(r'0\ntrans\.zh_CN.*\n','0\n', config_content) + config_content = config_content.replace(' =','=') os.chdir(cwd) tx_config_path.write_text(config_content, "utf-8") From 2507666cf0a92e240ee936aca44182c06269ef95 Mon Sep 17 00:00:00 2001 From: A <5249513+Dumeng@users.noreply.github.com> Date: Sat, 2 Mar 2024 01:55:34 +0800 Subject: [PATCH 03/11] Update actions deps --- .github/workflows/sync.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 3fed1aca7..0788a37c0 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -20,14 +20,14 @@ jobs: LOCALE: zh_CN VERSION: ${{ inputs.version }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Checkout CPython - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: 'python/cpython' ref: ${{env.VERSION}} path: cpython - - uses: actions/cache/restore@v3 + - uses: actions/cache/restore@v4 with: path: | cpython/Doc/build @@ -35,7 +35,7 @@ jobs: key: cache-${{ inputs.version }}-${{ github.run_id }} restore-keys: cache-${{ inputs.version }}- - name: Checkout Current Branch - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{env.VERSION}} path: docs @@ -46,14 +46,14 @@ jobs: run: .github/scripts/update.sh env: TX_TOKEN: ${{ secrets.TRANSIFEX_APIKEY }} - - uses: actions/cache/restore@v3 + - uses: actions/cache/restore@v4 with: path: cpython/Doc/build key: cache-${{ inputs.version }}-${{ github.run_id }} restore-keys: cache-${{ inputs.version }}- - name: build run: .github/scripts/build.sh - - uses: actions/cache/save@v3 + - uses: actions/cache/save@v4 with: path: | cpython/Doc/build From 5de9a3a57dc9b9887122a3c8edc4dd347815f737 Mon Sep 17 00:00:00 2001 From: A <5249513+Dumeng@users.noreply.github.com> Date: Sat, 11 May 2024 04:43:40 +0000 Subject: [PATCH 04/11] Add version 3.13 --- .github/workflows/python-310.yml | 2 +- .github/workflows/python-311.yml | 2 +- .github/workflows/python-312.yml | 4 ++-- .github/workflows/python-313.yml | 16 ++++++++++++++++ .github/workflows/python-39.yml | 2 +- README.rst | 7 ++++++- 6 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/python-313.yml diff --git a/.github/workflows/python-310.yml b/.github/workflows/python-310.yml index 6607518d7..84950aa6a 100644 --- a/.github/workflows/python-310.yml +++ b/.github/workflows/python-310.yml @@ -5,7 +5,7 @@ on: branches: - master schedule: - - cron: "26 * * * *" + - cron: "22 * * * *" jobs: sync: diff --git a/.github/workflows/python-311.yml b/.github/workflows/python-311.yml index 9566d743f..2fd788f9f 100644 --- a/.github/workflows/python-311.yml +++ b/.github/workflows/python-311.yml @@ -5,7 +5,7 @@ on: branches: - master schedule: - - cron: "38 * * * *" + - cron: "32 * * * *" jobs: sync: diff --git a/.github/workflows/python-312.yml b/.github/workflows/python-312.yml index d1bb99d95..289d6e577 100644 --- a/.github/workflows/python-312.yml +++ b/.github/workflows/python-312.yml @@ -5,12 +5,12 @@ on: branches: - master schedule: - - cron: "50 * * * *" + - cron: "42 * * * *" jobs: sync: uses: ./.github/workflows/sync.yml with: version: "3.12" - tx_project: "python-newest" + tx_project: "python-312" secrets: inherit diff --git a/.github/workflows/python-313.yml b/.github/workflows/python-313.yml new file mode 100644 index 000000000..9391d7e23 --- /dev/null +++ b/.github/workflows/python-313.yml @@ -0,0 +1,16 @@ +name: python-313 + +on: + push: + branches: + - master + schedule: + - cron: "52 * * * *" + +jobs: + sync: + uses: ./.github/workflows/sync.yml + with: + version: "3.13" + tx_project: "python-newest" + secrets: inherit diff --git a/.github/workflows/python-39.yml b/.github/workflows/python-39.yml index 3d6e5da9a..4284b55b7 100644 --- a/.github/workflows/python-39.yml +++ b/.github/workflows/python-39.yml @@ -5,7 +5,7 @@ on: branches: - master schedule: - - cron: "14 * * * *" + - cron: "12 * * * *" jobs: sync: diff --git a/README.rst b/README.rst index 5c38d3110..c18935a85 100644 --- a/README.rst +++ b/README.rst @@ -12,11 +12,16 @@ Maintained versions: * - Version - Sync status - Translation progress + * - `3.13 `_ + - .. image:: https://github.com/python/python-docs-zh-cn/workflows/python-313/badge.svg + :target: https://github.com/python/python-docs-zh-cn/actions?workflow=python-313 + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpython%2Fpython-docs-zh-cn%2F3.13%2F.stat.json&query=%24.translation&label=zh-CN + :target: https://app.transifex.com/python-doc/python-newest/ * - `3.12 `_ - .. image:: https://github.com/python/python-docs-zh-cn/workflows/python-312/badge.svg :target: https://github.com/python/python-docs-zh-cn/actions?workflow=python-312 - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpython%2Fpython-docs-zh-cn%2F3.12%2F.stat.json&query=%24.translation&label=zh-CN - :target: https://app.transifex.com/python-doc/python-newest/ + :target: https://app.transifex.com/python-doc/python-312/ * - `3.11 `_ - .. image:: https://github.com/python/python-docs-zh-cn/workflows/python-311/badge.svg :target: https://github.com/python/python-docs-zh-cn/actions?workflow=python-311 From c6514dd2d9f205de8509d4c78c4020ec7d73b2e6 Mon Sep 17 00:00:00 2001 From: A <5249513+Dumeng@users.noreply.github.com> Date: Wed, 21 Aug 2024 20:34:56 +0800 Subject: [PATCH 05/11] update build command to use fresh environment Attempt to resolve the environment cache cause building stuck issues. --- .github/scripts/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/build.sh b/.github/scripts/build.sh index 64b6cc9fc..46c229e10 100755 --- a/.github/scripts/build.sh +++ b/.github/scripts/build.sh @@ -15,4 +15,4 @@ cd cpython/Doc || exit 1 mkdir -p locales/"$LOCALE"/ ln -sfn "$(realpath ../../docs)" locales/"$LOCALE"/LC_MESSAGES pip3 install -q -r requirements.txt -sphinx-build -b dummy -d build/doctrees -j auto -D language=$LOCALE -D gettext_compact=0 -W --keep-going -W . build/html 2> >(error) +sphinx-build -b dummy -d build/doctrees -j auto -D language=$LOCALE -D gettext_compact=0 -E --keep-going -W . build/html 2> >(error) From d9be07d661527b849d9ce617470f3dc9e535946c Mon Sep 17 00:00:00 2001 From: A <5249513+Dumeng@users.noreply.github.com> Date: Fri, 11 Oct 2024 18:52:38 +0800 Subject: [PATCH 06/11] Remove python3.8 as it has reached EOL --- .github/workflows/python-38.yml | 7 +------ README.rst | 10 +++++----- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/python-38.yml b/.github/workflows/python-38.yml index 4da2959f9..9d0bc6daf 100644 --- a/.github/workflows/python-38.yml +++ b/.github/workflows/python-38.yml @@ -1,11 +1,6 @@ name: python-38 -on: - push: - branches: - - master - schedule: - - cron: "2 * * * *" +on: workflow_dispatch jobs: sync: diff --git a/README.rst b/README.rst index c18935a85..a4eb6ee9a 100644 --- a/README.rst +++ b/README.rst @@ -37,11 +37,6 @@ Maintained versions: :target: https://github.com/python/python-docs-zh-cn/actions?workflow=python-39 - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpython%2Fpython-docs-zh-cn%2F3.9%2F.stat.json&query=%24.translation&label=zh-CN :target: https://app.transifex.com/python-doc/python-39/ - * - `3.8 `_ - - .. image:: https://github.com/python/python-docs-zh-cn/workflows/python-38/badge.svg - :target: https://github.com/python/python-docs-zh-cn/actions?workflow=python-38 - - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpython%2Fpython-docs-zh-cn%2F3.8%2F.stat.json&query=%24.translation&label=zh-CN - :target: https://app.transifex.com/python-doc/python-38/ EOL versions: @@ -51,6 +46,11 @@ EOL versions: * - Version - Sync status - Translation progress + * - `3.8 `_ + - .. image:: https://github.com/python/python-docs-zh-cn/workflows/python-38/badge.svg + :target: https://github.com/python/python-docs-zh-cn/actions?workflow=python-38 + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpython%2Fpython-docs-zh-cn%2F3.8%2F.stat.json&query=%24.translation&label=zh-CN + :target: https://app.transifex.com/python-doc/python-38/ * - `3.7 `_ - .. image:: https://github.com/python/python-docs-zh-cn/workflows/python-37/badge.svg :target: https://github.com/python/python-docs-zh-cn/actions?workflow=python-37 From 8e0a0fd29f68b83c8e1d24660a329a382102362b Mon Sep 17 00:00:00 2001 From: A <5249513+Dumeng@users.noreply.github.com> Date: Fri, 11 Oct 2024 19:20:11 +0800 Subject: [PATCH 07/11] Fix error: externally-managed-environment in GitHub Actions runner --- .github/scripts/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/build.sh b/.github/scripts/build.sh index 46c229e10..e811371e6 100755 --- a/.github/scripts/build.sh +++ b/.github/scripts/build.sh @@ -14,5 +14,5 @@ error() { cd cpython/Doc || exit 1 mkdir -p locales/"$LOCALE"/ ln -sfn "$(realpath ../../docs)" locales/"$LOCALE"/LC_MESSAGES -pip3 install -q -r requirements.txt +pip3 install -q -r requirements.txt --break-system-packages sphinx-build -b dummy -d build/doctrees -j auto -D language=$LOCALE -D gettext_compact=0 -E --keep-going -W . build/html 2> >(error) From 2928f3045178da9ca2c6a088d8cd5ae319c53444 Mon Sep 17 00:00:00 2001 From: A <5249513+Dumeng@users.noreply.github.com> Date: Sun, 13 Oct 2024 08:16:11 +0000 Subject: [PATCH 08/11] add workflow dispatch triggers --- .github/workflows/python-310.yml | 1 + .github/workflows/python-311.yml | 1 + .github/workflows/python-312.yml | 1 + .github/workflows/python-313.yml | 1 + .github/workflows/python-39.yml | 1 + 5 files changed, 5 insertions(+) diff --git a/.github/workflows/python-310.yml b/.github/workflows/python-310.yml index 84950aa6a..27c0ef443 100644 --- a/.github/workflows/python-310.yml +++ b/.github/workflows/python-310.yml @@ -1,6 +1,7 @@ name: python-310 on: + workflow_dispatch push: branches: - master diff --git a/.github/workflows/python-311.yml b/.github/workflows/python-311.yml index 2fd788f9f..166ca8bfc 100644 --- a/.github/workflows/python-311.yml +++ b/.github/workflows/python-311.yml @@ -1,6 +1,7 @@ name: python-311 on: + workflow_dispatch push: branches: - master diff --git a/.github/workflows/python-312.yml b/.github/workflows/python-312.yml index 289d6e577..02ee39a5b 100644 --- a/.github/workflows/python-312.yml +++ b/.github/workflows/python-312.yml @@ -1,6 +1,7 @@ name: python-312 on: + workflow_dispatch push: branches: - master diff --git a/.github/workflows/python-313.yml b/.github/workflows/python-313.yml index 9391d7e23..5c13ff70f 100644 --- a/.github/workflows/python-313.yml +++ b/.github/workflows/python-313.yml @@ -1,6 +1,7 @@ name: python-313 on: + workflow_dispatch push: branches: - master diff --git a/.github/workflows/python-39.yml b/.github/workflows/python-39.yml index 4284b55b7..bec73ca6b 100644 --- a/.github/workflows/python-39.yml +++ b/.github/workflows/python-39.yml @@ -1,6 +1,7 @@ name: python-39 on: + workflow_dispatch push: branches: - master From 294909422abfb96d7be9f4c89e6ad437c0793aa5 Mon Sep 17 00:00:00 2001 From: A <5249513+Dumeng@users.noreply.github.com> Date: Sun, 13 Oct 2024 08:19:10 +0000 Subject: [PATCH 09/11] add workflow dispatch triggers --- .github/workflows/python-310.yml | 2 +- .github/workflows/python-311.yml | 2 +- .github/workflows/python-312.yml | 2 +- .github/workflows/python-313.yml | 2 +- .github/workflows/python-39.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-310.yml b/.github/workflows/python-310.yml index 27c0ef443..35a148f47 100644 --- a/.github/workflows/python-310.yml +++ b/.github/workflows/python-310.yml @@ -1,7 +1,7 @@ name: python-310 on: - workflow_dispatch + workflow_dispatch: push: branches: - master diff --git a/.github/workflows/python-311.yml b/.github/workflows/python-311.yml index 166ca8bfc..4fa85bb77 100644 --- a/.github/workflows/python-311.yml +++ b/.github/workflows/python-311.yml @@ -1,7 +1,7 @@ name: python-311 on: - workflow_dispatch + workflow_dispatch: push: branches: - master diff --git a/.github/workflows/python-312.yml b/.github/workflows/python-312.yml index 02ee39a5b..75cc1d35e 100644 --- a/.github/workflows/python-312.yml +++ b/.github/workflows/python-312.yml @@ -1,7 +1,7 @@ name: python-312 on: - workflow_dispatch + workflow_dispatch: push: branches: - master diff --git a/.github/workflows/python-313.yml b/.github/workflows/python-313.yml index 5c13ff70f..657d53443 100644 --- a/.github/workflows/python-313.yml +++ b/.github/workflows/python-313.yml @@ -1,7 +1,7 @@ name: python-313 on: - workflow_dispatch + workflow_dispatch: push: branches: - master diff --git a/.github/workflows/python-39.yml b/.github/workflows/python-39.yml index bec73ca6b..39305f585 100644 --- a/.github/workflows/python-39.yml +++ b/.github/workflows/python-39.yml @@ -1,7 +1,7 @@ name: python-39 on: - workflow_dispatch + workflow_dispatch: push: branches: - master From ac84487938688e71d42f5b64b431d866a453ebe4 Mon Sep 17 00:00:00 2001 From: A <5249513+Dumeng@users.noreply.github.com> Date: Tue, 26 Nov 2024 21:18:41 +0800 Subject: [PATCH 10/11] remove the break-system-packages option to fix the build --- .github/scripts/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/build.sh b/.github/scripts/build.sh index e811371e6..46c229e10 100755 --- a/.github/scripts/build.sh +++ b/.github/scripts/build.sh @@ -14,5 +14,5 @@ error() { cd cpython/Doc || exit 1 mkdir -p locales/"$LOCALE"/ ln -sfn "$(realpath ../../docs)" locales/"$LOCALE"/LC_MESSAGES -pip3 install -q -r requirements.txt --break-system-packages +pip3 install -q -r requirements.txt sphinx-build -b dummy -d build/doctrees -j auto -D language=$LOCALE -D gettext_compact=0 -E --keep-going -W . build/html 2> >(error) From d0a223a5bc1cd5d896d223478211c45ec79352b5 Mon Sep 17 00:00:00 2001 From: A <5249513+Dumeng@users.noreply.github.com> Date: Sat, 10 May 2025 14:03:34 +0800 Subject: [PATCH 11/11] Add version 3.14 --- .github/workflows/python-313.yml | 2 +- .github/workflows/python-314.yml | 17 +++++++++++++++++ README.rst | 7 ++++++- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/python-314.yml diff --git a/.github/workflows/python-313.yml b/.github/workflows/python-313.yml index 657d53443..5cf9c8340 100644 --- a/.github/workflows/python-313.yml +++ b/.github/workflows/python-313.yml @@ -13,5 +13,5 @@ jobs: uses: ./.github/workflows/sync.yml with: version: "3.13" - tx_project: "python-newest" + tx_project: "python-313" secrets: inherit diff --git a/.github/workflows/python-314.yml b/.github/workflows/python-314.yml new file mode 100644 index 000000000..9118a8ce8 --- /dev/null +++ b/.github/workflows/python-314.yml @@ -0,0 +1,17 @@ +name: python-314 + +on: + workflow_dispatch: + push: + branches: + - master + schedule: + - cron: "2 * * * *" + +jobs: + sync: + uses: ./.github/workflows/sync.yml + with: + version: "3.14" + tx_project: "python-newest" + secrets: inherit diff --git a/README.rst b/README.rst index a4eb6ee9a..f17ac8294 100644 --- a/README.rst +++ b/README.rst @@ -12,11 +12,16 @@ Maintained versions: * - Version - Sync status - Translation progress + * - `3.14 `_ + - .. image:: https://github.com/python/python-docs-zh-cn/workflows/python-314/badge.svg + :target: https://github.com/python/python-docs-zh-cn/actions?workflow=python-314 + - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpython%2Fpython-docs-zh-cn%2F3.14%2F.stat.json&query=%24.translation&label=zh-CN + :target: https://app.transifex.com/python-doc/python-newest/ * - `3.13 `_ - .. image:: https://github.com/python/python-docs-zh-cn/workflows/python-313/badge.svg :target: https://github.com/python/python-docs-zh-cn/actions?workflow=python-313 - .. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpython%2Fpython-docs-zh-cn%2F3.13%2F.stat.json&query=%24.translation&label=zh-CN - :target: https://app.transifex.com/python-doc/python-newest/ + :target: https://app.transifex.com/python-doc/python-313/ * - `3.12 `_ - .. image:: https://github.com/python/python-docs-zh-cn/workflows/python-312/badge.svg :target: https://github.com/python/python-docs-zh-cn/actions?workflow=python-312