Skip to content

Commit

Permalink
Add support for running with Python 3.12
Browse files Browse the repository at this point in the history
Python 3.12.0 was released on 10-02-2023, this commit marks the start
of support for Python 3.12 in qiskit-aer. It adds the supported Python
version in the package metadata and updates the CI configuration to run
test jobs on Python 3.12 and build Python 3.12 wheels on release.
  • Loading branch information
mtreinish committed Jan 4, 2024
1 parent 180a0b6 commit f5565b6
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
uses: microsoft/[email protected]
if: runner.os == 'Windows'
- name: Install deps
run: python -m pip install -U cibuildwheel==2.11.2
run: python -m pip install -U cibuildwheel==2.16.2
- name: Build Wheels
env:
AER_CMAKE_OPENMP_BUILD: 1
Expand All @@ -152,7 +152,7 @@ jobs:
with:
python-version: 3.8
- name: Install deps
run: python -m pip install -U cibuildwheel==2.11.2
run: python -m pip install -U cibuildwheel==2.16.2
- name: Build Wheels
env:
CIBW_ARCHS_MACOS: arm64
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
env:
CIBW_BEFORE_ALL: "yum install -y yum-utils wget && wget -q https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-rhel7-11-8-local-11.8.0_520.61.05-1.x86_64.rpm && rpm -i cuda-repo-rhel7-11-8-local-11.8.0_520.61.05-1.x86_64.rpm && yum clean all && yum -y install cuda && yum -y install openblas-devel && yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo && yum clean all"
CIBW_BEFORE_BUILD : "pip install nvidia-cuda-runtime-cu11 nvidia-cublas-cu11 nvidia-cusolver-cu11 nvidia-cusparse-cu11 cuquantum-cu11"
CIBW_SKIP: "*-manylinux_i686 pp* cp36* cp37* cp312* *musllinux*"
CIBW_SKIP: "*-manylinux_i686 pp* cp36* cp37* *musllinux*"
CIBW_ENVIRONMENT: QISKIT_AER_PACKAGE_NAME=qiskit-aer-gpu-cu11 QISKIT_AER_CUDA_MAJOR=11 CMAKE_VERBOSE_MAKEFILE=true AER_THRUST_BACKEND=CUDA CUDACXX=/usr/local/cuda/bin/nvcc AER_CUDA_ARCH="7.0 7.2 7.5 8.0 8.6 8.7" AER_PYTHON_CUDA_ROOT=/opt/_internal AER_CIBUILD=true
CIBW_REPAIR_WHEEL_COMMAND: 'auditwheel repair --exclude libcudart.so.11.0 --exclude libcustatevec.so.1 --exclude libcutensornet.so.2 --exclude libcutensor.so.1 --exclude libcutensorMg.so.1 --exclude libcusolver.so.11 --exclude libcusolverMg.so.11 --exclude libcusparse.so.11 --exclude libcublas.so.11 --exclude libcublasLt.so.11 -w {dest_dir} {wheel}'
run: |
Expand Down Expand Up @@ -192,7 +192,7 @@ jobs:
env:
CIBW_BEFORE_ALL: "yum install -y yum-utils wget && wget -q https://developer.download.nvidia.com/compute/cuda/12.2.2/local_installers/cuda-repo-rhel7-12-2-local-12.2.2_535.104.05-1.x86_64.rpm && rpm -i cuda-repo-rhel7-12-2-local-12.2.2_535.104.05-1.x86_64.rpm && yum clean all && yum -y install nvidia-driver-latest-dkms && yum -y install cuda && yum -y install openblas-devel && yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo && yum clean all"
CIBW_BEFORE_BUILD : "pip install nvidia-cuda-runtime-cu12 nvidia-nvjitlink-cu12 nvidia-cublas-cu12 nvidia-cusolver-cu12 nvidia-cusparse-cu12 cuquantum-cu12"
CIBW_SKIP: "*-manylinux_i686 pp* cp36* cp37* cp312* *musllinux*"
CIBW_SKIP: "*-manylinux_i686 pp* cp36* cp37* *musllinux*"
CIBW_ENVIRONMENT: QISKIT_AER_PACKAGE_NAME=qiskit-aer-gpu QISKIT_AER_CUDA_MAJOR=12 CMAKE_VERBOSE_MAKEFILE=true AER_THRUST_BACKEND=CUDA CUDACXX=/usr/local/cuda/bin/nvcc AER_CUDA_ARCH="7.0 7.2 7.5 8.0 8.6 8.7 9.0" AER_PYTHON_CUDA_ROOT=/opt/_internal AER_CIBUILD=true
CIBW_REPAIR_WHEEL_COMMAND: 'auditwheel repair --exclude libcudart.so.12 --exclude libcustatevec.so.1 --exclude libcutensornet.so.2 --exclude libcutensor.so.1 --exclude libcutensorMg.so.1 --exclude libcusolver.so.11 --exclude libcusolverMg.so.11 --exclude libcusolver.so.12 --exclude libcusolverMg.so.12 --exclude libcusparse.so.12 --exclude libcublas.so.12 --exclude libcublasLt.so.12 --exclude libnvJitLink.so.12 -w {dest_dir} {wheel}'
run: |
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
needs: ["lint"]
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", '3.11']
python-version: [3.8, 3.9, "3.10", '3.11', "3.12"]
platform: [
{ os: "ubuntu-latest", python-architecture: "x64" },
]
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
os: ["ubuntu-latest"]
env:
AER_THRUST_BACKEND: OMP
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", '3.11']
python-version: [3.8, 3.9, "3.10", '3.11', "3.12"]
os: ["macOS-latest"]
env:
AER_THRUST_BACKEND: OMP
Expand Down Expand Up @@ -233,7 +233,7 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
os: ["windows-2019"]
env:
AER_THRUST_BACKEND: OMP
Expand Down Expand Up @@ -280,4 +280,3 @@ jobs:
rm -rf qiskit_aer
stestr run --slowest
shell: bash

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ build-backend = "setuptools.build_meta"
[tool.cibuildwheel]
manylinux-x86_64-image = "manylinux2014"
manylinux-i686-image = "manylinux2014"
skip = "pp* cp36* cp37* cp312* *musllinux*"
test-skip = "cp310-win32 cp310-manylinux_i686 cp311-win32 cp311-manylinux_i686"
skip = "pp* cp36* cp37* *musllinux*"
test-skip = "cp310-win32 cp310-manylinux_i686 cp311-win32 cp311-manylinux_i686 cp312-win32 cp312-manylinux_i686"
test-command = "python {project}/tools/verify_wheels.py"
# We need to use pre-built versions of Numpy and Scipy in the tests; they have a
# tendency to crash if they're installed from source by `pip install`, and since
Expand Down
4 changes: 4 additions & 0 deletions releasenotes/notes/add-py312-795ffe7d68f41c73.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
features:
- |
Added support for running qiskit-aer with Python 3.12.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
]

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
minversion = 2.1
envlist = py37, py38, py39, py310, py311, lint
envlist = py38, py39, py310, py311, py312, lint
skipsdist = True

[testenv]
Expand Down

0 comments on commit f5565b6

Please sign in to comment.