Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️πŸͺ update pre-commit hooks #509

Merged
merged 5 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ repos:

# Handling unwanted unicode characters
- repo: https://github.com/sirosen/texthooks
rev: 0.6.6
rev: 0.6.7
hooks:
- id: fix-ligatures
- id: fix-smartquotes
Expand All @@ -56,7 +56,7 @@ repos:

# Python linting using ruff
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.7
rev: v0.6.3
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -73,7 +73,7 @@ repos:

# Check static types with mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.1
rev: v1.11.2
hooks:
- id: mypy
files: ^(src/mqt|test/python)
Expand All @@ -87,7 +87,7 @@ repos:

# Check for spelling
- repo: https://github.com/crate-ci/typos
rev: v1.23.6
rev: v1.24.1
hooks:
- id: typos

Expand Down Expand Up @@ -125,21 +125,21 @@ repos:

# Check best practices for scientific Python code
- repo: https://github.com/scientific-python/cookie
rev: 2024.04.23
rev: 2024.08.19
hooks:
- id: sp-repo-review
additional_dependencies: ["repo-review[cli]"]

# Check JSON schemata
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.1
rev: 0.29.2
hooks:
- id: check-dependabot
- id: check-github-workflows
- id: check-readthedocs

# Check the pyproject.toml file
- repo: https://github.com/henryiii/validate-pyproject-schema-store
rev: 2024.08.08
rev: 2024.08.26
hooks:
- id: validate-pyproject
2 changes: 1 addition & 1 deletion cmake/ExternalDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ endif()
# cmake-format: off
set(MQT_CORE_VERSION 2.6.1
CACHE STRING "MQT Core version")
set(MQT_CORE_REV "89f18fb322ff2ce86e33558e3a2b42a08e655174"
set(MQT_CORE_REV "41eea72cdbefbd86ba06f76dc41a911950dd3081"
CACHE STRING "MQT Core identifier (tag, branch or commit hash)")
set(MQT_CORE_REPO_OWNER "cda-tum"
CACHE STRING "MQT Core repository owner (change when using a fork)")
Expand Down
4 changes: 2 additions & 2 deletions docs/source/Mapping.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
"metadata": {},
"outputs": [],
"source": [
"print(\"Additional SWAPs: %d\" % res.output.swaps)\n",
"print(f\"Additional SWAPs: {res.output.swaps}\")\n",
"print(f\"Runtime: {res.time:f}\")"
]
},
Expand Down Expand Up @@ -196,7 +196,7 @@
"metadata": {},
"outputs": [],
"source": [
"print(\"Additional SWAPs: %d\" % res.output.swaps)\n",
"print(f\"Additional SWAPs: {res.output.swaps}\")\n",
"print(f\"Runtime: {res.time:f}\")"
]
},
Expand Down
20 changes: 9 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,15 @@ addopts = ["-ra", "--strict-markers", "--strict-config", "--showlocals"]
log_cli_level = "INFO"
xfail_strict = true
filterwarnings = [
"error",
'ignore:.*datetime\.datetime\.utcfromtimestamp.*:DeprecationWarning:',
'ignore:.*Qiskit with Python 3.8.*:DeprecationWarning:',
"error",
'ignore:.*datetime\.datetime\.utcfromtimestamp.*:DeprecationWarning:',
'ignore:.*Qiskit with Python 3.8.*:DeprecationWarning:',
'ignore:.*qiskit\.providers\.models.* is deprecated.*:DeprecationWarning:qiskit.*', # Qiskit imports deprecated code (should be resolved in the 1.2.1 release)
'ignore:.*Treating CircuitInstruction as an iterable is deprecated.*:DeprecationWarning:mqt.qcec.*', # Needs a new release of QCEC (should be resolved in 2.7.1)
# we purposely maintain compatibility with the V1 backends until Qiskit removes them in 2.0
'ignore:.*qiskit\.providers\.models.* is deprecated.*:DeprecationWarning:mqt.qmap.*',
'ignore:.*qiskit\.providers\.fake_provider\.fake_backend\.FakeBackend.* is deprecated.*:DeprecationWarning:',
'ignore:.*qiskit\.providers\.backend.BackendV1.* is deprecated.*:DeprecationWarning:',
]

[tool.coverage]
Expand Down Expand Up @@ -179,7 +185,6 @@ ignore_missing_imports = true

[tool.ruff]
line-length = 120
src = ["src"]
preview = true
unsafe-fixes = true

Expand Down Expand Up @@ -270,13 +275,6 @@ aer = "aer"
iy = "iy"


[tool.repo-review]
ignore = [
"PC160", # "Uses codespell" -> switched to https://github.com/crate-ci/typos
"PC180", # "Uses prettier" -> switched to different prettier-mirror that is not recognized by the check
]


[tool.cibuildwheel]
build = "cp3*"
skip = "*-musllinux*"
Expand Down
11 changes: 11 additions & 0 deletions src/mqt/qmap/qiskit/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ def import_backend(backend: Backend) -> Architecture:

"""
if isinstance(backend, BackendV1):
import warnings

warnings.warn(
"The class ``qiskit.providers.backend.BackendV1`` is deprecated as of qiskit 1.2. "
"It will be removed in the 2.0 release, scheduled for 20 March 2025. "
"MQT QMAP will continue to support BackendV1 instances until they are removed from Qiskit. "
"Please use ``qiskit.providers.backend.BackendV2`` instances instead.",
DeprecationWarning,
stacklevel=2,
)

return import_backend_v2(BackendV2Converter(backend))
if isinstance(backend, BackendV2):
return import_backend_v2(backend)
Expand Down
Loading