Skip to content

Commit cbe4284

Browse files
Drop Python 3.9 support after EoL (#1002)
* Drop Python 3.9 support after EoL Update classifiers, python_requires, CI workflows, tox envs, and release notes to require Python 3.10+ * Update main.yml * Update .github/workflows/main.yml * Changes done I have applied all the suggestions, and 3.10 is now consistently quoted in the workflows. * More changes done config references from Python 3.9 to 3.10. --------- Co-authored-by: Edoardo Altamura <38359901+edoaltamura@users.noreply.github.com>
1 parent c34c73a commit cbe4284

File tree

8 files changed

+30
-33
lines changed

8 files changed

+30
-33
lines changed

.github/actions/run-tests/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ runs:
3636
if [ "${{ inputs.event-name }}" == "schedule" ] || [ "${{ inputs.run-slow }}" == "true" ]; then
3737
export QISKIT_TESTS="run_slow"
3838
fi
39-
if [ "${{ inputs.os }}" == "ubuntu-latest" ] && [ "${{ inputs.python-version }}" == "3.9" ]; then
39+
if [ "${{ inputs.os }}" == "ubuntu-latest" ] && [ "${{ inputs.python-version }}" == "3.10" ]; then
4040
export PYTHON="coverage3 run --source qiskit_machine_learning --parallel-mode"
4141
fi
4242
stestr --test-path test run 2> >(tee /dev/stderr out.txt > /dev/null)

.github/workflows/deploy-code.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
id-token: write
2626
strategy:
2727
matrix:
28-
python-version: [3.9]
28+
python-version: ['3.10']
2929
steps:
3030
- uses: actions/checkout@v6
3131
- uses: actions/setup-python@v6

.github/workflows/main.yml

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
strategy:
3636
matrix:
3737
os: [ubuntu-latest]
38-
python-version: [3.9]
38+
python-version: ['3.10']
3939
steps:
4040
- name: Print Concurrency Group
4141
env:
@@ -112,15 +112,15 @@ jobs:
112112
fail-fast: false
113113
matrix:
114114
os: [ubuntu-latest]
115-
python-version: [3.9, '3.10', 3.11, 3.12, 3.13]
115+
python-version: ['3.10', 3.11, 3.12, 3.13]
116116
include:
117117
# macos-latest is an Arm64 image
118118
- os: macos-latest
119-
python-version: 3.9
119+
python-version: '3.10'
120120
- os: macos-latest
121121
python-version: 3.13
122122
- os: windows-latest
123-
python-version: 3.9
123+
python-version: '3.10'
124124
- os: windows-latest
125125
python-version: 3.13
126126
steps:
@@ -161,7 +161,7 @@ jobs:
161161
run: |
162162
coverage3 combine
163163
mv .coverage ./ci-artifact-data/ml.dat
164-
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == 3.9 }}
164+
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' }}
165165
shell: bash
166166
- uses: actions/upload-artifact@v5
167167
with:
@@ -184,7 +184,7 @@ jobs:
184184
fail-fast: false
185185
matrix:
186186
os: [ubuntu-latest]
187-
python-version: [3.9, 3.13]
187+
python-version: ['3.10', 3.13]
188188
steps:
189189
- uses: actions/checkout@v6
190190
with:
@@ -247,29 +247,25 @@ jobs:
247247
cd docs/_build/html
248248
mkdir artifacts
249249
tar -zcvf artifacts/tutorials.tar.gz --exclude=./artifacts .
250-
if: ${{ matrix.python-version == 3.9 && !startsWith(github.ref, 'refs/heads/stable') && !startsWith(github.base_ref, 'stable/') }}
250+
if: ${{ matrix.python-version == '3.10' && !startsWith(github.ref, 'refs/heads/stable') && !startsWith(github.base_ref, 'stable/') }}
251251
shell: bash
252252
- name: Run upload stable tutorials
253253
uses: actions/upload-artifact@v5
254254
with:
255255
name: tutorials-stable${{ matrix.python-version }}
256256
path: docs/_build/html/artifacts/tutorials.tar.gz
257-
if: ${{ matrix.python-version == 3.9 && !startsWith(github.ref, 'refs/heads/stable') && !startsWith(github.base_ref, 'stable/') }}
257+
if: ${{ matrix.python-version == '3.10' && !startsWith(github.ref, 'refs/heads/stable') && !startsWith(github.base_ref, 'stable/') }}
258258
Deprecation_Messages_and_Coverage:
259259
needs: [Checks, MachineLearning, Tutorials]
260260
runs-on: ubuntu-latest
261261
strategy:
262262
matrix:
263-
python-version: [3.9]
263+
python-version: ['3.10']
264264
steps:
265265
- uses: actions/checkout@v6
266266
- uses: actions/setup-python@v6
267267
with:
268268
python-version: ${{ matrix.python-version }}
269-
- uses: actions/download-artifact@v6
270-
with:
271-
name: ubuntu-latest-3.9
272-
path: /tmp/u39
273269
- uses: actions/download-artifact@v6
274270
with:
275271
name: ubuntu-latest-3.10
@@ -288,32 +284,28 @@ jobs:
288284
path: /tmp/u313
289285
- uses: actions/download-artifact@v6
290286
with:
291-
name: macos-latest-3.9
292-
path: /tmp/m39
287+
name: macos-latest-3.10
288+
path: /tmp/m310
293289
- uses: actions/download-artifact@v6
294290
with:
295291
name: macos-latest-3.13
296292
path: /tmp/m313
297293
- uses: actions/download-artifact@v6
298294
with:
299-
name: windows-latest-3.9
300-
path: /tmp/w39
295+
name: windows-latest-3.10
296+
path: /tmp/w310
301297
- uses: actions/download-artifact@v6
302298
with:
303299
name: windows-latest-3.13
304300
path: /tmp/w313
301+
305302
- name: Install Dependencies
306303
run: pip install -U coverage coveralls diff-cover
307304
shell: bash
308305
- name: Combined Deprecation Messages
309306
run: |
310-
sort -f -u /tmp/u39/ml.dep /tmp/u310/ml.dep /tmp/u311/ml.dep /tmp/u312/ml.dep /tmp/u313/ml.dep /tmp/m39/ml.dep /tmp/m313/ml.dep /tmp/w39/ml.dep /tmp/w313/ml.dep || true
307+
sort -f -u /tmp/u310/ml.dep /tmp/u311/ml.dep /tmp/u312/ml.dep /tmp/u313/ml.dep /tmp/m310/ml.dep /tmp/m313/ml.dep /tmp/w310/ml.dep /tmp/w313/ml.dep || true
311308
shell: bash
312309
- name: Coverage combine
313-
run: coverage3 combine /tmp/u39/ml.dat
314-
shell: bash
315-
- name: Upload to Coveralls
316-
env:
317-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
318-
run: coveralls --service=github
319-
shell: bash
310+
run: coverage3 combine /tmp/u310/ml.dat
311+
shell: bash

