flake8-qiskit-migration
Flake8 plugin to detect deprecated/removed imports, methods, and arguments in Qiskit 1.0 and 2.0.
Error codes
| Code | What it detects |
|---|---|
| QKT100 | Import paths deprecated in Qiskit 1.0 (migration guide) |
| QKT101 | Method calls removed in Qiskit 1.0 (e.g. .qasm(), .cnot(), .bind_parameters()) |
| QKT102 | Keyword arguments removed in Qiskit 1.0 (e.g. PassManager.append(max_iteration=...)) |
| QKT200 | Import paths removed in Qiskit 2.0 (migration guide) |
| QKT201 | Method calls removed in Qiskit 2.0 (e.g. .c_if(), .add_calibration(), .drive_channel()) |
| QKT202 | Keyword arguments removed in Qiskit 2.0 (e.g. transpile(backend_properties=...)) |
This tool is to help you quickly identify deprecated API usage and work out how to fix it. This tool is not perfect and will make some mistakes, so make sure to test your project thoroughly after migrating.
Through pipx
We recommend using this plugin through pipx.
If you have pipx installed, simply run:
pipx run flake8-qiskit-migration <path-to-source>
This will install this plugin in a temporary environment and run it. If you're
at the root of your Python project, then <path-to-source> is ./.
With Python venv
If you don't want to use pipx, you can manually create a new environment for
the linter. This approach also lets you use
nbqa to check Jupyter notebooks. Delete
the environment when you're finished.
# Make new environment and install
python -m venv .flake8-qiskit-migration-venv
source .flake8-qiskit-migration-venv/bin/activate
pip install flake8-qiskit-migration
# Run all migration checks
flake8 --select QKT <path-to-source> # e.g. `src/`
# Run only Qiskit 1.0 checks (imports + methods)
flake8 --select QKT1 <path-to-source>
# Run only Qiskit 2.0 checks (imports + methods + kwargs)
flake8 --select QKT2 <path-to-source>
# Run only import checks
flake8 --select QKT100,QKT200 <path-to-source>
# Run plugin on notebooks
pip install nbqa
nbqa flake8 ./**/*.ipynb --select QKT
# Deactivate and delete environment
deactivate
rm -r .flake8-qiskit-migration-venv
With existing flake8
If you already have flake8 installed and want run this plugin that way,
To run only the deprecation detection plugin, use the --select
argument. You'll probably want to uninstall it when you're done.
# Install plugin
pip install flake8-qiskit-migration
# Run all flake8 checks (including this plugin)
flake8 <path-to-source>
# Run only this plugin (all checks)
flake8 --select QKT <path-to-source>
# Run only Qiskit 1.0 checks
flake8 --select QKT1 <path-to-source>
# Run only Qiskit 2.0 checks
flake8 --select QKT2 <path-to-source>
# Uninstall plugin
pip uninstall flake8-qiskit-migration
Metadata
Release files for flake8-qiskit-migration 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flake8_qiskit_migration-0.5.0.tar.gz | 17.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flake8_qiskit_migration-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.3 kB
Release files / flake8_qiskit_migration-0.5.0.tar.gz
| Download URL | flake8_qiskit_migration-0.5.0.tar.gz |
|---|---|
| Size | 17.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a84c9f0a945dcee18389508ed72969a9de8657130d63fa22939ef60fe32991d6
|
|
BLAKE2b-256 checksum How to use checksums |
188d41fa6e0d3d42ac012e42f149cdf25207a1c8134495aed139c47afd6da15b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 24, 2026.
Transparency logRelease files / flake8_qiskit_migration-0.5.0-py3-none-any.whl
| Download URL | flake8_qiskit_migration-0.5.0-py3-none-any.whl |
|---|---|
| Size | 17.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f7d95a9e069dcb8d73511c27be12ba394c9099d0a40da186ac62973540dae6d1
|
|
BLAKE2b-256 checksum How to use checksums |
fca4a7ae2aa2f4f4a9fed2a89482de93d7e9ff136dcad49c5b5db1400039f70d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 24, 2026.
Transparency log