From e8f3f9c0278c51bc6711b62f3c27f332b0091d40 Mon Sep 17 00:00:00 2001 From: Ciaran Ryan-Anderson Date: Wed, 23 Jul 2025 08:59:08 -0600 Subject: [PATCH 1/5] Fixing the artifact generation to use the right Python versions --- .github/workflows/python-release.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-release.yml b/.github/workflows/python-release.yml index a7c753e9d..82d0ce723 100644 --- a/.github/workflows/python-release.yml +++ b/.github/workflows/python-release.yml @@ -2,7 +2,6 @@ name: Python Artifacts env: TRIGGER_ON_PR_PUSH: true # Set to true to enable triggers on PR pushes - PYTHON_VERSION: '3.10' on: push: @@ -135,6 +134,9 @@ jobs: (needs.check_pr_push.result == 'success' && needs.check_pr_push.outputs.run == 'true' || needs.check_pr_push.result == 'skipped') && (github.event_name != 'pull_request' || github.event.pull_request.merged == true || github.event.action == 'opened' || github.event.action == 'synchronize') runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 with: @@ -143,12 +145,12 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: ${{ env.PYTHON_VERSION }} + python-version: ${{ matrix.python-version }} - name: Download pecos-rslib wheel uses: actions/download-artifact@v4 with: - name: wheel-pecos-rslib-ubuntu-latest-x86_64-py${{ env.PYTHON_VERSION }} + name: wheel-pecos-rslib-ubuntu-latest-x86_64-py${{ matrix.python-version }} path: ./pecos-rslib-wheel - name: Install pecos-rslib @@ -178,7 +180,7 @@ jobs: - name: Upload quantum-pecos SDist uses: actions/upload-artifact@v4 with: - name: sdist-quantum-pecos + name: sdist-quantum-pecos-py${{ matrix.python-version }} path: python/quantum-pecos/dist/*.tar.gz build_wheels_quantum_pecos: From b15110321a409aa3f0dd7365d50d55a02fb38b38 Mon Sep 17 00:00:00 2001 From: Ciaran Ryan-Anderson Date: Wed, 23 Jul 2025 15:06:58 -0600 Subject: [PATCH 2/5] Building one abi wheel per OS/arch for pecos-rslib and testing the installation/import per supported Python versions --- .github/workflows/python-release.yml | 75 ++++++++++++++++++++-------- 1 file changed, 54 insertions(+), 21 deletions(-) diff --git a/.github/workflows/python-release.yml b/.github/workflows/python-release.yml index 82d0ce723..f6da66dc4 100644 --- a/.github/workflows/python-release.yml +++ b/.github/workflows/python-release.yml @@ -62,7 +62,6 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.10', '3.11', '3.12', '3.13'] architecture: [ x86_64, aarch64 ] exclude: - os: windows-latest @@ -76,7 +75,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: '3.10' - name: Remove conflicting README.md run: | @@ -91,7 +90,7 @@ jobs: uses: PyO3/maturin-action@v1 with: command: build - args: --release --out dist --interpreter python${{ matrix.python-version }} + args: --release --out dist --interpreter python3.10 working-directory: python/pecos-rslib target: ${{ matrix.architecture == 'aarch64' && (matrix.os == 'macos-latest' && 'aarch64-apple-darwin' || 'aarch64-unknown-linux-gnu') || (matrix.os == 'macos-latest' && 'x86_64-apple-darwin' || '') }} manylinux: auto @@ -115,18 +114,59 @@ jobs: echo "No README.md backup found" fi - - name: Test wheel - if: ${{ !(matrix.architecture == 'x86_64' && matrix.os == 'macos-latest') && matrix.architecture != 'aarch64' }} + - name: Test wheel is abi3 + if: matrix.architecture != 'aarch64' run: | - pip install --force-reinstall --verbose python/pecos-rslib/dist/*.whl - python -c 'import pecos_rslib; print(pecos_rslib.__version__)' + # Check that the wheel has abi3 tag + ls -la python/pecos-rslib/dist/ + wheel_file=$(ls python/pecos-rslib/dist/*.whl) + echo "Built wheel: $wheel_file" + if [[ $wheel_file == *"abi3"* ]]; then + echo "Wheel has abi3 tag" + else + echo "ERROR: Wheel does not have abi3 tag!" + exit 1 + fi - name: Upload wheel uses: actions/upload-artifact@v4 with: - name: wheel-pecos-rslib-${{ matrix.os }}-${{ matrix.architecture }}-py${{ matrix.python-version }} + name: wheel-pecos-rslib-${{ matrix.os }}-${{ matrix.architecture }} path: python/pecos-rslib/dist/*.whl + test_abi3_wheels: + needs: build_wheels_pecos_rslib + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ['3.10', '3.11', '3.12', '3.13'] + architecture: [x86_64] + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.sha || github.sha }} + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Download abi3 wheel + uses: actions/download-artifact@v4 + with: + name: wheel-pecos-rslib-${{ matrix.os }}-${{ matrix.architecture }} + path: ./pecos-rslib-wheel + + - name: Test abi3 wheel with Python ${{ matrix.python-version }} + run: | + echo "Testing abi3 wheel with Python ${{ matrix.python-version }}" + python --version + pip install --force-reinstall --verbose ./pecos-rslib-wheel/*.whl + python -c 'import pecos_rslib; print(f"pecos_rslib version: {pecos_rslib.__version__}")' + python -c 'import sys; print(f"Python version: {sys.version}")' + build_sdist_quantum_pecos: needs: [check_pr_push, build_wheels_pecos_rslib] if: | @@ -134,9 +174,6 @@ jobs: (needs.check_pr_push.result == 'success' && needs.check_pr_push.outputs.run == 'true' || needs.check_pr_push.result == 'skipped') && (github.event_name != 'pull_request' || github.event.pull_request.merged == true || github.event.action == 'opened' || github.event.action == 'synchronize') runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 with: @@ -145,12 +182,12 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: '3.10' - name: Download pecos-rslib wheel uses: actions/download-artifact@v4 with: - name: wheel-pecos-rslib-ubuntu-latest-x86_64-py${{ matrix.python-version }} + name: wheel-pecos-rslib-ubuntu-latest-x86_64 path: ./pecos-rslib-wheel - name: Install pecos-rslib @@ -180,7 +217,7 @@ jobs: - name: Upload quantum-pecos SDist uses: actions/upload-artifact@v4 with: - name: sdist-quantum-pecos-py${{ matrix.python-version }} + name: sdist-quantum-pecos path: python/quantum-pecos/dist/*.tar.gz build_wheels_quantum_pecos: @@ -190,24 +227,21 @@ jobs: (needs.check_pr_push.result == 'success' && needs.check_pr_push.outputs.run == 'true' || needs.check_pr_push.result == 'skipped') && (github.event_name != 'pull_request' || github.event.pull_request.merged == true || github.event.action == 'opened' || github.event.action == 'synchronize') runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 with: ref: ${{ inputs.sha || github.sha }} - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: '3.10' - name: Download pecos-rslib wheel uses: actions/download-artifact@v4 with: - name: wheel-pecos-rslib-ubuntu-latest-x86_64-py${{ matrix.python-version }} + name: wheel-pecos-rslib-ubuntu-latest-x86_64 path: ./pecos-rslib-wheel - name: Install pecos-rslib @@ -236,7 +270,6 @@ jobs: - name: Upload quantum-pecos wheel uses: actions/upload-artifact@v4 - if: matrix.python-version == '3.10' with: name: wheel-quantum-pecos path: python/quantum-pecos/dist/*.whl From 68f4654312acb43cf421b6adf370cbac15b711b4 Mon Sep 17 00:00:00 2001 From: Ciaran Ryan-Anderson Date: Wed, 23 Jul 2025 15:38:50 -0600 Subject: [PATCH 3/5] fix mac issue of wrong arch? --- .github/workflows/python-release.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-release.yml b/.github/workflows/python-release.yml index f6da66dc4..5638a9ebc 100644 --- a/.github/workflows/python-release.yml +++ b/.github/workflows/python-release.yml @@ -136,13 +136,28 @@ jobs: test_abi3_wheels: needs: build_wheels_pecos_rslib - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.runner }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] python-version: ['3.10', '3.11', '3.12', '3.13'] - architecture: [x86_64] + include: + # Linux x86_64 + - runner: ubuntu-latest + os: ubuntu-latest + architecture: x86_64 + # Windows x86_64 + - runner: windows-latest + os: windows-latest + architecture: x86_64 + # macOS x86_64 (Intel) + - runner: macos-13 + os: macos-latest + architecture: x86_64 + # macOS aarch64 (Apple Silicon) + - runner: macos-latest + os: macos-latest + architecture: aarch64 steps: - uses: actions/checkout@v4 with: From a8b0824712be73482ccc466a109945aa2261a67f Mon Sep 17 00:00:00 2001 From: Ciaran Ryan-Anderson Date: Wed, 23 Jul 2025 15:49:05 -0600 Subject: [PATCH 4/5] lint... --- .github/workflows/python-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-release.yml b/.github/workflows/python-release.yml index 5638a9ebc..a2a4da208 100644 --- a/.github/workflows/python-release.yml +++ b/.github/workflows/python-release.yml @@ -146,7 +146,7 @@ jobs: - runner: ubuntu-latest os: ubuntu-latest architecture: x86_64 - # Windows x86_64 + # Windows x86_64 - runner: windows-latest os: windows-latest architecture: x86_64 From 400f0ce35d5b4ec145a99ffc26035f442c247394 Mon Sep 17 00:00:00 2001 From: Ciaran Ryan-Anderson Date: Wed, 23 Jul 2025 16:13:19 -0600 Subject: [PATCH 5/5] tweak --- .github/workflows/python-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/python-release.yml b/.github/workflows/python-release.yml index a2a4da208..1692e31e8 100644 --- a/.github/workflows/python-release.yml +++ b/.github/workflows/python-release.yml @@ -115,7 +115,6 @@ jobs: fi - name: Test wheel is abi3 - if: matrix.architecture != 'aarch64' run: | # Check that the wheel has abi3 tag ls -la python/pecos-rslib/dist/