.mergify.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
queue_rules:
22
- name: automerge
33
queue_conditions:
4-
- check-success=Deprecation_Messages_and_Coverage (3.9)
4+
- check-success=Deprecation_Messages_and_Coverage (3.10)
55
- "#approved-reviews-by>=1"
66
- label=automerge
77
- label!=on hold
88
merge_conditions:
9-
- check-success=Deprecation_Messages_and_Coverage (3.9)
9+
- check-success=Deprecation_Messages_and_Coverage (3.10)
1010
merge_method: squash
1111

1212
pull_request_rules:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ extension-pkg-allow-list = [
1313
"rustworkx",
1414
]
1515
load-plugins = ["pylint.extensions.docparams", "pylint.extensions.docstyle"]
16-
py-version = "3.9" # update it when bumping minimum supported python version
16+
py-version = "3.10" # update it when bumping minimum supported python version
1717

1818
[tool.pylint.basic]
1919
good-names = ["a", "b", "i", "j", "k", "d", "n", "m", "ex", "v", "w", "x", "y", "z", "Run", "_", "logger", "q", "c", "r", "qr", "cr", "qc", "nd", "pi", "op", "b", "ar", "br", "p", "cp", "ax", "dt", "__unittest", "iSwapGate", "mu"]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
upgrade:
3+
- |
4+
Qiskit Machine Learning no longer supports Python 3.9, following its
5+
EoL in October 2025. The minimum required Python
6+
version is now 3.10.

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
"Operating System :: MacOS",
6262
"Operating System :: POSIX :: Linux",
6363
"Programming Language :: Python :: 3 :: Only",
64-
"Programming Language :: Python :: 3.9",
6564
"Programming Language :: Python :: 3.10",
6665
"Programming Language :: Python :: 3.11",
6766
"Programming Language :: Python :: 3.12",
@@ -74,7 +73,7 @@
7473
),
7574
install_requires=REQUIREMENTS,
7675
include_package_data=True,
77-
python_requires=">=3.9",
76+
python_requires=">=3.10",
7877
extras_require={
7978
"torch": ["torch"],
8079
"sparse": ["sparse"],

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
# Sets this min.version because of differences with env_tmp_dir env.
33
minversion = 4.0.2
4-
envlist = py39, py310, py311, py312, py313, lint, gpu, gpu-amd
4+
envlist = py310, py311, py312, py313, lint, gpu, gpu-amd
55
skipsdist = True
66

77
[testenv]

0 commit comments

Comments
 (0)