-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Use uv-managed Python for the CI jobs #15572
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
base: main
Are you sure you want to change the base?
Changes from all commits
ca7f774
e268b89
e876df4
4ae4441
c4c8e9f
6932c44
ede2731
3c096ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,9 +34,9 @@ jobs: | |
| - {VERSION: "3.14", NOXSESSION: "rust"} | ||
| - {VERSION: "3.12", NOXSESSION: "docs", OPENSSL: {TYPE: "openssl", VERSION: "4.0.1"}} | ||
| - {VERSION: "3.14t", NOXSESSION: "rust,tests"} | ||
| - {VERSION: "3.15-dev", NOXSESSION: "rust,tests"} | ||
| - {VERSION: "3.15t-dev", NOXSESSION: "rust,tests"} | ||
| - {VERSION: "pypy-3.11", NOXSESSION: "tests-nocoverage"} | ||
| - {VERSION: "3.15", NOXSESSION: "rust,tests"} | ||
| - {VERSION: "3.15t", NOXSESSION: "rust,tests"} | ||
| - {VERSION: "pypy3.11", NOXSESSION: "tests-nocoverage"} | ||
| - {VERSION: "3.14", NOXSESSION: "tests", OPENSSL: {TYPE: "openssl", VERSION: "4.0.2", CONFIG_FLAGS: "no-engine no-rc2 no-srtp no-ct no-psk"}} | ||
| - {VERSION: "3.14", NOXSESSION: "tests", OPENSSL: {TYPE: "openssl", VERSION: "4.0.2", CONFIG_FLAGS: "no-legacy", NO_LEGACY: "0"}} | ||
| - {VERSION: "3.14", NOXSESSION: "tests", OPENSSL: {TYPE: "openssl", VERSION: "4.0.2", CONFIG_FLAGS: "no-legacy", NO_LEGACY: "1"}} | ||
|
|
@@ -74,13 +74,17 @@ jobs: | |
| with: | ||
| persist-credentials: false | ||
| - name: Setup python | ||
| id: setup-python | ||
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | ||
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | ||
| with: | ||
| version-file: ci-constraints-requirements.txt | ||
| python-version: ${{ matrix.PYTHON.VERSION }} | ||
| cache: pip | ||
| cache-dependency-path: ci-constraints-requirements.txt | ||
| activate-environment: true | ||
| cache-dependency-glob: ci-constraints-requirements.txt | ||
| timeout-minutes: 3 | ||
| - id: python-version | ||
| run: echo "version=$(python -c 'import platform; print(platform.python_version())')" >> $GITHUB_OUTPUT | ||
| # The rust session's test binaries link libpython. | ||
| - run: echo "LD_LIBRARY_PATH=$(python -c 'import sysconfig; print(sysconfig.get_config_var("LIBDIR"))')" >> $GITHUB_ENV | ||
| - name: Setup rust | ||
| uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 | ||
| with: | ||
|
|
@@ -109,22 +113,22 @@ jobs: | |
| timeout-minutes: 2 | ||
| with: | ||
| # We have both the Python version from the matrix and from the | ||
| # setup-python step because the latter doesn't distinguish | ||
| # different Python versions of PyPy that share the same PyPy | ||
| # version number. | ||
| # interpreter because the latter doesn't distinguish different | ||
| # Python versions of PyPy that share the same PyPy version | ||
| # number. | ||
| # | ||
| # openssl-sys reruns its build script when the include directory | ||
| # is newer than the cached fingerprint, so the key names the | ||
| # specific OpenSSL build, not just its configuration. | ||
| key: "${{ matrix.PYTHON.VERSION }}-${{ steps.setup-python.outputs.python-version }}-${{ matrix.PYTHON.NOXSESSION }}-${{ steps.openssl.outputs.cache-key }}-0" | ||
| key: "${{ matrix.PYTHON.VERSION }}-${{ steps.python-version.outputs.version }}-${{ matrix.PYTHON.NOXSESSION }}-${{ steps.openssl.outputs.cache-key }}-0" | ||
| # This must run after the cache action: rust-cache prunes binaries | ||
| # that already existed in ~/.cargo/bin before it ran, so installing | ||
| # bindgen first means it never gets cached. When the cache is warm, | ||
| # cargo sees the binary is already installed and skips the build. | ||
| - run: rustup run stable cargo install bindgen-cli | ||
| if: matrix.PYTHON.OPENSSL.TYPE == 'boringssl' || matrix.PYTHON.OPENSSL.TYPE == 'aws-lc' | ||
|
|
||
| - run: python -m pip install -c ci-constraints-requirements.txt 'nox[uv]' 'tomli; python_version < "3.11"' | ||
| - run: uv pip install -c ci-constraints-requirements.txt 'nox[uv]' 'tomli; python_version < "3.11"' | ||
| - name: Create nox environment | ||
| run: | | ||
| nox -v --install-only | ||
|
|
@@ -271,22 +275,24 @@ jobs: | |
| - {VERSION: "3.9", NOXSESSION: "tests"} | ||
| - {VERSION: "3.14", NOXSESSION: "tests"} | ||
| - {VERSION: "3.14t", NOXSESSION: "tests"} | ||
| - {VERSION: "3.15-dev", NOXSESSION: "tests"} | ||
| - {VERSION: "3.15t-dev", NOXSESSION: "tests"} | ||
| - {VERSION: "3.15", NOXSESSION: "tests"} | ||
| - {VERSION: "3.15t", NOXSESSION: "tests"} | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| timeout-minutes: 3 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Setup python | ||
| id: setup-python | ||
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | ||
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | ||
| with: | ||
| version-file: ci-constraints-requirements.txt | ||
| python-version: ${{ matrix.PYTHON.VERSION }} | ||
| cache: pip | ||
| cache-dependency-path: ci-constraints-requirements.txt | ||
| activate-environment: true | ||
| cache-dependency-glob: ci-constraints-requirements.txt | ||
| timeout-minutes: 3 | ||
| - id: python-version | ||
| run: echo "version=$(python -c 'import platform; print(platform.python_version())')" >> $GITHUB_OUTPUT | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @woodruffw can you give us this as an output :-) Surely setup-uv already has this value internally
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I can look into this. I thought we did have this as a version output.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In case it helps: in v10.0.1 the Generated by Claude Code |
||
| # Before the cache step: the artifact id is part of its key. | ||
| - name: Download OpenSSL | ||
| id: openssl | ||
|
|
@@ -296,8 +302,8 @@ jobs: | |
| name: openssl-macos-arm64 | ||
| path: "../openssl-macos-arm64/" | ||
| # Keyed on the resolved interpreter version (like the linux and | ||
| # windows jobs), not just the matrix name: the alpha that a -dev | ||
| # entry resolves to moves over time, and a cached maturin/pyo3 | ||
| # windows jobs), not just the matrix name: the alpha that an | ||
| # unreleased minor resolves to moves over time, and a cached maturin/pyo3 | ||
| # config built by an older alpha gets rewritten by maturin on every | ||
| # run, which re-dirties pyo3-ffi and recompiles it, pyo3, and every | ||
| # crate above them despite a warm cache. | ||
|
|
@@ -309,10 +315,10 @@ jobs: | |
| uses: ./.github/actions/cache | ||
| timeout-minutes: 2 | ||
| with: | ||
| key: ${{ matrix.PYTHON.NOXSESSION }}-${{ matrix.PYTHON.VERSION }}-${{ steps.setup-python.outputs.python-version }}-${{ steps.openssl.outputs.artifact-id }} | ||
| key: ${{ matrix.PYTHON.NOXSESSION }}-${{ matrix.PYTHON.VERSION }}-${{ steps.python-version.outputs.version }}-${{ steps.openssl.outputs.artifact-id }} | ||
| - run: rustup component add llvm-tools-preview | ||
|
|
||
| - run: python -m pip install -c ci-constraints-requirements.txt 'nox[uv]' 'tomli; python_version < "3.11"' | ||
| - run: uv pip install -c ci-constraints-requirements.txt 'nox[uv]' 'tomli; python_version < "3.11"' | ||
|
|
||
| - name: Clone test vectors | ||
| timeout-minutes: 2 | ||
|
|
@@ -346,13 +352,13 @@ jobs: | |
| - {VERSION: "3.9", NOXSESSION: "tests-nocoverage"} | ||
| - {VERSION: "3.14", NOXSESSION: "tests"} | ||
| - {VERSION: "3.14t", NOXSESSION: "tests"} | ||
| - {VERSION: "3.15-dev", NOXSESSION: "tests"} | ||
| - {VERSION: "3.15t-dev", NOXSESSION: "tests"} | ||
| - {VERSION: "3.15", NOXSESSION: "tests"} | ||
| - {VERSION: "3.15t", NOXSESSION: "tests"} | ||
| include: | ||
| - WINDOWS: {ARCH: 'arm64', WINDOWS: 'arm64', RUNNER: 'windows-11-arm'} | ||
| PYTHON: {VERSION: "3.14", NOXSESSION: "tests-nocoverage"} | ||
| - WINDOWS: {ARCH: 'arm64', WINDOWS: 'arm64', RUNNER: 'windows-11-arm'} | ||
| PYTHON: {VERSION: "3.15-dev", NOXSESSION: "tests-nocoverage"} | ||
| PYTHON: {VERSION: "3.15", NOXSESSION: "tests-nocoverage"} | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
|
|
@@ -443,14 +449,13 @@ jobs: | |
| uses: ./.github/actions/cache | ||
| timeout-minutes: 2 | ||
| - name: Setup python | ||
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | ||
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | ||
| with: | ||
| python-version: '3.14' | ||
| cache: pip | ||
| cache-dependency-path: ci-constraints-requirements.txt | ||
| version-file: ci-constraints-requirements.txt | ||
| python-version: "3.14" | ||
| cache-dependency-glob: ci-constraints-requirements.txt | ||
| timeout-minutes: 3 | ||
|
|
||
| - run: python -m pip install -c ci-constraints-requirements.txt 'uv' | ||
| - run: uv venv | ||
| - run: source .venv/bin/activate && ./.github/downstream.d/${{ matrix.DOWNSTREAM }}.sh install | ||
| - run: uv pip install -v . | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-dev isn't required for pre-releases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right: uv has no
-devspelling (3.15-devis rejected as an executable name), and a bare minor resolves to the latest prerelease when no stable release exists. Checked with the pinned uv 0.12.8:uv python install 3.15givescpython-3.15.0rc1,3.15tgivescpython-3.15.0rc1+freethreaded,3.14tgives3.14.7+freethreaded. The run on this PR used those.Generated by Claude Code