From 9a8fed0ca0682a14793121ef053be4ef1cbe0f2e Mon Sep 17 00:00:00 2001 From: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com> Date: Mon, 26 Feb 2024 21:29:23 +0900 Subject: [PATCH] Add Python 3.12 support (#580) * add constraint for cplex * Add Python 3.12 support * reno (cherry picked from commit a52d23d40bfe73bd25053dfc0299f972cddcf33a) --- .github/workflows/main.yml | 8 ++++++-- .../notes/add-python312-support-e3e2bc0c6a10b613.yaml | 5 +++++ setup.py | 3 ++- tox.ini | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/add-python312-support-e3e2bc0c6a10b613.yaml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 20ee1053c..a3080f14b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -116,7 +116,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: [3.8, 3.9, '3.10', 3.11] + python-version: [3.8, 3.9, '3.10', 3.11, 3.12] include: - os: macos-latest python-version: 3.8 @@ -323,6 +323,10 @@ jobs: with: name: ubuntu-latest-3.11 path: /tmp/o311 + - uses: actions/download-artifact@v4 + with: + name: ubuntu-latest-3.12 + path: /tmp/o312 - uses: actions/download-artifact@v4 with: name: macos-latest-3.8 @@ -344,7 +348,7 @@ jobs: shell: bash - name: Combined Deprecation Messages run: | - sort -f -u /tmp/o38/opt.dep /tmp/o39/opt.dep /tmp/o310/opt.dep /tmp/o311/opt.dep /tmp/m38/opt.dep /tmp/m311/opt.dep /tmp/w38/opt.dep /tmp/w311/opt.dep || true + sort -f -u /tmp/o38/opt.dep /tmp/o39/opt.dep /tmp/o310/opt.dep /tmp/o311/opt.dep /tmp/o312/opt.dep /tmp/m38/opt.dep /tmp/m311/opt.dep /tmp/w38/opt.dep /tmp/w311/opt.dep || true shell: bash - name: Coverage combine run: coverage3 combine /tmp/o38/opt.dat diff --git a/releasenotes/notes/add-python312-support-e3e2bc0c6a10b613.yaml b/releasenotes/notes/add-python312-support-e3e2bc0c6a10b613.yaml new file mode 100644 index 000000000..1ff6e95d8 --- /dev/null +++ b/releasenotes/notes/add-python312-support-e3e2bc0c6a10b613.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Added support for using Qiskit Optimization with Python 3.12. + diff --git a/setup.py b/setup.py index 40f97fde5..76d5242ea 100644 --- a/setup.py +++ b/setup.py @@ -65,6 +65,7 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Scientific/Engineering", ], keywords="qiskit sdk quantum optimization", @@ -73,7 +74,7 @@ include_package_data=True, python_requires=">=3.8", extras_require={ - "cplex": ["cplex"], + "cplex": ["cplex; python_version < '3.12' and platform_machine != 'arm64'"], "cvx": ["cvxpy"], "matplotlib": ["matplotlib"], "gurobi": ["gurobipy"], diff --git a/tox.ini b/tox.ini index ca4cbc508..b917bc540 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 3.3.0 -envlist = py38, py39, py310, py311, lint +envlist = py38, py39, py310, py311, py312, lint skipsdist = True [testenv]