diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 77786332..621ad6e9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -57,7 +57,7 @@ repos: # Python linting and formatting using ruff - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.4 + rev: v0.8.2 hooks: - id: ruff args: ["--fix", "--show-fixes"] @@ -140,6 +140,6 @@ repos: # Check the pyproject.toml file - repo: https://github.com/henryiii/validate-pyproject-schema-store - rev: 2024.09.23 + rev: 2024.11.25 hooks: - id: validate-pyproject diff --git a/noxfile.py b/noxfile.py index 70dfbc29..988979b0 100644 --- a/noxfile.py +++ b/noxfile.py @@ -61,13 +61,13 @@ def _run_tests( if shutil.which("ninja") is None: session.install("ninja") - _extras = ["test", *extras] + extras_ = ["test", *extras] if "--cov" in posargs: - _extras.append("coverage") + extras_.append("coverage") posargs.append("--cov-config=pyproject.toml") session.install(*BUILD_REQUIREMENTS, *install_args, env=env) - install_arg = f"-ve.[{','.join(_extras)}]" + install_arg = f"-ve.[{','.join(extras_)}]" session.install("--no-build-isolation", install_arg, *install_args, env=env) session.run("pytest", *run_args, *posargs, env=env) diff --git a/pyproject.toml b/pyproject.toml index 80cfdec2..ca553c1e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -221,20 +221,17 @@ extend-select = [ "SLOT", # flake8-slots "SIM", # flake8-simplify "T20", # flake8-print - "TCH", # flake8-type-checking + "TC", # flake8-type-checking "TID", # flake8-tidy-imports "TRY", # tryceratops "UP", # pyupgrade "YTT", # flake8-2020 ] ignore = [ - "ANN101", # Missing type annotation for `self` in method - "ANN102", # Missing type annotation for `cls` in classmethod "ISC001", # Conflicts with formatter "PLR09", # Too many <...> "PLR2004", # Magic value used in comparison "PLC0415", # Import should be at top of file - "PT004", # Incorrect, just usefixtures instead. "S101", # Use of assert detected ] typing-modules = ["mqt.qcec._compat.typing"] diff --git a/test/python/test_compilation_flow_profiles.py b/test/python/test_compilation_flow_profiles.py index 4a8eb69e..cb49547f 100644 --- a/test/python/test_compilation_flow_profiles.py +++ b/test/python/test_compilation_flow_profiles.py @@ -20,13 +20,13 @@ @pytest.fixture(params=[0, 1, 2, 3]) def optimization_level(request: Any) -> int: # noqa: ANN401 """Fixture for optimization levels.""" - return cast(int, request.param) + return cast("int", request.param) @pytest.fixture(params=[qcec.AncillaMode.NO_ANCILLA, qcec.AncillaMode.RECURSION, qcec.AncillaMode.V_CHAIN]) def ancilla_mode(request: Any) -> qcec.AncillaMode: # noqa: ANN401 """Fixture for ancilla modes.""" - return cast(qcec.AncillaMode, request.param) + return cast("qcec.AncillaMode", request.param) def test_ancilla_mode_conversion(ancilla_mode: qcec.AncillaMode) -> None: