From aee0678d77eb9b247d778f398bae16e50d0daf66 Mon Sep 17 00:00:00 2001 From: shalini9894 Date: Sat, 22 Nov 2025 02:37:36 +0530 Subject: [PATCH 1/5] Drop Python 3.9 support after EoL Update classifiers, python_requires, CI workflows, tox envs, and release notes to require Python 3.10+ --- .github/workflows/deploy-code.yml | 2 +- .github/workflows/main.yml | 44 ++++++++----------- releasenotes/drop-python-39-eol-991-2025.yaml | 6 +++ setup.py | 3 +- tox.ini | 2 +- 5 files changed, 27 insertions(+), 30 deletions(-) create mode 100644 releasenotes/drop-python-39-eol-991-2025.yaml diff --git a/.github/workflows/deploy-code.yml b/.github/workflows/deploy-code.yml index a9dfcd25e..da7e4fac5 100644 --- a/.github/workflows/deploy-code.yml +++ b/.github/workflows/deploy-code.yml @@ -25,7 +25,7 @@ jobs: id-token: write strategy: matrix: - python-version: [3.9] + python-version: [3.10] steps: - uses: actions/checkout@v6 - uses: actions/setup-python@v6 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4e2c1dc55..797685fd7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: [3.9] + python-version: [3.10] steps: - name: Print Concurrency Group env: @@ -112,15 +112,15 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: [3.9, '3.10', 3.11, 3.12, 3.13] + python-version: [3.10, 3.11, 3.12, 3.13] include: # macos-latest is an Arm64 image - os: macos-latest - python-version: 3.9 + python-version: 3.10 - os: macos-latest python-version: 3.13 - os: windows-latest - python-version: 3.9 + python-version: 3.10 - os: windows-latest python-version: 3.13 steps: @@ -161,7 +161,7 @@ jobs: run: | coverage3 combine mv .coverage ./ci-artifact-data/ml.dat - if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == 3.9 }} + if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == 3.10 }} shell: bash - uses: actions/upload-artifact@v5 with: @@ -184,7 +184,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: [3.9, 3.13] + python-version: [3.10, 3.13] steps: - uses: actions/checkout@v6 with: @@ -247,30 +247,26 @@ jobs: cd docs/_build/html mkdir artifacts tar -zcvf artifacts/tutorials.tar.gz --exclude=./artifacts . - if: ${{ matrix.python-version == 3.9 && !startsWith(github.ref, 'refs/heads/stable') && !startsWith(github.base_ref, 'stable/') }} + if: ${{ matrix.python-version == 3.10 && !startsWith(github.ref, 'refs/heads/stable') && !startsWith(github.base_ref, 'stable/') }} shell: bash - name: Run upload stable tutorials uses: actions/upload-artifact@v5 with: name: tutorials-stable${{ matrix.python-version }} path: docs/_build/html/artifacts/tutorials.tar.gz - if: ${{ matrix.python-version == 3.9 && !startsWith(github.ref, 'refs/heads/stable') && !startsWith(github.base_ref, 'stable/') }} + if: ${{ matrix.python-version == 3.10 && !startsWith(github.ref, 'refs/heads/stable') && !startsWith(github.base_ref, 'stable/') }} Deprecation_Messages_and_Coverage: needs: [Checks, MachineLearning, Tutorials] runs-on: ubuntu-latest strategy: matrix: - python-version: [3.9] + python-version: [3.10] steps: - uses: actions/checkout@v6 - uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - - uses: actions/download-artifact@v6 - with: - name: ubuntu-latest-3.9 - path: /tmp/u39 - - uses: actions/download-artifact@v6 + - uses: actions/download-artifact@v6 with: name: ubuntu-latest-3.10 path: /tmp/u310 @@ -288,32 +284,28 @@ jobs: path: /tmp/u313 - uses: actions/download-artifact@v6 with: - name: macos-latest-3.9 - path: /tmp/m39 + name: macos-latest-3.10 + path: /tmp/m310 - uses: actions/download-artifact@v6 with: name: macos-latest-3.13 path: /tmp/m313 - uses: actions/download-artifact@v6 with: - name: windows-latest-3.9 - path: /tmp/w39 + name: windows-latest-3.10 + path: /tmp/w310 - uses: actions/download-artifact@v6 with: name: windows-latest-3.13 path: /tmp/w313 + - name: Install Dependencies run: pip install -U coverage coveralls diff-cover shell: bash - name: Combined Deprecation Messages run: | - 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 + 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 shell: bash - name: Coverage combine - run: coverage3 combine /tmp/u39/ml.dat - shell: bash - - name: Upload to Coveralls - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: coveralls --service=github - shell: bash + run: coverage3 combine /tmp/u310/ml.dat + shell: bash \ No newline at end of file diff --git a/releasenotes/drop-python-39-eol-991-2025.yaml b/releasenotes/drop-python-39-eol-991-2025.yaml new file mode 100644 index 000000000..d23d5a17a --- /dev/null +++ b/releasenotes/drop-python-39-eol-991-2025.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + Qiskit Machine Learning no longer supports Python 3.9, following its + EoL in October 2025. The minimum required Python + version is now 3.10. diff --git a/setup.py b/setup.py index 6a2758205..dc3a0c614 100644 --- a/setup.py +++ b/setup.py @@ -61,7 +61,6 @@ "Operating System :: MacOS", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -74,7 +73,7 @@ ), install_requires=REQUIREMENTS, include_package_data=True, - python_requires=">=3.9", + python_requires=">=3.10", extras_require={ "torch": ["torch"], "sparse": ["sparse"], diff --git a/tox.ini b/tox.ini index bd5415410..9d8e5c4c5 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] # Sets this min.version because of differences with env_tmp_dir env. minversion = 4.0.2 -envlist = py39, py310, py311, py312, py313, lint, gpu, gpu-amd +envlist = py310, py311, py312, py313, lint, gpu, gpu-amd skipsdist = True [testenv] From f761964f0e1ff8934061a5b5386254e5693f8a8f Mon Sep 17 00:00:00 2001 From: shalini9894 Date: Sat, 22 Nov 2025 02:50:56 +0530 Subject: [PATCH 2/5] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 797685fd7..03835f2b3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -266,7 +266,7 @@ jobs: - uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - - uses: actions/download-artifact@v6 + - uses: actions/download-artifact@v6 with: name: ubuntu-latest-3.10 path: /tmp/u310 From 964841cd08b3319aaf11ddb5942dc2a6da4639c1 Mon Sep 17 00:00:00 2001 From: Edoardo Altamura <38359901+edoaltamura@users.noreply.github.com> Date: Sat, 22 Nov 2025 19:54:08 -0500 Subject: [PATCH 3/5] Update .github/workflows/main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 03835f2b3..e03eb0c5f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -112,7 +112,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: [3.10, 3.11, 3.12, 3.13] + python-version: ['3.10', 3.11, 3.12, 3.13] include: # macos-latest is an Arm64 image - os: macos-latest From c69688e49aa938ad7e4e96077ae87607e49ce8f7 Mon Sep 17 00:00:00 2001 From: shalini9894 Date: Sun, 23 Nov 2025 14:24:43 +0530 Subject: [PATCH 4/5] Changes done I have applied all the suggestions, and 3.10 is now consistently quoted in the workflows. --- .github/workflows/deploy-code.yml | 2 +- .github/workflows/main.yml | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy-code.yml b/.github/workflows/deploy-code.yml index da7e4fac5..d7ec224f3 100644 --- a/.github/workflows/deploy-code.yml +++ b/.github/workflows/deploy-code.yml @@ -25,7 +25,7 @@ jobs: id-token: write strategy: matrix: - python-version: [3.10] + python-version: ['3.10'] steps: - uses: actions/checkout@v6 - uses: actions/setup-python@v6 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e03eb0c5f..fe3fb7ea5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: [3.10] + python-version: ['3.10'] steps: - name: Print Concurrency Group env: @@ -116,11 +116,11 @@ jobs: include: # macos-latest is an Arm64 image - os: macos-latest - python-version: 3.10 + python-version: '3.10' - os: macos-latest python-version: 3.13 - os: windows-latest - python-version: 3.10 + python-version: '3.10' - os: windows-latest python-version: 3.13 steps: @@ -161,7 +161,7 @@ jobs: run: | coverage3 combine mv .coverage ./ci-artifact-data/ml.dat - if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == 3.10 }} + if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' }} shell: bash - uses: actions/upload-artifact@v5 with: @@ -184,7 +184,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: [3.10, 3.13] + python-version: ['3.10', 3.13] steps: - uses: actions/checkout@v6 with: @@ -247,20 +247,20 @@ jobs: cd docs/_build/html mkdir artifacts tar -zcvf artifacts/tutorials.tar.gz --exclude=./artifacts . - if: ${{ matrix.python-version == 3.10 && !startsWith(github.ref, 'refs/heads/stable') && !startsWith(github.base_ref, 'stable/') }} + if: ${{ matrix.python-version == '3.10' && !startsWith(github.ref, 'refs/heads/stable') && !startsWith(github.base_ref, 'stable/') }} shell: bash - name: Run upload stable tutorials uses: actions/upload-artifact@v5 with: name: tutorials-stable${{ matrix.python-version }} path: docs/_build/html/artifacts/tutorials.tar.gz - if: ${{ matrix.python-version == 3.10 && !startsWith(github.ref, 'refs/heads/stable') && !startsWith(github.base_ref, 'stable/') }} + if: ${{ matrix.python-version == '3.10' && !startsWith(github.ref, 'refs/heads/stable') && !startsWith(github.base_ref, 'stable/') }} Deprecation_Messages_and_Coverage: needs: [Checks, MachineLearning, Tutorials] runs-on: ubuntu-latest strategy: matrix: - python-version: [3.10] + python-version: ['3.10'] steps: - uses: actions/checkout@v6 - uses: actions/setup-python@v6 From f35fe6d156f724cbd84265a4e036274e0649503b Mon Sep 17 00:00:00 2001 From: shalini9894 Date: Tue, 25 Nov 2025 01:46:08 +0530 Subject: [PATCH 5/5] More changes done config references from Python 3.9 to 3.10. --- .github/actions/run-tests/action.yml | 2 +- .mergify.yml | 4 ++-- pyproject.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/run-tests/action.yml b/.github/actions/run-tests/action.yml index 9ade249ac..89e7feae5 100644 --- a/.github/actions/run-tests/action.yml +++ b/.github/actions/run-tests/action.yml @@ -36,7 +36,7 @@ runs: if [ "${{ inputs.event-name }}" == "schedule" ] || [ "${{ inputs.run-slow }}" == "true" ]; then export QISKIT_TESTS="run_slow" fi - if [ "${{ inputs.os }}" == "ubuntu-latest" ] && [ "${{ inputs.python-version }}" == "3.9" ]; then + if [ "${{ inputs.os }}" == "ubuntu-latest" ] && [ "${{ inputs.python-version }}" == "3.10" ]; then export PYTHON="coverage3 run --source qiskit_machine_learning --parallel-mode" fi stestr --test-path test run 2> >(tee /dev/stderr out.txt > /dev/null) diff --git a/.mergify.yml b/.mergify.yml index bcaac7727..d5277d1e8 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -1,12 +1,12 @@ queue_rules: - name: automerge queue_conditions: - - check-success=Deprecation_Messages_and_Coverage (3.9) + - check-success=Deprecation_Messages_and_Coverage (3.10) - "#approved-reviews-by>=1" - label=automerge - label!=on hold merge_conditions: - - check-success=Deprecation_Messages_and_Coverage (3.9) + - check-success=Deprecation_Messages_and_Coverage (3.10) merge_method: squash pull_request_rules: diff --git a/pyproject.toml b/pyproject.toml index f84e39f65..c2c88238e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ extension-pkg-allow-list = [ "rustworkx", ] load-plugins = ["pylint.extensions.docparams", "pylint.extensions.docstyle"] -py-version = "3.9" # update it when bumping minimum supported python version +py-version = "3.10" # update it when bumping minimum supported python version [tool.pylint.basic] 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"]