From 2e7e8efe1668393ee0d5489ae7f58c7e3d81d9f3 Mon Sep 17 00:00:00 2001 From: messense Date: Wed, 4 Oct 2023 15:42:05 +0800 Subject: [PATCH] CI: Add Python 3.12 test jobs (#1276) * CI: Add Python 3.12 test jobs * Use Python 3.12 release version * Fix typo: compaible -> compatible --------- Co-authored-by: konstin --- .github/workflows/test.yml | 31 ++++++++++++++++++++----------- src/auditwheel/audit.rs | 2 +- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a23159916..f58db17b2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,6 +72,7 @@ jobs: - '3.9' - '3.10' - '3.11' + - '3.12' - 'pypy3.9' - 'pypy3.10' @@ -108,6 +109,13 @@ jobs: with: python-version: ${{ matrix.python-version }} architecture: "x64" + - name: Set PYTHON_VERSION env var + shell: bash + run: | + set -ex + # remove -dev suffix + python_version=$(echo ${{ matrix.python-version }} | sed -e s/-dev//) + echo "PYTHON_VERSION=$python_version" >> "${GITHUB_ENV}" - name: Install cffi if: ${{ !contains(matrix.python-version, 'pypy') }} run: pip install cffi @@ -136,7 +144,7 @@ jobs: # Caching # Install gnu-tar because BSD tar is buggy # https://github.com/actions/cache/issues/403 - - name: Install GNU tar (Macos) + - name: Install GNU tar (macOS) if: startsWith(matrix.os, 'macos') run: | brew install gnu-tar @@ -152,6 +160,7 @@ jobs: - name: cargo test run: cargo nextest run --features password-storage - name: test cross compiling with zig + if: ${{ !contains(matrix.python-version, '-dev') }} shell: bash run: | set -ex @@ -160,13 +169,13 @@ jobs: rustup target add aarch64-apple-darwin # abi3 - cargo run -- build -i ${{ matrix.python-version }} -m test-crates/pyo3-pure/Cargo.toml --target aarch64-unknown-linux-gnu --zig - cargo run -- build -i ${{ matrix.python-version }} -m test-crates/pyo3-pure/Cargo.toml --target aarch64-unknown-linux-musl --zig - if [[ "${{ matrix.python-version }}" != "pypy"* ]]; then - cargo run -- build -i ${{ matrix.python-version }} -m test-crates/pyo3-pure/Cargo.toml --target aarch64-apple-darwin --zig + cargo run -- build -i $PYTHON_VERSION -m test-crates/pyo3-pure/Cargo.toml --target aarch64-unknown-linux-gnu --zig + cargo run -- build -i $PYTHON_VERSION -m test-crates/pyo3-pure/Cargo.toml --target aarch64-unknown-linux-musl --zig + if [[ "$PYTHON_VERSION" != "pypy"* ]]; then + cargo run -- build -i $PYTHON_VERSION -m test-crates/pyo3-pure/Cargo.toml --target aarch64-apple-darwin --zig fi - if [[ "${{ matrix.python-version }}" == "3.1"* ]]; then + if [[ "$PYTHON_VERSION" == "3.1"* ]]; then # Check abi3 wheels with abi3audit on CPython only pip install abi3audit abi3audit test-crates/pyo3-pure/target/wheels/*.whl @@ -175,14 +184,14 @@ jobs: twine check --strict test-crates/pyo3-pure/target/wheels/*.whl # non-abi3 - cargo run -- build -i ${{ matrix.python-version }} -m test-crates/pyo3-mixed/Cargo.toml --target aarch64-unknown-linux-gnu --zig - if [[ "${{ matrix.python-version }}" != "pypy"* ]]; then - cargo run -- build -i ${{ matrix.python-version }} -m test-crates/pyo3-mixed/Cargo.toml --target aarch64-apple-darwin --zig + cargo run -- build -i $PYTHON_VERSION -m test-crates/pyo3-mixed/Cargo.toml --target aarch64-unknown-linux-gnu --zig + if [[ "$PYTHON_VERSION" != "pypy"* ]]; then + cargo run -- build -i $PYTHON_VERSION -m test-crates/pyo3-mixed/Cargo.toml --target aarch64-apple-darwin --zig fi # Check wheels with twine twine check --strict test-crates/pyo3-mixed/target/wheels/*.whl - name: test cross compiling windows wheel - if: ${{ matrix.os == 'ubuntu-latest' && !contains(matrix.python-version, 'pypy') }} + if: ${{ matrix.os == 'ubuntu-latest' && !contains(matrix.python-version, 'pypy') && !contains(matrix.python-version, '-dev') }} run: | set -ex sudo apt-get install -y mingw-w64 @@ -195,7 +204,7 @@ jobs: cargo run -- build -m test-crates/pyo3-pure/Cargo.toml --target x86_64-pc-windows-msvc # no-abi3 - cargo run -- build -i python${{ matrix.python-version }} -m test-crates/pyo3-mixed/Cargo.toml --target x86_64-pc-windows-msvc + cargo run -- build -i "python${PYTHON_VERSION}" -m test-crates/pyo3-mixed/Cargo.toml --target x86_64-pc-windows-msvc - name: test compiling with PYO3_CONFIG_FILE shell: bash run: | diff --git a/src/auditwheel/audit.rs b/src/auditwheel/audit.rs index ed628fb50..6f2c6e8a3 100644 --- a/src/auditwheel/audit.rs +++ b/src/auditwheel/audit.rs @@ -50,7 +50,7 @@ pub enum AuditWheelError { /// libraries with blacked-list symbols. #[error("Your library is not {0} compliant because it depends on black-listed symbols: {1:?}")] BlackListedSymbolsError(Policy, Vec), - /// The elf file isn't manylinux/musllinux compaible. Contains unsupported architecture + /// The elf file isn't manylinux/musllinux compatible. Contains unsupported architecture #[error("Your library is not {0} compliant because it has unsupported architecture: {1}")] UnsupportedArchitecture(Policy, String), /// This platform tag isn't defined by auditwheel yet