Skip to content

Commit

Permalink
Unify cibuildwheel configuration to pyproject.toml
Browse files Browse the repository at this point in the history
This commit removes all the environment variable usage for default
configuration of cibuildwheel and switches to use the pyproject.toml to
centralize the configuration for all the jobs. Environment variables are
still used for per job custom overrides which don't really fit in the
configuration of the pyproject.toml (mainly cross-build overrides and
GPU configuration).
  • Loading branch information
mtreinish committed Jan 18, 2022
1 parent 2c5c653 commit 532b8a1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 20 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,8 @@ jobs:
uses: microsoft/setup-msbuild@v1.0.2
if: runner.os == 'Windows'
- name: Install deps
run: python -m pip install -U cibuildwheel==2.1.2
run: python -m pip install -U cibuildwheel==2.2.2
- name: Build Wheels
env:
CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel"
CIBW_SKIP: "cp36-* cp310-* pp*"
CIBW_TEST_COMMAND: "python {project}/tools/verify_wheels.py"
CIBW_ENVIRONMENT_WINDOWS: "CMAKE_GENERATOR='Visual Studio 16 2019'"
run: cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v2
with:
Expand Down
18 changes: 4 additions & 14 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,9 @@ jobs:
python-version: '3.7'
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.1.2
python -m pip install cibuildwheel==2.2.2
- name: Build wheels
env:
CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel"
CIBW_SKIP: "cp36-* cp310-* pp*"
CIBW_TEST_COMMAND: "python {project}/tools/verify_wheels.py"
CIBW_ENVIRONMENT_WINDOWS: "CMAKE_GENERATOR='Visual Studio 16 2019'"
run: |
python -m cibuildwheel --output-dir wheelhouse
run: python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
Expand Down Expand Up @@ -59,14 +53,12 @@ jobs:
platforms: all
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.1.2 twine
python -m pip install cibuildwheel==2.2.2 twine
- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BEFORE_ALL_LINUX: "yum install -y https://dl.fedoraproject.org/pub/epel/7/aarch64/Packages/e/epel-release-7-12.noarch.rpm && yum install -y openblas-devel"
CIBW_SKIP: "cp36-* cp310-* pp*"
CIBW_TEST_COMMAND: "python {project}/tools/verify_wheels.py"
CIBW_ARCHS_LINUX: aarch64
- uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -113,13 +105,11 @@ jobs:
if: runner.os == 'Windows'
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.1.2
python -m pip install cibuildwheel==2.2.2
- name: Build wheels
env:
CIBW_BEFORE_ALL: "yum install -y yum-utils wget && wget https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda-repo-rhel6-10-1-local-10.1.243-418.87.00-1.0-1.x86_64.rpm && rpm -i cuda-repo-rhel6-10-1-local-10.1.243-418.87.00-1.0-1.x86_64.rpm && yum clean all && yum -y install cuda-10-1 openblas-devel"
CIBW_SKIP: "cp36-* cp310-* *-manylinux_i686 pp*"
CIBW_ENVIRONMENT: QISKIT_AER_PACKAGE_NAME=qiskit-aer-gpu AER_THRUST_BACKEND=CUDA CUDACXX=/usr/local/cuda/bin/nvcc
CIBW_TEST_COMMAND: "python {project}/tools/verify_wheels.py"
run: |
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v2
Expand Down
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@ requires = [
"numpy==1.16.3; python_version<='3.7' and platform_machine!='aarch64' or platform_python_implementation=='PyPy'",
]
build-backend = "setuptools.build_meta"

[tool.cibuildwheel]
manylinux-x86_64-image = "manylinux2010"
manylinux-i686-image = "manylinux2010"
skip = "pp* cp36-* cp310-*"
test-command = "python {project}/tools/verify_wheels.py"

[tool.cibuildwheel.linux]
before-all = "yum install -y openblas-devel"

[tool.cibuildwheel.windows]
environment = {"CMAKE_GENERATOR": "Visual Studio 16 2019"}

0 comments on commit 532b8a1

Please sign in to comment.