Skip to content

Commit 80e0736

Browse files
committed
Fix to relative path from . for coverage.xml & session
1 parent 71a5ff4 commit 80e0736

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

exasol/toolbox/nox/_artifacts.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import re
33
import shutil
44
import sqlite3
5-
import subprocess
65
import sys
76
from collections.abc import Iterable
87
from pathlib import Path
@@ -173,12 +172,12 @@ def _copy_artifacts(source: Path, dest: Path, files: Iterable[str]):
173172
print(f"File not found {path}", file=sys.stderr)
174173

175174

176-
def _prepare_coverage_xml(source: Path) -> None:
175+
def _prepare_coverage_xml(session: Session, source: Path) -> None:
177176
command = ["coverage", "xml", "-o", COVERAGE_XML, "--include", f"{source}/*"]
178-
subprocess.run(command, check=True)
177+
session.run(*command)
179178

180179

181-
def _upload_to_sonar(sonar_token: str) -> None:
180+
def _upload_to_sonar(session: Session, sonar_token: str) -> None:
182181
command = [
183182
"pysonar",
184183
"--sonar-token",
@@ -190,12 +189,12 @@ def _upload_to_sonar(sonar_token: str) -> None:
190189
"--sonar-python-bandit-report-paths",
191190
SECURITY_JSON,
192191
]
193-
subprocess.run(command, check=True)
192+
session.run(*command)
194193

195194

196195
@nox.session(name="artifacts:sonar", python=False)
197196
def upload_artifacts_to_sonar(session: Session) -> None:
198197
"""Upload artifacts to sonar for analysis"""
199198
sonar_token = session.posargs[0]
200-
_prepare_coverage_xml(PROJECT_CONFIG.source)
201-
_upload_to_sonar(sonar_token)
199+
_prepare_coverage_xml(session, PROJECT_CONFIG.source)
200+
_upload_to_sonar(session, sonar_token)

noxconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class Config:
4343

4444
root: Path = Path(__file__).parent
4545
doc: Path = Path(__file__).parent / "doc"
46-
source: Path = Path(__file__).parent / "exasol" / "toolbox"
46+
source: Path = Path("exasol/toolbox")
4747
importlinter: Path = Path(__file__).parent / ".import_linter_config"
4848
version_file: Path = Path(__file__).parent / "exasol" / "toolbox" / "version.py"
4949
path_filters: Iterable[str] = (

project-template/{{cookiecutter.repo_name}}/noxconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
class Config:
1010
root: Path = Path(__file__).parent
1111
doc: Path = Path(__file__).parent / "doc"
12-
source: Path = Path(__file__).parent / "exasol"/ "{{cookiecutter.package_name}}"
12+
source: Path = Path("exasol/{{cookiecutter.package_name}}")
1313
version_file: Path = (
1414
Path(__file__).parent
1515
/ "exasol"

0 commit comments

Comments
 (0)