nmk-python 1.8.3__py3-none-any.whl → 1.9.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nmk_python/tests.py +5 -3
- nmk_python/tests.yml +56 -53
- {nmk_python-1.8.3.dist-info → nmk_python-1.9.0.dist-info}/METADATA +1 -1
- {nmk_python-1.8.3.dist-info → nmk_python-1.9.0.dist-info}/RECORD +7 -7
- {nmk_python-1.8.3.dist-info → nmk_python-1.9.0.dist-info}/WHEEL +1 -1
- {nmk_python-1.8.3.dist-info → nmk_python-1.9.0.dist-info}/licenses/LICENSE +0 -0
- {nmk_python-1.8.3.dist-info → nmk_python-1.9.0.dist-info}/top_level.txt +0 -0
nmk_python/tests.py
CHANGED
|
@@ -5,6 +5,7 @@ Python tests builder
|
|
|
5
5
|
import shutil
|
|
6
6
|
import subprocess
|
|
7
7
|
import sys
|
|
8
|
+
from typing import cast
|
|
8
9
|
|
|
9
10
|
from nmk.model.builder import NmkTaskBuilder
|
|
10
11
|
from nmk.model.keys import NmkRootConfig
|
|
@@ -15,11 +16,12 @@ class PytestBuilder(NmkTaskBuilder):
|
|
|
15
16
|
Python tests builder
|
|
16
17
|
"""
|
|
17
18
|
|
|
18
|
-
def build(self, pytest_args: dict[str, str]):
|
|
19
|
+
def build(self, pytest_args: dict[str, str | bool], ignore_failures: bool = False): # type: ignore
|
|
19
20
|
"""
|
|
20
21
|
Invoke pytest with specified options
|
|
21
22
|
|
|
22
23
|
:param pytest_args: extra pytest command line args
|
|
24
|
+
:param ignore_failures: whether to ignore test failures
|
|
23
25
|
"""
|
|
24
26
|
|
|
25
27
|
# Clean outputs
|
|
@@ -30,7 +32,7 @@ class PytestBuilder(NmkTaskBuilder):
|
|
|
30
32
|
p.unlink()
|
|
31
33
|
|
|
32
34
|
# Compute extra args
|
|
33
|
-
args = []
|
|
35
|
+
args: list[str] = []
|
|
34
36
|
for opt_k, opt_v in pytest_args.items():
|
|
35
37
|
if isinstance(opt_v, bool):
|
|
36
38
|
if opt_v:
|
|
@@ -43,4 +45,4 @@ class PytestBuilder(NmkTaskBuilder):
|
|
|
43
45
|
# Invoke pytest
|
|
44
46
|
all_args = [sys.executable, "-m", "pytest"] + args
|
|
45
47
|
self.logger.debug(f"Running subprocess: {' '.join(all_args)}")
|
|
46
|
-
subprocess.run(all_args, check=
|
|
48
|
+
subprocess.run(all_args, check=not ignore_failures, cwd=cast(str, self.model.config[NmkRootConfig.PROJECT_DIR].value))
|
nmk_python/tests.yml
CHANGED
|
@@ -1,56 +1,59 @@
|
|
|
1
1
|
config:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
2
|
+
# Tests related project config
|
|
3
|
+
pythonProjectFileFragments:
|
|
4
|
+
- ${BASEDIR}/templates/pytest.toml.jinja
|
|
5
|
+
|
|
6
|
+
# Coverage outputs
|
|
7
|
+
pythonCoverageHtmlReport: ${outputDir}/coverage-report
|
|
8
|
+
pythonCoverageXmlReport: ${outputDir}/coverage.xml
|
|
9
|
+
pythonCoverageFile: ${outputDir}/.coverage
|
|
10
|
+
|
|
11
|
+
# Python test output folder
|
|
12
|
+
pythonTestOutput: ${outputDir}/tests
|
|
13
|
+
|
|
14
|
+
# Pytest extra args (not generated in project file)
|
|
15
|
+
pytestExtraArgs:
|
|
16
|
+
numprocesses: auto
|
|
17
|
+
cov-fail-under: 100
|
|
18
|
+
dist: loadgroup
|
|
19
|
+
show-capture: "no"
|
|
20
|
+
|
|
21
|
+
# Pytest failures ignore option
|
|
22
|
+
pytestIgnoreFailures: false
|
|
23
|
+
|
|
24
|
+
# Ignore pytest cache
|
|
25
|
+
gitIgnoredFiles:
|
|
26
|
+
- .pytest_cache/
|
|
27
|
+
|
|
28
|
+
# Additional github build step: upload coverage report on codecov
|
|
29
|
+
githubBuildSteps:
|
|
30
|
+
- name: Upload coverage information
|
|
31
|
+
uses: codecov/codecov-action@v4.3.1
|
|
32
|
+
with:
|
|
33
|
+
files: ${r!pythonCoverageXmlReport}
|
|
34
|
+
env:
|
|
35
|
+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
36
|
+
__if__: ${pythonFoundSrcFiles}
|
|
37
|
+
|
|
38
|
+
# Ignore test module from wheel build (+ submodules)
|
|
39
|
+
pythonBuildExcludedModules:
|
|
40
|
+
- ${pythonTestPackage}*
|
|
38
41
|
|
|
39
42
|
tasks:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
43
|
+
# Python tests (through pytest)
|
|
44
|
+
py.tests:
|
|
45
|
+
description: Run python tests
|
|
46
|
+
emoji: ":snake:.:crossed_fingers:"
|
|
47
|
+
deps:
|
|
48
|
+
- py.editable
|
|
49
|
+
appendToDeps: tests
|
|
50
|
+
output:
|
|
51
|
+
- ${pythonCoverageHtmlReport}
|
|
52
|
+
- ${pythonCoverageXmlReport}
|
|
53
|
+
- ${pythonCoverageFile}
|
|
54
|
+
- ${pythonTestOutput}
|
|
55
|
+
if: ${pythonTestSrcFiles} # Only if python test source files are found
|
|
56
|
+
builder: nmk_python.tests.PytestBuilder
|
|
57
|
+
params:
|
|
58
|
+
pytest_args: ${pytestExtraArgs}
|
|
59
|
+
ignore_failures: ${pytestIgnoreFailures}
|
|
@@ -9,8 +9,8 @@ nmk_python/plugin.yml,sha256=hi7osXyIwpHgJAsww5mhOA6emxhzgitDF8cOsvyY29Y,1068
|
|
|
9
9
|
nmk_python/project.yml,sha256=wBnB6KOglRvIpw1UHuXTYmuE_2BYGBzGWwIEbA5NDv8,985
|
|
10
10
|
nmk_python/ruff.py,sha256=TBmn5nFflcFRvjj36JtJGJ-GYHOK6XfhK9Jp-2dO5_E,1557
|
|
11
11
|
nmk_python/ruff.yml,sha256=FNmYjbv2l5vlqFXinY87LfgzpZ3PSiduB_xUiYw8aMw,3019
|
|
12
|
-
nmk_python/tests.py,sha256=
|
|
13
|
-
nmk_python/tests.yml,sha256=
|
|
12
|
+
nmk_python/tests.py,sha256=DLUqTYhMbRupD5iK-nMnEM0GbfPPYgOp1wKHa_OCL7I,1391
|
|
13
|
+
nmk_python/tests.yml,sha256=by_Ml1JXjgt1-J96AMp-6gwhISVFVylRZowUvaMkfpk,1636
|
|
14
14
|
nmk_python/version.py,sha256=fLpOWdujYwlJB7XhWaOGCTeg3gQaClk2YHoRkkW64dE,3109
|
|
15
15
|
nmk_python/version.yml,sha256=WpZyQ2mChmvA_6eVb_Yp6ZaFIkX6oINxWBhKgb8h4GE,833
|
|
16
16
|
nmk_python/backends/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -24,8 +24,8 @@ nmk_python/templates/pytest.toml.jinja,sha256=zQ3SRWnF23Omxm7zInE54j0l3OyjXSOn5p
|
|
|
24
24
|
nmk_python/templates/python-settings.json.jinja,sha256=jYXSy96cX9X9GIHoF7XiZDzd4P2GOlMisAVWW626WF4,749
|
|
25
25
|
nmk_python/templates/python-test-debug-launch.json.jinja,sha256=J_xju2EpHNXvgvqBxlf99p7g-ZMh3xE-_2r7o_57gpU,364
|
|
26
26
|
nmk_python/templates/ruff.toml.jinja,sha256=DTHe1ixK1SBY8d2xBCfkGz89HzjAoMO7Ogs12AY1i4Y,346
|
|
27
|
-
nmk_python-1.
|
|
28
|
-
nmk_python-1.
|
|
29
|
-
nmk_python-1.
|
|
30
|
-
nmk_python-1.
|
|
31
|
-
nmk_python-1.
|
|
27
|
+
nmk_python-1.9.0.dist-info/licenses/LICENSE,sha256=PROo9EW7wP6jmSr_90OluItAsIB411b_CAqEBioMKpI,1074
|
|
28
|
+
nmk_python-1.9.0.dist-info/METADATA,sha256=vyPJa9Sm1bSi_aEqOcLjpLKC9uRPoNE1iwlyjEZ3Yhc,3148
|
|
29
|
+
nmk_python-1.9.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
30
|
+
nmk_python-1.9.0.dist-info/top_level.txt,sha256=MCb5w_hoOZ0kk3Dajxrd9Pz6lZ3pyuS6TQCRA3vddTo,11
|
|
31
|
+
nmk_python-1.9.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|