From f409229c6268e32ae7178d239c903704c18bd4ff Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Mon, 6 Oct 2025 22:32:17 -0700 Subject: [PATCH 1/2] Fix python source hash checking --- .github/workflows/build-cross-action.yml | 78 +++++----- .github/workflows/build-native-action.yml | 102 +++++++----- .github/workflows/deploy-build-action.yml | 118 -------------- .github/workflows/github-release.yml | 67 ++++---- .github/workflows/package-action.yml | 4 +- .github/workflows/pre-commit-action.yml | 4 +- .github/workflows/test-action.yml | 4 +- .github/workflows/test-fips-action.yml | 22 ++- .github/workflows/verify-build-action.yml | 78 +++++++--- relenv/build/__init__.py | 3 +- relenv/common.py | 8 + relenv/python-versions.json | 179 +++++++++++++++++++++- relenv/pyversions.py | 46 +++++- 13 files changed, 450 insertions(+), 263 deletions(-) delete mode 100644 .github/workflows/deploy-build-action.yml diff --git a/.github/workflows/build-cross-action.yml b/.github/workflows/build-cross-action.yml index 81964d61..7d660658 100644 --- a/.github/workflows/build-cross-action.yml +++ b/.github/workflows/build-cross-action.yml @@ -19,16 +19,18 @@ jobs: fail-fast: false matrix: version: - - 3.10.18 - - 3.11.13 - - 3.12.11 - - 3.13.5 + - '3.10' + - '3.11' + - '3.12' + - '3.13' host: - x86_64 - aarch64 target: - x86_64 - aarch64 + outputs: + version: ${{ steps.python-version.outputs.version }} name: "Python ${{ matrix.version }} Linux ${{ matrix.target }} on ${{ matrix.host }}" @@ -66,22 +68,19 @@ jobs: name: toolchain-${{ matrix.host }}-${{ matrix.target }}-linux-gnu.tar.xz path: toolchain/toolchain-${{ matrix.host }}-${{ matrix.target }}-linux-gnu.tar.xz - - name: Extract Toolchain Artifact + - name: Determine Python Version + id: python-version run: | - tar -C toolchain -xvf toolchain/toolchain-${{ matrix.host }}-${{ matrix.target }}-linux-gnu.tar.xz - - #- name: Fetch Toolchain - # run: | - # python3 -m relenv toolchain fetch --arch=${{ matrix.target }} + echo "version=$(python3 -m relenv versions --version=${{ matrix.version }})" | tee -a "$GITHUB_OUTPUT" - name: Fetch Native Build if: ${{ matrix.host != matrix.target }} run: | - python3 -m relenv fetch --python=${{ matrix.version }} + python3 -m relenv fetch --python=${{ steps.python-version.ouputs.version }} - name: Build run: | - python3 -m relenv build --arch=${{ matrix.target }} --python=${{ matrix.version }} + python3 -m relenv build --arch=${{ matrix.target }} --python=${{ steps.python-version.outputs.version }} - name: Verify Build if: ${{ matrix.host == matrix.target }} @@ -92,7 +91,7 @@ jobs: uses: actions/upload-artifact@v4 if: always() with: - name: ${{ matrix.version }}-${{ matrix.host }}-${{ matrix.target }}-linux-gnu-logs + name: ${{ steps.python-version.outputs.version }}-${{ matrix.host }}-${{ matrix.target }}-linux-gnu-logs path: logs/* retention-days: 5 @@ -100,8 +99,8 @@ jobs: uses: actions/upload-artifact@v4 if: ${{ matrix.host == matrix.target }} with: - name: ${{ matrix.version }}-${{ matrix.target }}-linux-gnu.tar.xz - path: build/${{ matrix.version }}-${{ matrix.target }}-linux-gnu.tar.xz + name: ${{ steps.python-version.outputs.version }}-${{ matrix.target }}-linux-gnu.tar.xz + path: build/${{ steps.python-version.outputs.version }}-${{ matrix.target }}-linux-gnu.tar.xz retention-days: 5 build_macos: @@ -113,13 +112,15 @@ jobs: fail-fast: false matrix: version: - - 3.10.18 - - 3.11.13 - - 3.12.11 - - 3.13.5 + - '3.10' + - '3.11' + - '3.12' + - '3.13' arch: - x86_64 + outputs: + version: ${{ steps.python-version.outputs.version }} env: RELENV_DATA: ${{ github.workspace }} @@ -134,9 +135,13 @@ jobs: run: | brew uninstall --ignore-dependencies gettext + - name: Determine Python Version + id: python-version + run: | + echo "version=$(python3 -m relenv versions --version=${{ matrix.version }})" | tee -a "$GITHUB_OUTPUT" - name: Build run: | - python3 -m relenv build --python=${{ matrix.version }} + python3 -m relenv build --python=${{ steps.python-version.outputs.version }} - name: Re-install gettext run: | @@ -150,15 +155,15 @@ jobs: uses: actions/upload-artifact@v4 if: always() with: - name: ${{ matrix.version }}-${{ matrix.arch }}-macos-logs + name: ${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-macos-logs path: logs/* retention-days: 5 - name: Python build uses: actions/upload-artifact@v4 with: - name: ${{ matrix.version }}-${{ matrix.arch }}-macos.tar.xz - path: build/${{ matrix.version }}-${{ matrix.arch }}-macos.tar.xz + name: ${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-macos.tar.xz + path: build/${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-macos.tar.xz retention-days: 5 build_windows: @@ -169,14 +174,16 @@ jobs: fail-fast: false matrix: version: - - 3.10.18 - - 3.11.13 - - 3.12.11 - - 3.13.5 + - '3.10' + - '3.11' + - '3.12' + - '3.13' arch: - amd64 - x86 + outputs: + version: ${{ steps.python-version.outputs.version }} env: RELENV_DATA: ${{ github.workspace }} @@ -191,14 +198,15 @@ jobs: run: | pip3 install nox - # - name: Fetch Native Build - # if: ${{ matrix.arch != 'amd64' }} - # run: | - # python3 -m relenv fetch --python=${{ matrix.version }} + - name: Determine Python Version + id: python-version + run: | + echo "version=$(python3 -m relenv versions --version=${{ matrix.version }})" | tee -a "$GITHUB_OUTPUT" + - name: Build Python with Relenv run: | - python -m relenv build --arch=${{ matrix.arch }} --python=${{ matrix.version }} + python -m relenv build --arch=${{ matrix.arch }} --python=${{ steps.python-version.outputs.version }} - name: Verify Build if: ${{ matrix.arch == 'amd64' }} @@ -209,13 +217,13 @@ jobs: uses: actions/upload-artifact@v4 if: always() with: - name: ${{ matrix.version }}-${{ matrix.arch }}-windows-logs + name: ${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-windows-logs path: logs/* retention-days: 5 - name: Upload Zipfile uses: actions/upload-artifact@v4 with: - name: ${{ matrix.version }}-${{ matrix.arch }}-win.tar.xz - path: build/${{ matrix.version }}-${{ matrix.arch }}-win.tar.xz + name: ${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-win.tar.xz + path: build/${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-win.tar.xz retention-days: 5 diff --git a/.github/workflows/build-native-action.yml b/.github/workflows/build-native-action.yml index e6306b3b..2b72e6b3 100644 --- a/.github/workflows/build-native-action.yml +++ b/.github/workflows/build-native-action.yml @@ -38,10 +38,10 @@ jobs: fail-fast: false matrix: version: - - 3.10.18 - - 3.11.13 - - 3.12.11 - - 3.13.5 + - '3.10' + - '3.11' + - '3.12' + - '3.13' host: - x86_64 - aarch64 @@ -50,6 +50,8 @@ jobs: target: x86_64 - host: aarch64 target: aarch64 + outputs: + version: ${{ steps.python-version.outputs.version }} needs: - download-dependencies name: "Python ${{ matrix.version }} Linux ${{ matrix.target }} on ${{ matrix.host }}" @@ -66,10 +68,10 @@ jobs: - uses: actions/checkout@v3 - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.11' - name: Install Dependencies run: | @@ -93,15 +95,20 @@ jobs: run: | tree $RELENV_DATA/download + - name: Determine Python Version + id: python-version + run: | + echo "version=$(python3 -m relenv versions --version=${{ matrix.version }})" | tee -a "$GITHUB_OUTPUT" + - name: Build run: | - venv/bin/python3 -m relenv build --no-pretty --arch=${{ matrix.target }} --python=${{ matrix.version }} + venv/bin/python3 -m relenv build --no-pretty --arch=${{ matrix.target }} --python=${{ steps.python-version.outputs.version }} - name: Linux Logs uses: actions/upload-artifact@v4 if: always() with: - name: ${{ matrix.version }}-${{ matrix.host }}-${{ matrix.target }}-linux-gnu-logs + name: ${{ steps.python-version.outputs.version }}-${{ matrix.host }}-${{ matrix.target }}-linux-gnu-logs path: logs/* retention-days: 5 @@ -109,8 +116,8 @@ jobs: uses: actions/upload-artifact@v4 if: ${{ matrix.host == matrix.target && always() }} with: - name: ${{ matrix.version }}-${{ matrix.target }}-linux-gnu.tar.xz - path: build/${{ matrix.version }}-${{ matrix.target }}-linux-gnu.tar.xz + name: ${{ steps.python-version.outputs.version }}-${{ matrix.target }}-linux-gnu.tar.xz + path: build/${{ steps.python-version.outputs.version }}-${{ matrix.target }}-linux-gnu.tar.xz retention-days: 5 build_macos_12_x86_64: @@ -120,12 +127,14 @@ jobs: fail-fast: false matrix: version: - - 3.10.18 - - 3.11.13 - - 3.12.11 - - 3.13.5 + - '3.10' + - '3.11' + - '3.12' + - '3.13' arch: - x86_64 + outputs: + version: ${{ steps.python-version.outputs.version }} env: RELENV_DATA: ${{ github.workspace }} steps: @@ -155,23 +164,28 @@ jobs: run: | pip3 install nox + - name: Determine Python Version + id: python-version + run: | + echo "version=$(python3 -m relenv versions --version=${{ matrix.version }})" | tee -a "$GITHUB_OUTPUT" + - name: Build run: | - python3 -m relenv build --no-pretty --python=${{ matrix.version }} + python3 -m relenv build --no-pretty --python=${{ steps.python-version.outputs.version }} - name: MacOS Logs uses: actions/upload-artifact@v4 if: always() with: - name: ${{ matrix.version }}-${{ matrix.arch }}-macos-logs + name: ${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-macos-logs path: logs/* retention-days: 5 - - name: "Upload artifact: build/${{ matrix.version }}-${{ matrix.arch }}-macos.tar.xz" + - name: "Upload artifact: build/${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-macos.tar.xz" uses: actions/upload-artifact@v4 with: - name: ${{ matrix.version }}-${{ matrix.arch }}-macos.tar.xz - path: build/${{ matrix.version }}-${{ matrix.arch }}-macos.tar.xz + name: ${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-macos.tar.xz + path: build/${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-macos.tar.xz retention-days: 5 build_macos_13_arm64: @@ -183,12 +197,14 @@ jobs: fail-fast: false matrix: version: - - 3.10.18 - - 3.11.13 - - 3.12.11 - - 3.13.5 + - '3.10' + - '3.11' + - '3.12' + - '3.13' arch: - arm64 + outputs: + version: ${{ steps.python-version.outputs.version }} env: RELENV_DATA: ${{ github.workspace }} steps: @@ -218,23 +234,28 @@ jobs: run: | brew install nox + - name: Determine Python Version + id: python-version + run: | + echo "version=$(python3 -m relenv versions --version=${{ matrix.version }})" | tee -a "$GITHUB_OUTPUT" + - name: Build run: | - python3 -m relenv build --no-pretty --python=${{ matrix.version }} + python3 -m relenv build --no-pretty --python=${{ steps.python-version.outputs.version }} - name: MacOS Logs uses: actions/upload-artifact@v4 if: always() with: - name: ${{ matrix.version }}-${{ matrix.arch }}-macos-logs + name: ${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-macos-logs path: logs/* retention-days: 5 - name: Python build uses: actions/upload-artifact@v4 with: - name: ${{ matrix.version }}-${{ matrix.arch }}-macos.tar.xz - path: build/${{ matrix.version }}-${{ matrix.arch }}-macos.tar.xz + name: ${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-macos.tar.xz + path: build/${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-macos.tar.xz retention-days: 5 build_windows: @@ -244,15 +265,17 @@ jobs: fail-fast: false matrix: version: - - 3.10.18 - - 3.11.13 - - 3.12.11 - - 3.13.5 + - '3.10' + - '3.11' + - '3.12' + - '3.13' arch: - amd64 - x86 env: RELENV_DATA: ${{ github.workspace }} + outputs: + version: ${{ steps.python-version.outputs.version }} steps: - name: "Throttle Builds" if: false @@ -262,10 +285,10 @@ jobs: - uses: actions/checkout@v3 - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.11' - name: Install VS Build Tools run: | @@ -282,23 +305,28 @@ jobs: run: | python3 -m relenv fetch --python=3.10.15 + - name: Determine Python Version + id: python-version + run: | + echo "version=$(python3 -m relenv versions --version=${{ matrix.version }})" | tee -a "$env:GITHUB_OUTPUT" + - name: Build Python with Relenv env: RELENV_NATIVE_PY_VERSION: 3.10.15 run: | - python -m relenv build --no-pretty --arch=${{ matrix.arch }} --python=${{ matrix.version }} + python -m relenv build --no-pretty --arch=${{ matrix.arch }} --python=${{ steps.python-version.outputs.version }} - name: Upload Build Logs uses: actions/upload-artifact@v4 if: always() with: - name: ${{ matrix.version }}-${{ matrix.arch }}-windows-logs + name: ${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-windows-logs path: logs/* retention-days: 5 - name: Upload Zipfile uses: actions/upload-artifact@v4 with: - name: ${{ matrix.version }}-${{ matrix.arch }}-win.tar.xz - path: build/${{ matrix.version }}-${{ matrix.arch }}-win.tar.xz + name: ${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-win.tar.xz + path: build/${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-win.tar.xz retention-days: 5 diff --git a/.github/workflows/deploy-build-action.yml b/.github/workflows/deploy-build-action.yml deleted file mode 100644 index aa920705..00000000 --- a/.github/workflows/deploy-build-action.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: Deploy Artifacts - -on: - workflow_call: - inputs: - version: - required: false - type: string - description: Version to author - - -jobs: - upload_artifacts: - name: Deploy Artifacts ${{ matrix.python }}-${{ matrix.arch }}-${{ matrix.platform }} - runs-on: - - self-hosted - - linux - - repo-release - environment: release - strategy: - matrix: - include: - - platform: linux-gnu - arch: x86_64 - python: 3.10.18 - - platform: linux-gnu - arch: x86_64 - python: 3.11.13 - - platform: linux-gnu - arch: x86_64 - python: 3.12.11 - - platform: linux-gnu - arch: x86_64 - python: 3.13.5 - - platform: linux-gnu - arch: aarch64 - python: 3.10.18 - - platform: linux-gnu - arch: aarch64 - python: 3.11.13 - - platform: linux-gnu - arch: aarch64 - python: 3.12.11 - - platform: linux-gnu - arch: aarch64 - python: 3.13.5 - - - platform: win - arch: x86 - python: 3.10.18 - - platform: win - arch: x86 - python: 3.11.13 - - platform: win - arch: x86 - python: 3.12.11 - - platform: win - arch: x86 - python: 3.13.5 - - platform: win - arch: amd64 - python: 3.10.18 - - platform: win - arch: amd64 - python: 3.11.13 - - platform: win - arch: amd64 - python: 3.12.11 - - platform: win - arch: amd64 - python: 3.13.5 - - - platform: macos - arch: x86_64 - python: 3.10.18 - - platform: macos - arch: x86_64 - python: 3.11.13 - - platform: macos - arch: x86_64 - python: 3.12.11 - - platform: macos - arch: x86_64 - python: 3.13.5 - - platform: macos - arch: arm64 - python: 3.10.18 - - platform: macos - arch: arm64 - python: 3.11.13 - - platform: macos - arch: arm64 - python: 3.12.11 - - platform: macos - arch: arm64 - python: 3.13.5 - - steps: - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - name: ${{ matrix.python }}-${{ matrix.arch }}-${{ matrix.platform }}.tar.xz - path: release-artifacts/ - - - name: Get Salt Project GitHub Actions Bot Environment - id: spb-environment - run: | - TOKEN=$(curl -sS -f -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 30") - SPB_ENVIRONMENT=$(curl -sS -f -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/tags/instance/spb:environment) - echo "spb-environment=$SPB_ENVIRONMENT" >> "$GITHUB_OUTPUT" - - - name: Install `awscli` - run: | - pip3 install awscli - - - name: "Deploy Python Build: ${{ matrix.python }}-${{ matrix.arch }}-${{ matrix.platform }}.tar.xz" - run: | - aws s3 cp release-artifacts/* s3://salt-project-${{ steps.spb-environment.outputs.spb-environment }}-salt-artifacts-release/relenv/${{ inputs.version }}/build/ diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index e42a11bc..a6a948c6 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -13,6 +13,7 @@ jobs: runs-on: ubuntu-latest outputs: url: ${{ steps.output_url.outputs.url }} + version: ${{ steps.python-version.outputs.version }} steps: - name: Download Python Build Artifacts uses: actions/download-artifact@v4 @@ -75,91 +76,101 @@ jobs: include: - platform: linux-gnu arch: x86_64 - python: 3.10.18 + python: '3.10' - platform: linux-gnu arch: x86_64 - python: 3.11.13 + python: '3.11' - platform: linux-gnu arch: x86_64 - python: 3.12.11 + python: '3.12' - platform: linux-gnu arch: x86_64 - python: 3.13.5 + python: '3.13' - platform: linux-gnu arch: aarch64 - python: 3.10.18 + python: '3.10' - platform: linux-gnu arch: aarch64 - python: 3.11.13 + python: '3.11' - platform: linux-gnu arch: aarch64 - python: 3.12.11 + python: '3.12' - platform: linux-gnu arch: aarch64 - python: 3.13.5 + python: '3.13' - platform: win arch: x86 - python: 3.10.18 + python: '3.10' - platform: win arch: x86 - python: 3.11.13 + python: '3.11' - platform: win arch: x86 - python: 3.12.11 + python: '3.12' - platform: win arch: x86 - python: 3.13.5 + python: '3.13' - platform: win arch: amd64 - python: 3.10.18 + python: '3.10' - platform: win arch: amd64 - python: 3.11.13 + python: '3.11' - platform: win arch: amd64 - python: 3.12.11 + python: '3.12' - platform: win arch: amd64 - python: 3.13.5 + python: '3.13' - platform: macos arch: x86_64 - python: 3.10.18 + python: '3.10' - platform: macos arch: x86_64 - python: 3.11.13 + python: '3.11' - platform: macos arch: x86_64 - python: 3.12.11 + python: '3.12' - platform: macos arch: x86_64 - python: 3.13.5 + python: '3.13' - platform: macos arch: arm64 - python: 3.10.18 + python: '3.10' - platform: macos arch: arm64 - python: 3.11.13 + python: '3.11' - platform: macos arch: arm64 - python: 3.12.11 + python: '3.12' - platform: macos arch: arm64 - python: 3.13.5 + python: '3.13' steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Determine Python Version + id: python-version + run: | + echo "version=$(python3 -m relenv versions --version=${{ matrix.version }})" | tee -a "$GITHUB_OUTPUT" - name: Download Artifacts uses: actions/download-artifact@v4 with: - name: ${{ matrix.python }}-${{ matrix.arch }}-${{ matrix.platform }}.tar.xz + name: ${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-${{ matrix.platform }}.tar.xz path: ./ - - name: Upload ${{ matrix.python }}-${{ matrix.arch }}-${{ matrix.platform }}.tar.xz + - name: Upload ${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-${{ matrix.platform }}.tar.xz id: upload-python-build-assets uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.release.outputs.url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_name: ${{ matrix.python }}-${{ matrix.arch }}-${{ matrix.platform }}.tar.xz - asset_path: ./${{ matrix.python }}-${{ matrix.arch }}-${{ matrix.platform }}.tar.xz + asset_name: ${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-${{ matrix.platform }}.tar.xz + asset_path: ./${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-${{ matrix.platform }}.tar.xz asset_content_type: application/tar+xz diff --git a/.github/workflows/package-action.yml b/.github/workflows/package-action.yml index 9fcafa66..a151da7b 100644 --- a/.github/workflows/package-action.yml +++ b/.github/workflows/package-action.yml @@ -50,10 +50,10 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - uses: actions/checkout@master - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.11" - name: Install pypa/build run: >- python -m diff --git a/.github/workflows/pre-commit-action.yml b/.github/workflows/pre-commit-action.yml index b3940373..f6681aae 100644 --- a/.github/workflows/pre-commit-action.yml +++ b/.github/workflows/pre-commit-action.yml @@ -16,10 +16,10 @@ jobs: steps: - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.11" - name: Install System Deps run: | diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index bf845e65..98452164 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -25,10 +25,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.11" - name: Install python dependencies run: | diff --git a/.github/workflows/test-fips-action.yml b/.github/workflows/test-fips-action.yml index 9851983b..07df36b5 100644 --- a/.github/workflows/test-fips-action.yml +++ b/.github/workflows/test-fips-action.yml @@ -14,12 +14,14 @@ jobs: fail-fast: false matrix: version: - - 3.10.18 - - 3.11.13 - - 3.12.11 - - 3.13.5 + - '3.10' + - '3.11' + - '3.12' + - '3.13' arch: - x86_64 + outputs: + version: ${{ steps.python-version.outputs.version }} env: RELENV_DATA: ${{ github.workspace }} @@ -31,10 +33,20 @@ jobs: - uses: actions/checkout@v3 + - name: Set up Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Determine Python Version + id: python-version + run: | + echo "version=$(python3 -m relenv versions --version=${{ matrix.version }})" | tee -a "$GITHUB_OUTPUT" + - name: Download Build Artifact uses: actions/download-artifact@v4 with: - name: ${{ matrix.version }}-${{ matrix.arch }}-linux-gnu.tar.xz + name: ${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-linux-gnu.tar.xz path: ./build/ - name: Create Virtual Environment diff --git a/.github/workflows/verify-build-action.yml b/.github/workflows/verify-build-action.yml index a7f2c9ee..97d73c26 100644 --- a/.github/workflows/verify-build-action.yml +++ b/.github/workflows/verify-build-action.yml @@ -15,10 +15,10 @@ jobs: fail-fast: false matrix: version: - - 3.10.18 - - 3.11.13 - - 3.12.11 - - 3.13.5 + - '3.10' + - '3.11' + - '3.12' + - '3.13' host: - x86_64 - aarch64 @@ -27,6 +27,8 @@ jobs: target: x86_64 - host: aarch64 target: aarch64 + outputs: + version: ${{ steps.python-version.outputs.version }} name: "Verify Linux" runs-on: @@ -50,15 +52,20 @@ jobs: virtualenv venv venv/bin/python3 -m pip install nox ppbt + - name: Determine Python Version + id: python-version + run: | + echo "version=$(python3 -m relenv versions --version=${{ matrix.version }})" | tee -a "$GITHUB_OUTPUT" + - name: Python Version run: | venv/bin/python3 --version venv/bin/python3 -c 'import os; print(os.name)' - - name: "Download artifact: build/${{ matrix.version }}-${{ matrix.target }}-linux-gnu.tar.xz" + - name: "Download artifact: build/${{ steps.python-version.outputs.version }}-${{ matrix.target }}-linux-gnu.tar.xz" uses: actions/download-artifact@v4 with: - name: ${{ matrix.version }}-${{ matrix.target }}-linux-gnu.tar.xz + name: ${{ steps.python-version.outputs.version }}-${{ matrix.target }}-linux-gnu.tar.xz path: build/ - name: Verify Build @@ -70,7 +77,7 @@ jobs: uses: actions/upload-artifact@v4 if: always() with: - name: ${{ matrix.version }}-${{ matrix.host }}-${{ matrix.target }}-linux-gnu-logs + name: ${{ steps.python-version.outputs.version }}-${{ matrix.host }}-${{ matrix.target }}-linux-gnu-logs path: logs/* retention-days: 5 @@ -83,13 +90,15 @@ jobs: fail-fast: false matrix: version: - - 3.10.18 - - 3.11.13 - - 3.12.11 - - 3.13.5 + - '3.10' + - '3.11' + - '3.12' + - '3.13' arch: - x86_64 + outputs: + version: ${{ steps.python-version.outputs.version }} env: RELENV_DATA: ${{ github.workspace }} @@ -105,6 +114,11 @@ jobs: run: | env + - name: Determine Python Version + id: python-version + run: | + echo "version=$(python3 -m relenv versions --version=${{ matrix.version }})" | tee -a "$GITHUB_OUTPUT" + - name: Install nox run: | pip3 install nox @@ -112,7 +126,7 @@ jobs: - name: "Download artifact: build/${{ matrix.version }}-${{ matrix.arch }}-macos.tar.xz" uses: actions/download-artifact@v4 with: - name: ${{ matrix.version }}-${{ matrix.arch }}-macos.tar.xz + name: ${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-macos.tar.xz path: build/ - name: Verify Build @@ -123,7 +137,7 @@ jobs: uses: actions/upload-artifact@v4 if: always() with: - name: ${{ matrix.version }}-${{ matrix.arch }}-macos-logs + name: ${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-macos-logs path: logs/* retention-days: 5 @@ -136,13 +150,15 @@ jobs: fail-fast: false matrix: version: - - 3.10.18 - - 3.11.13 - - 3.12.11 - - 3.13.5 + - '3.10' + - '3.11' + - '3.12' + - '3.13' arch: - arm64 + outputs: + version: ${{ steps.python-version.outputs.version }} env: RELENV_DATA: ${{ github.workspace }} @@ -167,10 +183,15 @@ jobs: run: | brew install nox + - name: Determine Python Version + id: python-version + run: | + echo "version=$(python3 -m relenv versions --version=${{ matrix.version }})" | tee -a "$GITHUB_OUTPUT" + - name: "Download artifact: build/${{ matrix.version }}-${{ matrix.arch }}-macos.tar.xz" uses: actions/download-artifact@v4 with: - name: ${{ matrix.version }}-${{ matrix.arch }}-macos.tar.xz + name: ${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-macos.tar.xz path: build/ - name: Verify Build @@ -181,7 +202,7 @@ jobs: uses: actions/upload-artifact@v4 if: always() with: - name: ${{ matrix.version }}-${{ matrix.arch }}-macos-logs + name: ${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-macos-logs path: logs/* retention-days: 5 @@ -194,14 +215,16 @@ jobs: fail-fast: false matrix: version: - - 3.10.18 - - 3.11.13 - - 3.12.11 - - 3.13.5 + - '3.10' + - '3.11' + - '3.12' + - '3.13' arch: - amd64 - x86 + outputs: + version: ${{ steps.python-version.outputs.version }} env: RELENV_DATA: ${{ github.workspace }} @@ -221,10 +244,15 @@ jobs: run: | pip3 install nox + - name: Determine Python Version + id: python-version + run: | + echo "version=$(python3 -m relenv versions --version=${{ matrix.version }})" | tee -a "$env:GITHUB_OUTPUT" + - name: "Download artifact: build/${{ matrix.version }}-${{ matrix.arch }}-win.tar.xz" uses: actions/download-artifact@v4 with: - name: ${{ matrix.version }}-${{ matrix.arch }}-win.tar.xz + name: ${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-win.tar.xz path: build/ - name: Verify Build @@ -236,6 +264,6 @@ jobs: uses: actions/upload-artifact@v4 if: always() with: - name: ${{ matrix.version }}-${{ matrix.arch }}-windows-logs + name: ${{ steps.python-version.outputs.version }}-${{ matrix.arch }}-windows-logs path: logs/* retention-days: 5 diff --git a/relenv/build/__init__.py b/relenv/build/__init__.py index 6de0b692..9709e2bc 100644 --- a/relenv/build/__init__.py +++ b/relenv/build/__init__.py @@ -152,7 +152,7 @@ def main(args): build_version = requested else: pyversions = python_versions(args.python) - build_version = pyversions[0] + build_version = pyversions.keys()[0] # print(pyversions) # print(pyversions[0].major) @@ -168,6 +168,7 @@ def main(args): build.version = str(build_version) build.dirs.version = str(build_version) build.recipies["python"]["download"].version = str(build_version) + build.recipies["python"]["download"].checksum = pyversions[build_version] if args.check_versions: if not CHECK_VERSIONS_SUPPORT: diff --git a/relenv/common.py b/relenv/common.py index b044d76b..d83f6eed 100644 --- a/relenv/common.py +++ b/relenv/common.py @@ -750,6 +750,14 @@ def __str__(self): # XXX What if minor was None but micro was an int. return _ + def __hash__(self): + """ + Hash of the version. + + Hash the major, minor, and micro attributes. + """ + return hash((self.major, self.minor, self.micro)) + @staticmethod def parse_string(data): """ diff --git a/relenv/python-versions.json b/relenv/python-versions.json index c4b331fb..3e10fc1e 100644 --- a/relenv/python-versions.json +++ b/relenv/python-versions.json @@ -1 +1,178 @@ -{"versions": ["3.13.7", "3.13.6", "3.13.5", "3.13.4", "3.13.3", "3.13.2", "3.13.1", "3.13.0", "3.12.11", "3.12.10", "3.12.9", "3.12.8", "3.12.7", "3.12.6", "3.12.5", "3.12.4", "3.12.3", "3.12.2", "3.12.1", "3.12.0", "3.11.13", "3.11.12", "3.11.11", "3.11.10", "3.11.9", "3.11.8", "3.11.7", "3.11.6", "3.11.5", "3.11.4", "3.11.3", "3.11.2", "3.11.1", "3.11.0", "3.10.18", "3.10.17", "3.10.16", "3.10.15", "3.10.14", "3.10.13", "3.10.12", "3.10.11", "3.10.10", "3.10.9", "3.10.8", "3.10.7", "3.10.6", "3.10.5", "3.10.4", "3.10.3", "3.10.2", "3.10.1", "3.10.0", "3.9.23", "3.9.22", "3.9.21", "3.9.20", "3.9.19", "3.9.18", "3.9.17", "3.9.16", "3.9.15", "3.9.14", "3.9.13", "3.9.12", "3.9.11", "3.9.10", "3.9.9", "3.9.8", "3.9.7", "3.9.6", "3.9.5", "3.9.4", "3.9.2", "3.9.1", "3.9.0", "3.8.20", "3.8.19", "3.8.18", "3.8.17", "3.8.16", "3.8.15", "3.8.14", "3.8.13", "3.8.12", "3.8.11", "3.8.10", "3.8.9", "3.8.8", "3.8.7", "3.8.6", "3.8.5", "3.8.4", "3.8.3", "3.8.2", "3.8.1", "3.8.0", "3.7.17", "3.7.16", "3.7.15", "3.7.14", "3.7.13", "3.7.12", "3.7.11", "3.7.10", "3.7.9", "3.7.8", "3.7.7", "3.7.6", "3.7.5", "3.7.4", "3.7.3", "3.7.2", "3.7.1", "3.7.0", "3.6.15", "3.6.14", "3.6.13", "3.6.12", "3.6.11", "3.6.10", "3.6.9", "3.6.8", "3.6.7", "3.6.6", "3.6.5", "3.6.4", "3.6.3", "3.6.2", "3.6.1", "3.6.0", "3.5.10", "3.5.9", "3.5.8", "3.5.7", "3.5.6", "3.5.5", "3.5.4", "3.5.3", "3.5.2", "3.5.1", "3.5.0", "3.4.10", "3.4.9", "3.4.8", "3.4.7", "3.4.6", "3.4.5", "3.4.4", "3.4.3", "3.4.2", "3.4.1", "3.4.0", "3.3.7", "3.3.6", "3.3.5", "3.3.4", "3.3.3", "3.3.2", "3.3.1", "3.3.0", "3.2.6", "3.2.5", "3.2.4", "3.2.3", "3.2.2", "3.2.1", "3.2.0", "3.1.5", "3.1.4", "3.1.3", "3.1.2", "3.1.1", "3.1.0", "3.0.1", "3.0.0"]} \ No newline at end of file +{ + "3.13.7": "dc08d8b8154ff9e132c1db5d089079136273dc90", + "3.13.6": "6e69138f7e2e95244f7780ba3d5664dda80551e7", + "3.13.5": "dbf3aed444cbb2221eabfb52688aa371423aa0ba", + "3.13.4": "c288ab7716f3633f8927a5fe75f46d65cb712415", + "3.13.3": "f26085cf12daef7b60b8a6fe93ef988b9a094aea", + "3.13.2": "e4949d999f28d6ad941e766b7dac09a74efbc912", + "3.13.1": "4b0c2a49a848c3c5d611416099636262a0b9090f", + "3.13.0": "0f71dce4a3251460985a944bbd1d1b7db1660a91", + "3.12.11": "603f20426ba4942552a38493bb987c9b832ee321", + "3.12.10": "7dbdb09971278d93d387f2e045ee04c83d9f7bfa", + "3.12.9": "465d8a664e63dc5aa1f0d90cd1d0000a970ee2fb", + "3.12.8": "8872c7a124c6970833e0bde4f25d6d7d61c6af6e", + "3.12.7": "5a760bbc42c67f1a0aef5bcf7c329348fb88448b", + "3.12.6": "6d2bbe1603b01764c541608938766233bf56f780", + "3.12.5": "d9b83c17a717e1cbd3ab6bd14cfe3e508e6d87b2", + "3.12.4": "c221421f3ba734daaf013dbdc7b48aa725cea18e", + "3.12.3": "3df73004a9b224d021fd397724e8bd4f9b6cc824", + "3.12.2": "040eac171c17062253042f7faafea830b03bf07b", + "3.12.1": "5b11c58ea58cd6b8e1943c7e9b5f6e0997ca3632", + "3.12.0": "bb2792439baa2014f11652f3ce44d354d0d59a76", + "3.11.13": "fec9a494efd3520f7efe6f822111f22249549d0a", + "3.11.12": "85370474d7d0268c46ba5cf0d1473e3d06c17dd6", + "3.11.11": "acf539109b024d3c5f1fc63d6e7f08cd294ba56d", + "3.11.10": "eb0ee5c84407445809a556592008cfc1867a39bc", + "3.11.9": "926cd6a577b2e8dcbb17671b30eda04019328ada", + "3.11.8": "a368aeed7a3325e47b55168452c356a8eb27ab50", + "3.11.7": "f2534d591121f3845388fbdd6a121b96dfe305a6", + "3.11.6": "932f9833ee6d70a530a21d7c12c490a42c8b1574", + "3.11.5": "b13ec58fa6ebf5b0f7178555c5506e135cb7d785", + "3.11.4": "413b3715d919a7b473281529ab91eeea5c82e632", + "3.11.3": "baea3ce79cf35e53b4155a5f700516abcd14f49d", + "3.11.2": "ae1c199ecb7a969588b15354e19e7b60cb65d1b9", + "3.11.1": "89ee31611b73dc0c32c178d15aa208734b462c5a", + "3.11.0": "474838615eab658fc15c87d4bee6bf85a02b424d", + "3.10.18": "2b59becca67037125c08a82519beccfdb98a48cc", + "3.10.17": "d31d548cd2c5ca2ae713bebe346ba15e8406633a", + "3.10.16": "401e6a504a956c8f0aab76c4f3ad9df601a83eb1", + "3.10.15": "f498fd8921e3c37e6aded9acb11ed23c8daa0bbe", + "3.10.14": "9103b4716dff30b40fd0239982f3a2d851143a46", + "3.10.13": "fa66c061cba1acee5e9fe69b7d22cca744a6ecda", + "3.10.12": "85e043a6cd30835bdf95e3db2d1b4b15e142d067", + "3.10.11": "53eddc7bf687c4678dc594b2dc74126b48a4fa29", + "3.10.10": "5d250cd5d492df838a4d5279df40a90ace720b0c", + "3.10.9": "a6ab44fa6c7dc31506ee262b2f6ad10735ffe750", + "3.10.8": "49ca7a5be7f13375e863442fbd9ead893ace3238", + "3.10.7": "e1d4c71059170ba841af310a04e0b4d7c38cb844", + "3.10.6": "b5a3c74b281ab2e8e56779bbb9aeead1d92fed02", + "3.10.5": "b80b9c13bb6ba5eb8762ca0d2b888c404582a405", + "3.10.4": "8f684863b92bf43936b16dbb867e392f10e8ffc7", + "3.10.3": "5cd4ef548b1649a9a4fd78f5b7c5a86acdbd5001", + "3.10.2": "e618946549cca1eb0d6d4cdf516003fec3975003", + "3.10.1": "1a534e99b95db0d30dacc8f10418cc5758b04df7", + "3.10.0": "c6114b411b7e6d26fc9887c11c0800d9625f1ade", + "3.9.23": "73d07237b70b19e4cd530bbc204cccd668ec05d4", + "3.9.22": "898d81887f0f36f2a71677b657d8400fd526fd55", + "3.9.21": "d968a953f19c6fc3bf54b5ded5c06852197ebddc", + "3.9.20": "52902dd820d2d41c47ef927ecebb24a96a51cc4b", + "3.9.19": "57d08ec0b329a78923b486abae906d4fa12fadb7", + "3.9.18": "abe4a20dcc11798495b17611ef9f8f33d6975722", + "3.9.17": "34a6d24cef87fbf22b943d4fe22100a9bf0b3782", + "3.9.16": "19acd6a341e4f2d7ff97c10c2eada258e9898624", + "3.9.15": "0ffa1114d627ddb4f61f3041880e43b478552883", + "3.9.14": "fa48bd60aee6abf2d41aafb273ebf9fb6b790458", + "3.9.13": "d57e5c8b94fe42e2b403e6eced02b25ed47ca8da", + "3.9.12": "8c2e3a45febf695cbb4d1f02dc1e9d84c5224e52", + "3.9.11": "10af2f3c3b5fb4f7247d43d176ffc8ef448b31c9", + "3.9.10": "936fc25ac4e1b482a0cefa82dd6092a0c6b575e6", + "3.9.9": "6274e5631c520d75bf1f0a046640fd3996fe99f0", + "3.9.8": "8113655a4341a1008fe7388cbdf24aa9c7c6ae20", + "3.9.7": "5208c1d1e0e859f42a9bdbb110efd0855ec4ecf1", + "3.9.6": "05826c93a178872958f6685094ee3514e53ba653", + "3.9.5": "edc80e5e33fc3d3fae53e6b95ae4ca9277809b9b", + "3.9.4": "cfaa95ec3a15994b04c9c7ef1df1319056427e8d", + "3.9.2": "110ca5bca7989f9558a54ee6762e6774a4b9644a", + "3.9.1": "77f4105846f6740297e50d7535a42c02d6b8e7db", + "3.9.0": "ff1fc8c37d5d4b09ec3bf0d84f3e5b97745c6704", + "3.8.20": "88832fd164f0a7d1d0f4677b06960bb5ff15ff1d", + "3.8.19": "eaadca9b5f89767b83c89266049042902681d029", + "3.8.18": "4c5b3bdbfd5e899972d3ee06375fd96fe664dfe3", + "3.8.17": "7bf662823ba44b56bbc1c4f3f802c0cdf3fbbfe5", + "3.8.16": "006869b0011174fc0ce695c454010c21637b09bf", + "3.8.15": "8fe5b42bc09df600d0cec750415b27f7802ae5e4", + "3.8.14": "dced5c6d2a402eb79dddf3346210db23990b1ad0", + "3.8.13": "fb46587353f092d91caeddb07f82bb66a5115468", + "3.8.12": "7643eccc15f5606bd0dc04affc7ea901e417165d", + "3.8.11": "1561060627fd171de19c53eb374cd92d2f297bff", + "3.8.10": "f6579351d42a81c77b55aa4ca8b1280b4f5b37f9", + "3.8.9": "ea40651135adc4126a60a45093d100722610f4de", + "3.8.8": "d7dd8ef51ebe7ddd8ec41e39a607ac26d1834a8f", + "3.8.7": "1b1525811ea4bcf237622e5f1751a4dfc429e3a3", + "3.8.6": "6ee446eaacf901a3305565bd6569e2de135168e3", + "3.8.5": "68d6c7f948801cc755905162f5ee7589595edee4", + "3.8.4": "996c56496f4ddd8f18f388a3bd584b74d2b43928", + "3.8.3": "3bafa40df1cd069c112761c388a9f2e94b5d33dd", + "3.8.2": "5ae54baf26628a7ed74206650a31192e6d5c6f93", + "3.8.1": "a48fd28a037c0bcd7b7fc4d914c023f584e910ed", + "3.8.0": "7720e0384558c598107cf046c48165fd7e1f5b2c", + "3.7.17": "7a08649e47214de75a6ecec91260286fdd94daf5", + "3.7.16": "0cc857e03dbc91971190d170df48e4a64ce8941a", + "3.7.15": "5ed83fdc6d4705090bd39d4b9f5424e37aac780d", + "3.7.14": "86d51dea42675ccfe4a9d8d41e87c33757e91c64", + "3.7.13": "2dfb44e36bfb9d93894fd9051952190441da47db", + "3.7.12": "ea7ed19e3a7cb3867e32c602e25da0b2689a3e31", + "3.7.11": "671e3fed4f3bb5a6663da0ae6691f0f8e9399427", + "3.7.10": "847305e6b25f83b80096314fdfdfa7a8cc07016e", + "3.7.9": "e1de02779a89a94000c0ed340ec126de25825f2f", + "3.7.8": "ecfc1d291ab35bb7cc3a352dd9451450266f5974", + "3.7.7": "7b6f9eec148c583a22a0666fe8eb5ec963ac57c4", + "3.7.6": "93e76be2d874b6ad0abd57c15bab8debc211226a", + "3.7.5": "860f88886809ae8bfc86afa462536811c347a2a1", + "3.7.4": "a862c5a58626fdad02d2047a57771ede2783fcef", + "3.7.3": "e3584650a06ae2765da0678176deae9d133f1b3d", + "3.7.2": "c3dc6928516bcb934cf4740461044c79c7c35494", + "3.7.1": "da290d6d24c68faeba502251cba111a1c8a5a9b2", + "3.7.0": "653cffa5b9f2a28150afe4705600d2e55d89b564", + "3.6.15": "fc7c36957c2cd228cc217bb5df4f580f1fdcd602", + "3.6.14": "980845d74f9ca6a57999ac90c2ddb1fdffb7933a", + "3.6.13": "4fa72f749446e907a5b80c0ae47ab03d890f14c8", + "3.6.12": "e6a28b1ab47f079a659e24a40e4c416f52828682", + "3.6.11": "0840e6b726446fccaef483dad84cce8fdc683077", + "3.6.10": "781072e4726ff0c6dc9370dbfb9dd781d87987dc", + "3.6.9": "3cd8b0e814b753fcce4fdf7edc823d8fb0da9208", + "3.6.8": "ee55acedef049268307633cbc9c7ff0610d1244f", + "3.6.7": "dd2b0a8bf9b9617c57a0070b53065286c2142994", + "3.6.6": "5731cf379838023fc8c55491b4068c4404d0e34f", + "3.6.5": "5a7a833a36f1006257d298787f4c38493c5d1689", + "3.6.4": "36a90695cda9298a0663e667c12909246c358851", + "3.6.3": "6c71b14bdbc4d8aa0cfd59d4b6dc356d46abfdf5", + "3.6.2": "4f92a045de9231b93dfbed50c66bb12cf03ac59a", + "3.6.1": "91d880a2a9fcfc6753cbfa132bf47a47e17e7b16", + "3.6.0": "18ebf7d726782967d967dc00e3aa08b334fbdd5c", + "3.5.10": "25c31d42fb8f8755de9358a53816ce4567b6bca9", + "3.5.9": "4b62a14d8821e5761ef6b76876f45b50b85caa95", + "3.5.8": "10d313aeb7f58e464528aa1b1f0104175841ca4d", + "3.5.7": "743044e357e96ed8e49d709b502f1a9b815be763", + "3.5.6": "05548da58ec75a7af316c4a4cb8fc667ac6ac8f9", + "3.5.5": "66c4cfc0f64b545ee5a7725f26a2fd834cdf1682", + "3.5.4": "4aacbd09ca6988255de84a98ab9e4630f584efba", + "3.5.3": "127121fdca11e735b3686e300d66f73aba663e93", + "3.5.2": "4843aabacec5bc0cdd3e1f778faa926e532794d2", + "3.5.1": "0186da436db76776196612b98bb9c2f76acfe90e", + "3.5.0": "871a06df9ab70984b7398ac53047fe125c757a70", + "3.4.10": "68fe143c56d438343d4142a4953d607124e85ca2", + "3.4.9": "83ea4018f6e5f1db87c4e54c8a48ba6a8350abd4", + "3.4.8": "65d62d3f62ade072a84eb64eca4490b940c73542", + "3.4.7": "7b05bf099f3f311ba568232d0d03d64e67da9908", + "3.4.6": "ef7dbec63d45760701534990511d686e3acbbe4f", + "3.4.5": "882e83e0286b253ee651aa3f9a5d27ebc46e6632", + "3.4.4": "0e4c9265a2ab0004ac51f0010d47c22ef4c1640c", + "3.4.3": "7ca5cd664598bea96eec105aa6453223bb6b4456", + "3.4.2": "0727d8a8498733baabe6f51632b9bab0cbaa9ada", + "3.4.1": "143e098efe7ee7bec8a4904ec4b322f28a067a03", + "3.4.0": "f54d7cf6af5dbd9bddbe31cf4772f39711381dbe", + "3.3.7": "efb00940efd558b9350a79fd9fd70551cdb35b20", + "3.3.6": "0a86ae9e877467a62faed7ece208c0d6899b0991", + "3.3.5": "6683b26dd2cfd23af852abfcf1aedf25bbd44839", + "3.3.4": "2c9586eeb4b6e45e9ebc28372c0856c709d9a522", + "3.3.3": "af4e75a34bd538c79b9871227c2e7f56569ac107", + "3.3.2": "87009d0c156c6e1354dfec5c98c328cae93950ad", + "3.3.1": "393d7302c48bc911cd7faa7fa9b5fbcb9919bddc", + "3.3.0": "833d73565e1b665f1878504081dc985a5a06e46a", + "3.2.6": "3fb8bf10e4df50629efd747adbc324e0084df9bb", + "3.2.5": "616516c707e81f6e498e83b50a2b0f41b9dd3fe1", + "3.2.4": "d5788113afaf9425d5c15f1a4b76f731553ec040", + "3.2.3": "3d607dbcfdf100dd659978195ccf3ade9d221823", + "3.2.2": "5e654dbd48476193ccdef4d604ed4f45b48c6769", + "3.2.1": "ab5cf4a4c21abe590dea87473a1dee6820699d79", + "3.2.0": "55a3a9d39f31563370d0c494373bb6d38e4d1a00", + "3.1.5": "3fa78edeefd892a50b5f41bab018b51ecad0b56f", + "3.1.4": "e5767a4fc92433816451de75c8721f2e1a81f6ea", + "3.1.3": "eadb89fa63194167c6a80d49617d79491b21857b", + "3.1.2": "130186b84e8bafce7f25dccdd6f9ab4929f5f474", + "3.1.1": "499d77bc67f739880663f3aeab67dd973344a3dd", + "3.1.0": "8590b685654367e3eba70dc00df7e45e88c21da4", + "3.0.1": "9cde3918c0449f59e90b2e71f46a734ee84ae81e", + "3.0.0": "c002b8ed67d9df8aaf9a391b3cfcd442dcff3334" +} \ No newline at end of file diff --git a/relenv/pyversions.py b/relenv/pyversions.py index 6546bbd2..15ff9727 100644 --- a/relenv/pyversions.py +++ b/relenv/pyversions.py @@ -110,7 +110,7 @@ def digest(file): """ SHA-256 digest of file. """ - hsh = hashlib.sha256() + hsh = hashlib.sha1() with open(file, "rb") as fp: hsh.update(fp.read()) return hsh.hexdigest() @@ -205,9 +205,9 @@ def _main(): out[str(version)] = {url: digest(path)} if PRINT: - vfile.write_text(json.dumps(pyversions)) + vfile.write_text(json.dumps(pyversions, indent=1)) elif not CHECK and out: - vfile.write_text(json.dumps(out)) + vfile.write_text(json.dumps(out, indent=1)) def create_pyversions(path): @@ -217,9 +217,41 @@ def create_pyversions(path): url = "https://www.python.org/downloads/" content = fetch_url_content(url) matched = re.findall(r'Python.*', content) + cwd = os.getcwd() parsed_versions = sorted([_ref_version(_) for _ in matched], reverse=True) versions = [_ for _ in parsed_versions if _.major >= 3] - path.write_text(json.dumps({"versions": [str(_) for _ in versions]})) + + if path.exists(): + data = json.loads(path.read_text()) + else: + data = {} + + for version in versions: + + if str(version) in data: + continue + + if version <= Version("3.2") and version.micro == 0: + url_version = Version(f"{version.major}.{version.minor}") + else: + url_version = version + if version >= Version("3.1.4"): + url = ARCHIVE.format(version=url_version, ext="tar.xz") + else: + url = ARCHIVE.format(version=url_version, ext="tgz") + download_path = download_url(url, cwd) + sig_path = download_url(f"{url}.asc", cwd) + verified = verify_signature(download_path, sig_path) + if verified: + print(f"Version {version} has digest {digest(download_path)}") + data[str(version)] = digest(download_path) + else: + raise Exception("Signature failed to verify: {url}") + + path.write_text(json.dumps(data, indent=1)) + + # path.write_text(json.dumps({"versions": [str(_) for _ in versions]})) + path.write_text(json.dumps(data, indent=1)) def python_versions(minor=None, create=False, update=False): @@ -241,11 +273,11 @@ def python_versions(minor=None, create=False, update=False): else: raise RuntimeError("No versions file found") pyversions = json.loads(readfrom.read_text()) - versions = [Version(_) for _ in pyversions["versions"]] + versions = [Version(_) for _ in pyversions] if minor: mv = Version(minor) versions = [_ for _ in versions if _.major == mv.major and _.minor == mv.minor] - return versions + return {_: pyversions[str(_)] for _ in versions} def setup_parser(subparsers): @@ -306,7 +338,7 @@ def main(args): if not pyversions: print(f"Unknown minor version {requested}") sys.exit(1) - build_version = pyversions[0] + build_version = list(pyversions.keys())[0] print(build_version) sys.exit() From 81a752d1b33801543f15bddba2b27558685ccf09 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Tue, 7 Oct 2025 02:59:10 -0700 Subject: [PATCH 2/2] Fix fips tests --- .github/workflows/test-fips-action.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/test-fips-action.yml b/.github/workflows/test-fips-action.yml index 07df36b5..7b88ec11 100644 --- a/.github/workflows/test-fips-action.yml +++ b/.github/workflows/test-fips-action.yml @@ -33,11 +33,6 @@ jobs: - uses: actions/checkout@v3 - - name: Set up Python 3.11 - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - name: Determine Python Version id: python-version run: |