nmk-python 1.8.3__py3-none-any.whl → 1.9.1__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/build.py CHANGED
@@ -291,8 +291,8 @@ class DepsMetadataBuilder(NmkTaskBuilder):
291
291
  # Get requirement
292
292
  req = Requirement(dep)
293
293
 
294
- # Check marker, if any
295
- if req.marker is not None and not req.marker.evaluate():
294
+ # Check marker, if any (but not for root package dependencies, which are always included)
295
+ if (name != root_name) and (req.marker is not None) and (not req.marker.evaluate()):
296
296
  continue
297
297
 
298
298
  # Visit dependency if installed
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=True, cwd=self.model.config[NmkRootConfig.PROJECT_DIR].value)
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
- # 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
- # Ignore pytest cache
22
- gitIgnoredFiles:
23
- - .pytest_cache/
24
-
25
- # Additional github build step: upload coverage report on codecov
26
- githubBuildSteps:
27
- - name: Upload coverage information
28
- uses: codecov/codecov-action@v4.3.1
29
- with:
30
- files: ${r!pythonCoverageXmlReport}
31
- env:
32
- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
33
- __if__: ${pythonFoundSrcFiles}
34
-
35
- # Ignore test module from wheel build (+ submodules)
36
- pythonBuildExcludedModules:
37
- - ${pythonTestPackage}*
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
- # Python tests (through pytest)
42
- py.tests:
43
- description: Run python tests
44
- emoji: ":snake:.:crossed_fingers:"
45
- deps:
46
- - py.editable
47
- appendToDeps: tests
48
- output:
49
- - ${pythonCoverageHtmlReport}
50
- - ${pythonCoverageXmlReport}
51
- - ${pythonCoverageFile}
52
- - ${pythonTestOutput}
53
- if: ${pythonTestSrcFiles} # Only if python test source files are found
54
- builder: nmk_python.tests.PytestBuilder
55
- params:
56
- pytest_args: ${pytestExtraArgs}
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}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nmk-python
3
- Version: 1.8.3
3
+ Version: 1.9.1
4
4
  Summary: Python plugin for nmk build system
5
5
  Author: The dynod project
6
6
  Maintainer: The dynod project
@@ -1,6 +1,6 @@
1
1
  nmk_python/__init__.py,sha256=EouCWXbAeObby1vOCx0Vx_WaGC2fEEFDMCen3JZt4TU,446
2
2
  nmk_python/badges.yml,sha256=LzElZecCXKxdF-oPkvIwfnbQlOcAM_zUj6MelClmAug,749
3
- nmk_python/build.py,sha256=GUgc98HxqbAH_zYvuiJea49OZ2NTm653gBRAKa0j4Hg,12129
3
+ nmk_python/build.py,sha256=nBqyMcZXhOjnMBocUooL1rM9BJyPX42A6nGbwlB5dRg,12224
4
4
  nmk_python/build.yml,sha256=8CWVacVv3r3pbvuRkaLQbH1aTO-oK4U0hAO9SgDTfFA,5726
5
5
  nmk_python/doc.yml,sha256=12amAlYylH7JAHaqBIOoEZ_LrXY_bPNKuHrrwUkIj8w,932
6
6
  nmk_python/files.py,sha256=K6Y-XKXuf8jh4x333Qgj6G1MyB-BgZ5Kd2-XCZhsfR4,2000
@@ -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=8kRKP3dT2Thi5W5sCQSQOPXkV1D9C7tde3QYySo6G2c,1212
13
- nmk_python/tests.yml,sha256=Sg6ZezkBVuvOzh-4QbJmZQymCOzXfenc0EpMdMZsEBc,1687
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.8.3.dist-info/licenses/LICENSE,sha256=PROo9EW7wP6jmSr_90OluItAsIB411b_CAqEBioMKpI,1074
28
- nmk_python-1.8.3.dist-info/METADATA,sha256=lsZ68edK9lYcRKqsImt2AZt-DDFsw_hmTImCJhe_bhs,3148
29
- nmk_python-1.8.3.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
30
- nmk_python-1.8.3.dist-info/top_level.txt,sha256=MCb5w_hoOZ0kk3Dajxrd9Pz6lZ3pyuS6TQCRA3vddTo,11
31
- nmk_python-1.8.3.dist-info/RECORD,,
27
+ nmk_python-1.9.1.dist-info/licenses/LICENSE,sha256=PROo9EW7wP6jmSr_90OluItAsIB411b_CAqEBioMKpI,1074
28
+ nmk_python-1.9.1.dist-info/METADATA,sha256=FN-Sm5fDeJ-fKF_Zt5-EbN65960FG_EVnm-EwISt3B4,3148
29
+ nmk_python-1.9.1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
30
+ nmk_python-1.9.1.dist-info/top_level.txt,sha256=MCb5w_hoOZ0kk3Dajxrd9Pz6lZ3pyuS6TQCRA3vddTo,11
31
+ nmk_python-1.9.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (82.0.0)
2
+ Generator: setuptools (82.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5