Skip to content

Commit

Permalink
Add support for Python 3.12 (#429)
Browse files Browse the repository at this point in the history
* WIP: Add support for Python 3.12

* Disable tests using quantum-serverless

... which does not yet work on Python 3.12
  • Loading branch information
garrison authored Mar 6, 2024
1 parent ef510ca commit 4f94992
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/test_latest_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
max-parallel: 4
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.11"]
python-version: ["3.8", "3.12"]
include:
- os: macos-latest
python-version: "3.8"
Expand All @@ -47,4 +47,8 @@ jobs:
pver=${{ matrix.python-version }}
tox -epy${pver/./} -- --run-slow
notebook_flags=""
if [ "$pver" = "3.12" ]; then
echo Skipping tutorials that require cplex
notebook_flags="${notebook_flags} --ignore=docs/circuit_cutting/cutqc/tutorials/tutorial_1_automatic_cut_finding.ipynb"
fi
tox -epy${pver/./}-notebook -- ${notebook_flags}
3 changes: 2 additions & 1 deletion INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ take care when installing the toolbox, depending on which tools they
intend to use.

- The automatic wire cut search in the ``cutqc`` package depends
on CPLEX, which is only available on Intel chips.
on CPLEX, which is only available on Intel chips and is not yet available
for Python 3.12.

In each case, one method that is guaranteed to work is to :ref:`use
the toolbox within Docker <Option 3>`. Other methods include:
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Physics",
]

Expand All @@ -38,8 +39,8 @@ dependencies = [
cplex = [
# We use the same restrictions in both of the following lines, as there
# is no reason for us to install docplex without cplex.
"docplex>=2.23.222; platform_machine != 'arm64'",
"cplex>=22.1.0.0; platform_machine != 'arm64'",
"docplex>=2.23.222; python_version < '3.12' and platform_machine != 'arm64'",
"cplex>=22.1.0.0; python_version < '3.12' and platform_machine != 'arm64'",
]
dev = [
"circuit-knitting-toolbox[test,nbtest,lint]",
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
minversion = 3.25
envlist = py{38,39,310,311}{,-notebook}, lint, coverage, docs
envlist = py{38,39,310,311,312}{,-notebook}, lint, coverage, docs
isolated_build = True

[testenv]
Expand Down Expand Up @@ -34,7 +34,7 @@ commands =
pylint -rn --py-version=3.8 --disable=all --enable=reimported,no-self-use,no-else-raise,redefined-argument-from-local,redefined-builtin,raise-missing-from,cyclic-import,unused-argument circuit_knitting/ test/ tools/
nbqa pylint -rn --py-version=3.8 --disable=all --enable=reimported,no-self-use,no-else-raise,redefined-argument-from-local,redefined-builtin,raise-missing-from,cyclic-import,unused-argument docs/

[testenv:{,py-,py3-,py38-,py39-,py310-,py311-}notebook]
[testenv:{,py-,py3-,py38-,py39-,py310-,py311-,py312-}notebook]
extras =
nbtest
notebook-dependencies
Expand Down

0 comments on commit 4f94992

Please sign in to comment.