Skip to content
Merged
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
87 changes: 77 additions & 10 deletions .github/workflows/python-native-qualification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ jobs:
python-version: ${{ matrix.python }}
- name: Check candidate package metadata
run: |
python -c "import tomllib; from pathlib import Path; project=tomllib.loads(Path('bindings/python/pyproject.toml').read_text())['project']; binding=tomllib.loads(Path('bindings/python/Cargo.toml').read_text())['package']; root=tomllib.loads(Path('Cargo.toml').read_text())['package']; assert project['name'] == 'eggsearch'; assert project['license'] == 'MIT'; assert project['version'] == binding['version'] == root['version']; print(project['name'], project['version'], project['license'])"
python -c "import tomllib; from pathlib import Path; project=tomllib.loads(Path('bindings/python/pyproject.toml').read_text())['project']; binding=tomllib.loads(Path('bindings/python/Cargo.toml').read_text())['package']; root=tomllib.loads(Path('Cargo.toml').read_text())['package']; assert project['name'] == 'eggsearch'; assert project['license'] == 'MIT'; assert project['version'] == binding['version'] == root['version']; assert project['requires-python'] == '>=3.11,<3.16'; assert all(f'Programming Language :: Python :: 3.{minor}' in project['classifiers'] for minor in range(11,16)); assert 'abi3-py311' in Path('bindings/python/Cargo.toml').read_text(); print(project['name'], project['version'], project['requires-python'], project['license'])"
- if: matrix.linux
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b
with:
maturin-version: v1.9.5
maturin-version: v1.15.0
rust-toolchain: 1.89.0
manylinux: "2014"
args: --manifest-path bindings/python/Cargo.toml --release --locked --out dist -i python${{ matrix.python }}
Expand All @@ -59,14 +59,15 @@ jobs:
toolchain: 1.89.0
targets: ${{ matrix.target }}
- if: ${{ !matrix.linux }}
run: python -m pip install maturin==1.9.5
run: python -m pip install maturin==1.15.0
- if: ${{ !matrix.linux }}
run: maturin build --manifest-path bindings/python/Cargo.toml --release --locked --out dist --interpreter python
- name: Record wheel metadata and digest
shell: bash
run: |
python -m pip install packaging==26.0
python -m pip install --no-index --no-deps --only-binary=:all: dist/*.whl
python -c "from importlib.metadata import distribution; d=distribution('eggsearch'); print(d.metadata['Name'], d.version); print(*d.files, sep='\\n')" > dist/metadata.txt
python -c "from importlib.metadata import distribution; from packaging.utils import parse_wheel_filename; from pathlib import Path; d=distribution('eggsearch'); wheels=list(Path('dist').glob('*.whl')); assert len(wheels) == 1; name, version, build, tags=parse_wheel_filename(wheels[0].name); assert name == 'eggsearch' and str(version) == d.version; assert all(tag.abi == 'abi3' and tag.interpreter == 'cp311' for tag in tags); print(d.metadata['Name'], d.version, d.metadata['Requires-Python']); print(*d.files, sep='\\n')" > dist/metadata.txt
sha256sum dist/*.whl | tee dist/SHA256SUMS
cat dist/SHA256SUMS >> "$GITHUB_STEP_SUMMARY"
- id: upload
Expand All @@ -93,22 +94,27 @@ jobs:
- { id: linux-x86_64, runner: ubuntu-24.04, target: x86_64-unknown-linux-gnu, python: "3.12" }
- { id: linux-x86_64, runner: ubuntu-24.04, target: x86_64-unknown-linux-gnu, python: "3.13" }
- { id: linux-x86_64, runner: ubuntu-24.04, target: x86_64-unknown-linux-gnu, python: "3.14" }
- { id: linux-x86_64, runner: ubuntu-24.04, target: x86_64-unknown-linux-gnu, python: "3.15" }
- { id: linux-aarch64, runner: ubuntu-24.04-arm, target: aarch64-unknown-linux-gnu, python: "3.11" }
- { id: linux-aarch64, runner: ubuntu-24.04-arm, target: aarch64-unknown-linux-gnu, python: "3.12" }
- { id: linux-aarch64, runner: ubuntu-24.04-arm, target: aarch64-unknown-linux-gnu, python: "3.13" }
- { id: linux-aarch64, runner: ubuntu-24.04-arm, target: aarch64-unknown-linux-gnu, python: "3.14" }
- { id: linux-aarch64, runner: ubuntu-24.04-arm, target: aarch64-unknown-linux-gnu, python: "3.15" }
- { id: macos-x86_64, runner: macos-15-intel, target: x86_64-apple-darwin, python: "3.11" }
- { id: macos-x86_64, runner: macos-15-intel, target: x86_64-apple-darwin, python: "3.12" }
- { id: macos-x86_64, runner: macos-15-intel, target: x86_64-apple-darwin, python: "3.13" }
- { id: macos-x86_64, runner: macos-15-intel, target: x86_64-apple-darwin, python: "3.14" }
- { id: macos-x86_64, runner: macos-15-intel, target: x86_64-apple-darwin, python: "3.15" }
- { id: macos-arm64, runner: macos-15, target: aarch64-apple-darwin, python: "3.11" }
- { id: macos-arm64, runner: macos-15, target: aarch64-apple-darwin, python: "3.12" }
- { id: macos-arm64, runner: macos-15, target: aarch64-apple-darwin, python: "3.13" }
- { id: macos-arm64, runner: macos-15, target: aarch64-apple-darwin, python: "3.14" }
- { id: macos-arm64, runner: macos-15, target: aarch64-apple-darwin, python: "3.15" }
- { id: windows-x86_64, runner: windows-2022, target: x86_64-pc-windows-msvc, python: "3.11" }
- { id: windows-x86_64, runner: windows-2022, target: x86_64-pc-windows-msvc, python: "3.12" }
- { id: windows-x86_64, runner: windows-2022, target: x86_64-pc-windows-msvc, python: "3.13" }
- { id: windows-x86_64, runner: windows-2022, target: x86_64-pc-windows-msvc, python: "3.14" }
- { id: windows-x86_64, runner: windows-2022, target: x86_64-pc-windows-msvc, python: "3.15" }
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
Expand All @@ -134,6 +140,67 @@ jobs:
shell: bash
working-directory: ${{ runner.temp }}

armv7-build:
name: Build ARMv7 hard-float wheel
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b
with:
maturin-version: v1.15.0
rust-toolchain: 1.89.0
target: armv7-unknown-linux-gnueabihf
manylinux: "2_28"
container: ghcr.io/rust-cross/manylinux_2_28-cross@sha256:b1f069c62f7744faa6db5f1ab28b11d59f72e161d8f03f6b0a388fe1cecc065d
args: --manifest-path bindings/python/Cargo.toml --release --locked --out dist -i python3.11 --compatibility pypi
- name: Verify ARMv7 wheel metadata
run: |
python -m pip install packaging==26.0
python bindings/python/scripts/audit_armv7_wheel.py dist/*.whl | tee dist/armv7-audit.txt
sha256sum dist/*.whl | tee dist/SHA256SUMS
cat dist/armv7-audit.txt >> "$GITHUB_STEP_SUMMARY"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: wheel-linux-armv7l
path: dist/
if-no-files-found: error
retention-days: 14

armv7-wheel-smoke:
name: Emulated ARMv7 installed-wheel smoke
needs: armv7-build
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a
with:
platforms: arm
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: wheel-linux-armv7l
path: ${{ runner.temp }}/wheelhouse
- name: Install and test only the prebuilt wheel in matching ARMv7 Linux
shell: bash
run: |
docker run --rm --platform linux/arm/v7 \
-v "$RUNNER_TEMP/wheelhouse:/wheelhouse:ro" \
-v "$GITHUB_WORKSPACE:/source:ro" \
quay.io/pypa/manylinux_2_31_armv7l@sha256:ff4a72812594311c071eebce43efcaa9061bd1205649d864c1054d4e56e6bdae \
/bin/bash -euxo pipefail -c '
for tag in cp311 cp315; do
python_bin="/opt/python/$tag-$tag/bin/python"
test -x "$python_bin"
venv="/tmp/eggsearch-$tag-venv"
"$python_bin" -m venv "$venv"
"$venv/bin/python" -m pip install --no-index --no-deps --only-binary=:all: /wheelhouse/*.whl
"$venv/bin/python" -m pip install pytest==8.4.2
cd /tmp
"$venv/bin/python" -m pytest -q /source/bindings/python/tests
"$venv/bin/python" /source/bindings/python/scripts/smoke_installed_wheel.py
"$venv/bin/python" -c "import platform,sys; from importlib.metadata import distribution; import eggsearch; assert platform.machine() in (\"armv7l\", \"armv8l\"); assert sys.version_info[:2] == (3, int(\"$tag\"[3:])); assert len(eggsearch.tool_names()) == 10; print(platform.machine(), sys.version, distribution(\"eggsearch\").version)"
done
'

source-distribution:
name: Rebuild and smoke extracted sdist
runs-on: ubuntu-24.04
Expand All @@ -144,8 +211,8 @@ jobs:
toolchain: 1.89.0
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: "3.14"
- run: python -m pip install maturin==1.9.5
python-version: "3.15"
- run: python -m pip install maturin==1.15.0
- name: Build sdist, prefetch locked crates, and rebuild offline
shell: bash
run: |
Expand All @@ -161,16 +228,15 @@ jobs:
"$RUNNER_TEMP/runtime-venv/bin/python" -m pip install pytest==8.4.2
cd "$RUNNER_TEMP"
"$RUNNER_TEMP/runtime-venv/bin/python" -m pytest -q "$source_dir/bindings/python/tests"
"$RUNNER_TEMP/runtime-venv/bin/python" -c "import eggsearch; from importlib.metadata import distribution; assert len(eggsearch.tool_names()) == 10; assert distribution('eggsearch').version == '0.4.4'"
"$RUNNER_TEMP/runtime-venv/bin/python" -c "import tomllib; from pathlib import Path; import eggsearch; from importlib.metadata import distribution; expected=tomllib.loads(Path('$GITHUB_WORKSPACE/bindings/python/pyproject.toml').read_text())['project']['version']; assert len(eggsearch.tool_names()) == 10; assert distribution('eggsearch').version == expected"
sha256sum "$GITHUB_WORKSPACE"/dist/* "$GITHUB_WORKSPACE"/extracted-wheel/* | tee "$GITHUB_WORKSPACE/dist/SHA256SUMS"
cat "$GITHUB_WORKSPACE/dist/SHA256SUMS" >> "$GITHUB_STEP_SUMMARY"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: python-sdist-and-extracted-wheel
name: python-sdist-qualification
path: |
dist/*.tar.gz
dist/SHA256SUMS
extracted-wheel/*.whl
if-no-files-found: error
retention-days: 14

Expand All @@ -183,11 +249,12 @@ jobs:
with:
toolchain: 1.89.0
- run: cargo install cargo-deny --version 0.20.2 --locked
- run: cargo deny check
- run: cargo deny check
working-directory: bindings/python
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: "3.14"
- run: python -m pip install --upgrade pip==26.2.1
- run: python -m pip install pip-audit==2.10.1 maturin==1.9.5
- run: python -m pip install pip-audit==2.10.1 maturin==1.15.0
- run: pip-audit --local --progress-spinner off
Loading
Loading