Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions .github/actions/windows-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:
description: "Nox session to run (e.g. tests, tests-nocoverage)"
required: true
arch:
description: "actions/setup-python architecture (x86, x64, arm64)"
description: "x64 or arm64, used in the cache key"
required: true
openssl-name:
description: "OpenSSL artifact name suffix (win32, win64, arm64)"
Expand All @@ -21,14 +21,17 @@ runs:
using: "composite"

steps:
# uv picks x86_64 interpreters on Windows arm64 unless asked for aarch64.
- name: Setup python
id: setup-python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
python-version: ${{ inputs.python-version }}
architecture: ${{ inputs.arch }}
cache: pip
cache-dependency-path: ci-constraints-requirements.txt
version-file: ci-constraints-requirements.txt
python-version: ${{ inputs.arch == 'arm64' && format('cpython-{0}-windows-aarch64-none', inputs.python-version) || inputs.python-version }}
activate-environment: true
cache-dependency-glob: ci-constraints-requirements.txt
- id: python-version
run: echo "version=$(python -c 'import platform; print(platform.python_version())')" >> $GITHUB_OUTPUT
shell: bash
# llvm-tools is only used to process Rust coverage data, which the
# tests-nocoverage session doesn't collect.
- run: rustup component add llvm-tools-preview
Expand All @@ -51,8 +54,8 @@ runs:
- name: Cache rust and pip
uses: ./.github/actions/cache
with:
key: ${{ inputs.noxsession }}-${{ inputs.arch }}-${{ steps.setup-python.outputs.python-version }}-${{ steps.openssl.outputs.artifact-id }}
- run: python -m pip install -c ci-constraints-requirements.txt "nox[uv]" "tomli; python_version < '3.11'"
key: ${{ inputs.noxsession }}-${{ inputs.arch }}-${{ steps.python-version.outputs.version }}-${{ steps.openssl.outputs.artifact-id }}
- run: uv pip install -c ci-constraints-requirements.txt "nox[uv]" "tomli; python_version < '3.11'"
shell: bash

- name: Clone test vectors
Expand Down
65 changes: 35 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"}
Comment on lines +278 to +279

Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right: uv has no -dev spelling (3.15-dev is 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.15 gives cpython-3.15.0rc1, 3.15t gives cpython-3.15.0rc1+freethreaded, 3.14t gives 3.14.7+freethreaded. The run on this PR used those.


Generated by Claude Code

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case it helps: in v10.0.1 the python-version output is the input string echoed back (getPythonVersion in src/setup-uv.ts returns inputs.pythonVersion when set), so 3.15t comes out as 3.15t rather than 3.15.0rc1. uv python find --show-version after the venv is created would give the resolved value.


Generated by Claude Code

# Before the cache step: the artifact id is part of its key.
- name: Download OpenSSL
id: openssl
Expand All @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 .
Expand Down