Skip to content

Commit

Permalink
fix ruff issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cqc-melf committed Jan 10, 2025
1 parent 93ee5c3 commit 47faaa7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions python/hugr_qir/tests/test_guppy_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
GUPPY_EXAMPLES_DIR = Path(__file__).parent / "../../../guppy_examples/"


def guppy_to_hugr_json_file(guppy_file, outfd) -> None:
subprocess.run(
def guppy_to_hugr_json_file(guppy_file: str, outfd: bytes) -> None:
subprocess.run( # noqa: S603
[sys.executable, GUPPY_EXAMPLES_DIR / guppy_file],
check=True,
stdout=outfd,
text=True,
)


def cli_on_guppy(guppy_file, tmp_path, *args) -> None:
def cli_on_guppy(guppy_file: str, tmp_path: Path, *args: dict) -> None:
guppy_file = Path(guppy_file)
json_file = tmp_path / Path(f"{guppy_file.name}.json")
with open(json_file, "w") as f:
with Path.open(json_file, "w") as f:
guppy_to_hugr_json_file(guppy_file, f)
cli(str(json_file), *[str(arg) for arg in args])


def test_guppy_planqc_q(tmp_path) -> None:
def test_guppy_planqc_q(tmp_path: Path) -> None:
out_file = tmp_path / "out.ll"
cli_on_guppy("planqc_1.py", tmp_path, "-o", out_file)
3 changes: 2 additions & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ lint.select = [
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420
# "INP", # flake8-no-pep420
"INT", # flake8-gettext
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
Expand Down Expand Up @@ -63,3 +63,4 @@ convention = "google"

[lint.per-file-ignores]
"guppy_examples/*" = ["INP"]

0 comments on commit 47faaa7

Please sign in to comment.