Skip to content

Commit 11ced0f

Browse files
authored
Remove unnecessary poetry run from internal PTB commands (#404)
1 parent 7a08471 commit 11ced0f

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

doc/changes/unreleased.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Bugfixes
44

55
* #397: Fixed handling empty coverage
6+
* #403: Removed unneeded `poetry run` from internal code of nox tasks
67

78
## Refactorings
89

exasol/toolbox/nox/_dependencies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def _parse_args(session) -> argparse.Namespace:
263263
def run(self, session: Session) -> None:
264264
args = self._parse_args(session)
265265

266-
command = ["poetry", "run", "pip-audit", "-f", "json"]
266+
command = ["pip-audit", "-f", "json"]
267267
output = subprocess.run(command, capture_output=True)
268268

269269
audit_json = self._filter_json_for_vulnerabilities(output.stdout)

exasol/toolbox/nox/_format.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def _code_format(session: Session, mode: Mode, files: Iterable[str]) -> None:
1717
def command(*args: str) -> Iterable[str]:
1818
return args if mode == Mode.Fix else list(args) + ["--check"]
1919

20-
session.run(*command("poetry", "run", "isort"), *files)
21-
session.run(*command("poetry", "run", "black"), *files)
20+
session.run(*command("isort"), *files)
21+
session.run(*command("black"), *files)
2222

2323

2424
def _pyupgrade(session: Session, files: Iterable[str]) -> None:

exasol/toolbox/nox/_lint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def _security_lint(session: Session, files: Iterable[str]) -> None:
7575

7676

7777
def _import_lint(session: Session, path: Path) -> None:
78-
session.run("poetry", "run", "lint-imports", "--config", path)
78+
session.run("lint-imports", "--config", path)
7979

8080

8181
class Dependencies:

exasol/toolbox/nox/_shared.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def _deny_filter(files: Iterable[Path], deny_list: Iterable[str]) -> Iterable[Pa
4747

4848

4949
def _version(session: Session, mode: Mode, version_file: Path) -> None:
50-
command = ["poetry", "run", "version-check"]
50+
command = ["version-check"]
5151
command = command if mode == Mode.Check else command + ["--fix"]
5252
session.run(*command, f"{version_file}")
5353

exasol/toolbox/nox/_test.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@
2121
def _test_command(
2222
path: Path, config: Config, context: MutableMapping[str, Any]
2323
) -> Iterable[str]:
24-
base_command = ["poetry", "run"]
2524
coverage_command = (
2625
["coverage", "run", "-a", f"--rcfile={config.root / 'pyproject.toml'}", "-m"]
2726
if context["coverage"]
2827
else []
2928
)
3029
pytest_command = ["pytest", "-v", f"{path}"]
31-
return base_command + coverage_command + pytest_command + context["fwd-args"]
30+
return coverage_command + pytest_command + context["fwd-args"]
3231

3332

3433
def _unit_tests(
@@ -67,7 +66,7 @@ def _pass(
6766
def _coverage(
6867
session: Session, config: Config, context: MutableMapping[str, Any]
6968
) -> None:
70-
command = ["poetry", "run", "coverage", "report", "-m"]
69+
command = ["coverage", "report", "-m"]
7170
coverage_file = config.root / ".coverage"
7271
coverage_file.unlink(missing_ok=True)
7372
_unit_tests(session, config, context)

0 commit comments

Comments
 (0)