Skip to content

Commit 457158e

Browse files
authored
Fix the CI (#13)
1 parent 7496bbc commit 457158e

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ lint.preview = true
8686
format.preview = true
8787
format.docstring-code-format = true
8888
format.docstring-code-line-length = 100
89-
[tool.ruff.per-file-ignores]
89+
[tool.ruff.lint.per-file-ignores]
9090
"tests/**/*.py" = [
9191
"S101", # asserts allowed in tests
9292
"FBT", # don't care about booleans as positional arguments in tests

src/py_discovery/_info.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def abs_path(v: str | None) -> str | None:
133133
k: v for k, v in ([("makefile_filename", makefile())] if makefile is not None else []) if k is not None
134134
}
135135

136-
config_var_keys = set()
136+
config_var_keys: set[str] = set()
137137
for element in self.sysconfig_paths.values():
138138
config_var_keys.update(k[1:-1] for k in _CONF_VAR_RE.findall(element))
139139
config_var_keys.add("PYTHONFRAMEWORK")
@@ -607,7 +607,9 @@ def _gen_cookie() -> str:
607607
return "".join(choice(f"{ascii_lowercase}{ascii_uppercase}{digits}") for _ in range(_COOKIE_LENGTH)) # noqa: S311
608608

609609

610-
def _run_subprocess(cls: type[PythonInfo], exe: str, env: MutableMapping[str, str]) -> PythonInfo | RuntimeError:
610+
def _run_subprocess( # noqa: PLR0914
611+
cls: type[PythonInfo], exe: str, env: MutableMapping[str, str]
612+
) -> PythonInfo | RuntimeError:
611613
py_info_script = Path(os.path.abspath(__file__)).parent / "_info.py" # noqa: PTH100
612614
# Cookies allow splitting the serialized stdout output generated by the script collecting the info from the output
613615
# generated by something else.
@@ -665,7 +667,9 @@ def _run_subprocess(cls: type[PythonInfo], exe: str, env: MutableMapping[str, st
665667
result.executable = exe # keep the original executable as this may contain initialization code
666668
return result
667669

668-
msg = f"{exe} with code {code}{f' out: {out!r}' if out else ''}{f" err: {err!r}" if err else ''}"
670+
err_str = f" err: {err!r}" if err else ""
671+
out_str = f" out: {out!r}" if out else ""
672+
msg = f"{exe} with code {code}{out_str}{err_str}"
669673
return RuntimeError(f"failed to query {msg}")
670674

671675

0 commit comments

Comments
 (0)