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

➖ only require typing_extensions on Python < 3.11 #445

Merged
merged 1 commit into from
Aug 14, 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
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ classifiers = [
requires-python = ">=3.8"
dependencies = [
"importlib_resources>=5.0; python_version < '3.10'",
"typing_extensions>=4.2",
"typing_extensions>=4.2; python_version < '3.11'", # used for typing.Unpack
"qiskit[qasm3-import]>=1.0.0",
]
dynamic = ["version"]
Expand Down Expand Up @@ -226,6 +226,7 @@ ignore = [
"PT004", # Incorrect, just usefixtures instead.
"S101", # Use of assert detected
]
typing-modules = ["mqt.qcec._compat.typing"]
isort.required-imports = ["from __future__ import annotations"]

[tool.ruff.lint.flake8-tidy-imports.banned-api]
Expand Down
16 changes: 16 additions & 0 deletions src/mqt/qcec/_compat/typing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# noqa: A005
from __future__ import annotations

import sys

if sys.version_info < (3, 11):
from typing_extensions import Unpack

else:
from typing import Unpack

__all__ = ["Unpack"]


def __dir__() -> list[str]:
return __all__
2 changes: 1 addition & 1 deletion src/mqt/qcec/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

if TYPE_CHECKING:
from qiskit import QuantumCircuit
from typing_extensions import Unpack

from ._compat.typing import Unpack
from .configuration import ConfigurationOptions

from . import Configuration, EquivalenceCheckingManager
Expand Down
3 changes: 1 addition & 2 deletions src/mqt/qcec/verify_compilation_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from typing_extensions import Unpack

from ._compat.typing import Unpack
from .configuration import ConfigurationOptions

from qiskit import QuantumCircuit
Expand Down
Loading