Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changes/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Bugfixes

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

## Refactorings

Expand Down
2 changes: 1 addition & 1 deletion exasol/toolbox/nox/_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def _parse_args(session) -> argparse.Namespace:
def run(self, session: Session) -> None:
args = self._parse_args(session)

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

audit_json = self._filter_json_for_vulnerabilities(output.stdout)
Expand Down
4 changes: 2 additions & 2 deletions exasol/toolbox/nox/_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def _code_format(session: Session, mode: Mode, files: Iterable[str]) -> None:
def command(*args: str) -> Iterable[str]:
return args if mode == Mode.Fix else list(args) + ["--check"]

session.run(*command("poetry", "run", "isort"), *files)
session.run(*command("poetry", "run", "black"), *files)
session.run(*command("isort"), *files)
session.run(*command("black"), *files)


def _pyupgrade(session: Session, files: Iterable[str]) -> None:
Expand Down
2 changes: 1 addition & 1 deletion exasol/toolbox/nox/_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def _security_lint(session: Session, files: Iterable[str]) -> None:


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


class Dependencies:
Expand Down
2 changes: 1 addition & 1 deletion exasol/toolbox/nox/_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _deny_filter(files: Iterable[Path], deny_list: Iterable[str]) -> Iterable[Pa


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

Expand Down
5 changes: 2 additions & 3 deletions exasol/toolbox/nox/_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@
def _test_command(
path: Path, config: Config, context: MutableMapping[str, Any]
) -> Iterable[str]:
base_command = ["poetry", "run"]
coverage_command = (
["coverage", "run", "-a", f"--rcfile={config.root / 'pyproject.toml'}", "-m"]
if context["coverage"]
else []
)
pytest_command = ["pytest", "-v", f"{path}"]
return base_command + coverage_command + pytest_command + context["fwd-args"]
return coverage_command + pytest_command + context["fwd-args"]


def _unit_tests(
Expand Down Expand Up @@ -67,7 +66,7 @@ def _pass(
def _coverage(
session: Session, config: Config, context: MutableMapping[str, Any]
) -> None:
command = ["poetry", "run", "coverage", "report", "-m"]
command = ["coverage", "report", "-m"]
coverage_file = config.root / ".coverage"
coverage_file.unlink(missing_ok=True)
_unit_tests(session, config, context)
Expand Down