From 00dd9a5ed1c0bc60dc87957fa6ca2f121e4ce68f Mon Sep 17 00:00:00 2001 From: Shahar Naveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Thu, 9 Apr 2026 19:38:14 +0200 Subject: [PATCH 1/2] Unify python version used by CI. Update to `3.14.4` (#7571) * Add `.python-version` file * Modify CI to use `.python-version` file * Use correct path for `.python-version` file --- .github/workflows/ci.yaml | 8 -------- .github/workflows/cron-ci.yaml | 19 +++++++++---------- .github/workflows/lib-deps-check.yaml | 20 +++++++++++++------- .github/workflows/update-libs-status.yaml | 16 +++++++++++----- .github/workflows/upgrade-pylib.md | 2 +- .gitignore | 1 - .python-version | 1 + 7 files changed, 35 insertions(+), 32 deletions(-) create mode 100644 .python-version diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bdf452b8bcc..bb78a825a4c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,8 +26,6 @@ env: # - rustpython-compiler-source: deprecated # - rustpython-venvlauncher: Windows-only WORKSPACE_EXCLUDES: --exclude rustpython_wasm --exclude rustpython-compiler-source --exclude rustpython-venvlauncher - # Python version targeted by the CI. - PYTHON_VERSION: "3.14.3" X86_64_PC_WINDOWS_MSVC_OPENSSL_LIB_DIR: C:\Program Files\OpenSSL\lib\VC\x64\MD X86_64_PC_WINDOWS_MSVC_OPENSSL_INCLUDE_DIR: C:\Program Files\OpenSSL\include CARGO_INCREMENTAL: 0 @@ -259,8 +257,6 @@ jobs: save-if: ${{ github.ref == 'refs/heads/main' }} - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.PYTHON_VERSION }} - name: Install macOS dependencies uses: ./.github/actions/install-macos-deps @@ -362,8 +358,6 @@ jobs: persist-credentials: false - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.PYTHON_VERSION }} - uses: dtolnay/rust-toolchain@stable with: @@ -469,8 +463,6 @@ jobs: tar -xzf geckodriver-v0.36.0-linux64.tar.gz -C geckodriver - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ env.PYTHON_VERSION }} - run: python -m pip install -r requirements.txt working-directory: ./wasm/tests diff --git a/.github/workflows/cron-ci.yaml b/.github/workflows/cron-ci.yaml index a481e71de06..2e648e12cb7 100644 --- a/.github/workflows/cron-ci.yaml +++ b/.github/workflows/cron-ci.yaml @@ -13,7 +13,6 @@ name: Periodic checks/tasks env: CARGO_ARGS: --no-default-features --features stdlib,importlib,stdio,encodings,ssl-rustls,jit,host_env - PYTHON_VERSION: "3.14.3" jobs: # codecov collects code coverage data from the rust tests, python snippets and python test suite. @@ -30,9 +29,9 @@ jobs: - uses: dtolnay/rust-toolchain@stable - uses: taiki-e/install-action@cargo-llvm-cov - - uses: actions/setup-python@v6.2.0 - with: - python-version: ${{ env.PYTHON_VERSION }} + + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + - run: sudo apt-get update && sudo apt-get -y install lcov - name: Run cargo-llvm-cov with Rust tests. run: cargo llvm-cov --no-report --workspace --exclude rustpython_wasm --exclude rustpython-compiler-source --exclude rustpython-venvlauncher --verbose --no-default-features --features stdlib,importlib,stdio,encodings,ssl-rustls,jit,host_env @@ -96,9 +95,9 @@ jobs: persist-credentials: true - uses: dtolnay/rust-toolchain@stable - - uses: actions/setup-python@v6.2.0 - with: - python-version: ${{ env.PYTHON_VERSION }} + + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + - name: build rustpython run: cargo build --release --verbose - name: Collect what is left data @@ -157,9 +156,9 @@ jobs: persist-credentials: true - uses: dtolnay/rust-toolchain@stable - - uses: actions/setup-python@v6.2.0 - with: - python-version: ${{ env.PYTHON_VERSION }} + + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + - run: cargo install cargo-criterion - name: build benchmarks run: cargo build --release --benches diff --git a/.github/workflows/lib-deps-check.yaml b/.github/workflows/lib-deps-check.yaml index 1b0caea6759..b009c427df7 100644 --- a/.github/workflows/lib-deps-check.yaml +++ b/.github/workflows/lib-deps-check.yaml @@ -10,9 +10,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number }} cancel-in-progress: true -env: - PYTHON_VERSION: "3.14.3" - jobs: check_deps: permissions: @@ -37,9 +34,20 @@ jobs: # Checkout only Lib/ directory from PR head for accurate comparison git checkout ${{ github.event.pull_request.head.sha }} -- Lib/ - - name: Checkout CPython + - name: Get target CPython version + id: cpython-version run: | - git clone --depth 1 --branch "v${{ env.PYTHON_VERSION }}" https://github.com/python/cpython.git cpython + version=$(cat .python-version) + echo "version=${version}" >> "$GITHUB_OUTPUT" + + - name: Checkout CPython + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + repository: python/cpython + path: cpython + ref: "v${{ steps.cpython-version.outputs.version }}" + fetch-depth: 1 + persist-credentials: false - name: Get changed Lib files id: changed-files @@ -75,8 +83,6 @@ jobs: - name: Setup Python if: steps.changed-files.outputs.modules != '' uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: "${{ env.PYTHON_VERSION }}" - name: Run deps check if: steps.changed-files.outputs.modules != '' diff --git a/.github/workflows/update-libs-status.yaml b/.github/workflows/update-libs-status.yaml index 53685f88474..db32c7a3e94 100644 --- a/.github/workflows/update-libs-status.yaml +++ b/.github/workflows/update-libs-status.yaml @@ -13,7 +13,6 @@ permissions: issues: write env: - PYTHON_VERSION: "v3.14.3" ISSUE_ID: "6839" jobs: @@ -29,13 +28,20 @@ jobs: sparse-checkout: |- Lib scripts/update_lib + .python-version - - name: Clone CPython ${{ env.PYTHON_VERSION }} + - name: Get target CPython version + id: cpython-version + run: | + version=$(cat rustpython/.python-version) + echo "version=${version}" >> "$GITHUB_OUTPUT" + + - name: Clone CPython uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: repository: python/cpython path: cpython - ref: ${{ env.PYTHON_VERSION }} + ref: "v${{ steps.cpython-version.outputs.version }}" persist-credentials: false sparse-checkout: | Lib @@ -56,14 +62,14 @@ jobs: ## Summary - Check \`scripts/update_lib\` for tools. As a note, the current latest Python version is \`${{ env.PYTHON_VERSION }}\`. + Check \`scripts/update_lib\` for tools. As a note, the current latest Python version is \`${{ steps.cpython-version.outputs.version }}\`. Previous versions' issues as reference - 3.13: #5529