Skip to content

Commit

Permalink
DNM: Test cibuildwheel works with abi3
Browse files Browse the repository at this point in the history
  • Loading branch information
mtreinish committed Jun 2, 2023
1 parent 5d1a856 commit 8ca24cf
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 91 deletions.
7 changes: 0 additions & 7 deletions .azure/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,8 @@ jobs:
set -e
python -m pip install --upgrade pip
python -m pip install cibuildwheel==2.11.2
python -m pip install -U twine
cibuildwheel --output-dir wheelhouse .
- task: PublishBuildArtifacts@1
inputs: {pathtoPublish: 'wheelhouse'}
condition: succeededOrFailed()

- bash: |
twine upload wheelhouse/*
env:
TWINE_USERNAME: "qiskit"
TWINE_PASSWORD: $(TWINE_PASSWORD)
26 changes: 2 additions & 24 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
name: Wheel Builds
on:
push:
tags:
- '*'
pull_request:
branches: ['main']
jobs:
build_wheels_s390x:
name: Build wheels on s390x
Expand Down Expand Up @@ -31,13 +30,6 @@ jobs:
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
- name: Install twine
run: python -m pip install twine
- name: Upload to PyPI
run: twine upload ./wheelhouse/*.whl
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_USERNAME: qiskit
build_wheels_ppc64le:
name: Build wheels on ppc64le
runs-on: ${{ matrix.os }}
Expand All @@ -64,13 +56,6 @@ jobs:
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
- name: Install twine
run: python -m pip install twine
- name: Upload to PyPI
run: twine upload ./wheelhouse/*.whl
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_USERNAME: qiskit
build_wheels_aarch64:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand All @@ -96,10 +81,3 @@ jobs:
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
- name: Install twine
run: python -m pip install twine
- name: Upload to PyPI
run: twine upload ./wheelhouse/*.whl
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_USERNAME: qiskit
113 changes: 53 additions & 60 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,59 @@ stages:
repositoryName: ${{ variables['Build.Repository.Name'] }}
id: 7864
comment: Nightly test job failed at commit $(Build.SourceVersion). View the logs at $(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId).
# Push to a tag. The triggering tags are set in the triggers at the top of
# this file.
- ${{ if or(eq(variables['Build.Reason'], 'PullRequest'), contains(variables['Build.SourceBranch'], 'gh-readonly-queue')) }}:
- stage: "Deploy"
jobs:
- template: ".azure/wheels.yml"
parameters:
jobName: "linux"
pool: {vmImage: 'ubuntu-latest'}

- template: ".azure/wheels.yml"
parameters:
jobName: "macos"
pool: {vmImage: 'macOS-11'}

- template: ".azure/wheels.yml"
parameters:
jobName: "macos_arm"
pool: {vmImage: 'macOS-11'}
env:
CIBW_BEFORE_ALL: rustup target add aarch64-apple-darwin
CIBW_ARCHS_MACOS: arm64 universal2
CIBW_ENVIRONMENT: >-
CARGO_BUILD_TARGET="aarch64-apple-darwin"
PYO3_CROSS_LIB_DIR="/Library/Frameworks/Python.framework/Versions/$(python -c 'import sys; print(str(sys.version_info[0])+"."+str(sys.version_info[1]))')/lib/python$(python -c 'import sys; print(str(sys.version_info[0])+"."+str(sys.version_info[1]))')"
- template: ".azure/wheels.yml"
parameters:
jobName: "windows"
pool: {vmImage: 'windows-latest'}
setupPython:
- ${{ each version in parameters.supportedPythonVersions }}:
- task: UsePythonVersion@0
inputs:
versionSpec: ${{ version }}
architecture: x86
- task: UsePythonVersion@0
inputs:
versionSpec: ${{ version }}
architecture: x64

- job: 'sdist'
pool: {vmImage: 'ubuntu-latest'}
steps:
- task: UsePythonVersion@0
- bash: |
set -e
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools_rust
python setup.py sdist
- task: PublishBuildArtifacts@1
inputs: {pathtoPublish: 'dist'}
condition: succeededOrFailed()

# Full PR suite. This also needs to apply to the merge queue, which appears
# as a push event. The queue won't get cron triggered because the schedule
Expand Down Expand Up @@ -202,63 +255,3 @@ stages:
testRust: true
testQPY: true
testImages: true

# Push to a tag. The triggering tags are set in the triggers at the top of
# this file.
- ${{ if and(eq(variables['Build.Reason'], 'IndividualCI'), startsWith(variables['Build.SourceBranch'], 'refs/tags/')) }}:
- stage: "Deploy"
jobs:
- template: ".azure/wheels.yml"
parameters:
jobName: "linux"
pool: {vmImage: 'ubuntu-latest'}

- template: ".azure/wheels.yml"
parameters:
jobName: "macos"
pool: {vmImage: 'macOS-11'}

- template: ".azure/wheels.yml"
parameters:
jobName: "macos_arm"
pool: {vmImage: 'macOS-11'}
env:
CIBW_BEFORE_ALL: rustup target add aarch64-apple-darwin
CIBW_ARCHS_MACOS: arm64 universal2
CIBW_ENVIRONMENT: >-
CARGO_BUILD_TARGET="aarch64-apple-darwin"
PYO3_CROSS_LIB_DIR="/Library/Frameworks/Python.framework/Versions/$(python -c 'import sys; print(str(sys.version_info[0])+"."+str(sys.version_info[1]))')/lib/python$(python -c 'import sys; print(str(sys.version_info[0])+"."+str(sys.version_info[1]))')"
- template: ".azure/wheels.yml"
parameters:
jobName: "windows"
pool: {vmImage: 'windows-latest'}
setupPython:
- ${{ each version in parameters.supportedPythonVersions }}:
- task: UsePythonVersion@0
inputs:
versionSpec: ${{ version }}
architecture: x86
- task: UsePythonVersion@0
inputs:
versionSpec: ${{ version }}
architecture: x64

- job: 'sdist'
pool: {vmImage: 'ubuntu-latest'}
steps:
- task: UsePythonVersion@0
- bash: |
set -e
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools_rust
python setup.py sdist
- task: PublishBuildArtifacts@1
inputs: {pathtoPublish: 'dist'}
condition: succeededOrFailed()
- bash: |
python -m pip install --upgrade twine
twine upload dist/*
env:
TWINE_USERNAME: "qiskit"
TWINE_PASSWORD: $(TWINE_PASSWORD)

0 comments on commit 8ca24cf

Please sign in to comment.