Skip to content

Commit

Permalink
⬆️🪝 update pre-commit hooks (#326)
Browse files Browse the repository at this point in the history
<!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.1.3 →
v0.1.4](astral-sh/ruff-pre-commit@v0.1.3...v0.1.4)
- [github.com/pre-commit/mirrors-clang-format: v17.0.3 →
v17.0.4](pre-commit/mirrors-clang-format@v17.0.3...v17.0.4)
<!--pre-commit.ci end-->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Lukas Burgholzer <burgholzer@me.com>
  • Loading branch information
pre-commit-ci[bot] and burgholzer authored Nov 7, 2023
1 parent e45565d commit 3bca1f3
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ repos:

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

# Clang-format the C++ part of the code base automatically
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.3
rev: v17.0.4
hooks:
- id: clang-format
types_or: [c++, c, cuda]
Expand Down
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sphinx configuration file."""

from __future__ import annotations

import warnings
Expand Down
1 change: 1 addition & 0 deletions src/mqt/qcec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This file is part of the MQT QCEC library released under the MIT license.
See README.md or go to https://github.com/cda-tum/qcec for more information.
"""

from __future__ import annotations

from ._version import version as __version__
Expand Down
6 changes: 3 additions & 3 deletions src/mqt/qcec/pyqcec/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ApplicationScheme:
def __eq__(self, other: object) -> bool: ...
def __getstate__(self) -> int: ...
def __hash__(self) -> int: ...
def __index__(self) -> int: ... # noqa: PLW3201
def __index__(self) -> int: ...
def __int__(self) -> int: ...
def __ne__(self, other: object) -> bool: ...
def __setstate__(self, state: int) -> None: ...
Expand Down Expand Up @@ -150,7 +150,7 @@ class EquivalenceCriterion:
def __eq__(self, other: object) -> bool: ...
def __getstate__(self) -> int: ...
def __hash__(self) -> int: ...
def __index__(self) -> int: ... # noqa: PLW3201
def __index__(self) -> int: ...
def __int__(self) -> int: ...
def __ne__(self, other: object) -> bool: ...
def __setstate__(self, state: int) -> None: ...
Expand All @@ -171,7 +171,7 @@ class StateType:
def __eq__(self, other: object) -> bool: ...
def __getstate__(self) -> int: ...
def __hash__(self) -> int: ...
def __index__(self) -> int: ... # noqa: PLW3201
def __index__(self) -> int: ...
def __int__(self) -> int: ...
def __ne__(self, other: object) -> bool: ...
def __setstate__(self, state: int) -> None: ...
Expand Down
1 change: 1 addition & 0 deletions src/mqt/qcec/types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Types for the QCEC module."""

from __future__ import annotations

from typing import Literal
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 @@ -17,6 +17,7 @@
from importlib import resources

from qiskit import QuantumCircuit
from qiskit.transpiler.passes import ContainsInstruction

from . import ApplicationScheme, Configuration, EquivalenceCheckingManager
from .compilation_flow_profiles import AncillaMode, generate_profile_name
Expand All @@ -30,8 +31,6 @@ def __check_if_circuit_contains_measurements(circuit: QuantumCircuit) -> None:
Args:
circuit: The circuit to check.
"""
from qiskit.transpiler.passes import ContainsInstruction

analysis_pass = ContainsInstruction("measure")
analysis_pass(circuit)
if not analysis_pass.property_set["contains_measure"]:
Expand Down
4 changes: 2 additions & 2 deletions test/python/test_compilation_flow_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
else:
from importlib import resources

import difflib

import pytest

from mqt import qcec
Expand Down Expand Up @@ -61,8 +63,6 @@ def test_generated_profiles_are_still_valid(optimization_level: int, ancilla_mod
if equal:
return

import difflib

ref_profile = path.read_text().splitlines(keepends=True)
gen_profile = Path(profile_name).read_text().splitlines(keepends=True)
diff = difflib.unified_diff(ref_profile, gen_profile, fromfile="reference", tofile="generated", n=0)
Expand Down
4 changes: 2 additions & 2 deletions test/python/test_construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from __future__ import annotations

from pathlib import Path

import pytest
from qiskit import QuantumCircuit

Expand Down Expand Up @@ -29,8 +31,6 @@ def test_constructor_with_configuration(example_circuit: QuantumCircuit) -> None

def test_default_constructor_with_file(example_circuit: QuantumCircuit) -> None:
"""Test constructing an instance from two circuit files with all default arguments."""
from pathlib import Path

filename = "test.qasm"
example_circuit.qasm(filename=filename)
qcec.EquivalenceCheckingManager(circ1=filename, circ2=filename)
Expand Down
6 changes: 2 additions & 4 deletions test/python/test_verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from __future__ import annotations

import pytest
from qiskit import QuantumCircuit
from qiskit import QuantumCircuit, transpile
from qiskit.providers.fake_provider import FakeAthens

from mqt import qcec

Expand Down Expand Up @@ -67,9 +68,6 @@ def test_compiled_circuit_without_measurements() -> None:
It makes sure that circuits compiled without measurements are handled correctly.
"""
from qiskit import transpile
from qiskit.providers.fake_provider import FakeAthens

qc = QuantumCircuit(1)
qc.x(0)
qc_compiled = transpile(qc, backend=FakeAthens())
Expand Down

0 comments on commit 3bca1f3

Please sign in to comment.