nmk-python 0.15.0__py3-none-any.whl → 0.15.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/project.py CHANGED
@@ -3,7 +3,7 @@ Python project file builder
3
3
  """
4
4
 
5
5
  from pathlib import Path
6
- from typing import List
6
+ from typing import Any, List
7
7
 
8
8
  from nmk_base.common import TemplateBuilder
9
9
  from tomlkit import TOMLDocument, comment, loads
@@ -15,6 +15,16 @@ class PythonProjectBuilder(TemplateBuilder):
15
15
  Python project file builder
16
16
  """
17
17
 
18
+ # Handle relative path for all contributions
19
+ def _check_paths(self, value: Any):
20
+ if isinstance(value, str):
21
+ return self.relative_path(value)
22
+ if isinstance(value, list):
23
+ return list(map(self._check_paths, value))
24
+ if isinstance(value, dict):
25
+ return {k: self._check_paths(v) for k, v in value.items()}
26
+ return value
27
+
18
28
  def _contribute(self, main: dict, update: dict):
19
29
  """
20
30
  Merge items from **update** dictionary into **main** one.
@@ -33,16 +43,16 @@ class PythonProjectBuilder(TemplateBuilder):
33
43
  if k in main:
34
44
  # List: extend
35
45
  if isinstance(v, list):
36
- main[k].extend(v)
46
+ main[k].extend(self._check_paths(v))
37
47
  # Map: recursive contribution
38
48
  elif isinstance(v, dict):
39
49
  self._contribute(main[k], v)
40
50
  # Otherwise: replace
41
51
  else:
42
- main[k] = v
52
+ main[k] = self._check_paths(v)
43
53
  else:
44
54
  # New key
45
- main[k] = v
55
+ main[k] = self._check_paths(v)
46
56
 
47
57
  def build(self, fragment_files: List[str], items: dict):
48
58
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nmk-python
3
- Version: 0.15.0
3
+ Version: 0.15.1
4
4
  Summary: Python plugin for nmk build system
5
5
  Author: The dynod project
6
6
  Maintainer: The dynod project
@@ -6,7 +6,7 @@ nmk_python/doc.yml,sha256=12amAlYylH7JAHaqBIOoEZ_LrXY_bPNKuHrrwUkIj8w,932
6
6
  nmk_python/files.py,sha256=T2-MBoc-KEmnhCC78IbGsi6Q-ntk_IcOtWVylLEhSAc,1887
7
7
  nmk_python/files.yml,sha256=-vGjogdulwsfdKVEUa5RARYDKxF3m9RmHKFnIhaT3_k,780
8
8
  nmk_python/plugin.yml,sha256=hi7osXyIwpHgJAsww5mhOA6emxhzgitDF8cOsvyY29Y,1068
9
- nmk_python/project.py,sha256=GvFoJfyUv8G565gAHvTeoIHEz5SR5MxnIBOOnulh_nY,2612
9
+ nmk_python/project.py,sha256=83E9tYv3DpKlF-tens7iNfWcj08v2QBxzBWJwuLHTCk,3063
10
10
  nmk_python/project.yml,sha256=Uq8yKoqOgY2sIQweUJhrLALLFuc76uNmUZsz7hrb9pI,947
11
11
  nmk_python/ruff.py,sha256=T0o9i_ZZosJDWRuLNkgYIzL9mb_KmNMsmQ1kDq08gBU,1082
12
12
  nmk_python/ruff.yml,sha256=VIlH52dc4m-dgsm-SFuD4-AK6knke1-GuJSJQvVsXWE,1863
@@ -20,8 +20,8 @@ nmk_python/templates/pytest.toml.jinja,sha256=zQ3SRWnF23Omxm7zInE54j0l3OyjXSOn5p
20
20
  nmk_python/templates/python-settings.json.jinja,sha256=-6J1tybWEzChxlDqu4tp9BMWxbYD8HpztGs9G8LkC_w,877
21
21
  nmk_python/templates/python-test-debug-launch.json.jinja,sha256=J_xju2EpHNXvgvqBxlf99p7g-ZMh3xE-_2r7o_57gpU,364
22
22
  nmk_python/templates/ruff.toml.jinja,sha256=DTHe1ixK1SBY8d2xBCfkGz89HzjAoMO7Ogs12AY1i4Y,346
23
- nmk_python-0.15.0.dist-info/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
24
- nmk_python-0.15.0.dist-info/METADATA,sha256=fLeDmZBvEeeUciDAVZ1iYKzv_JQZjYC2zDnJhyO3KDc,2790
25
- nmk_python-0.15.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
26
- nmk_python-0.15.0.dist-info/top_level.txt,sha256=MCb5w_hoOZ0kk3Dajxrd9Pz6lZ3pyuS6TQCRA3vddTo,11
27
- nmk_python-0.15.0.dist-info/RECORD,,
23
+ nmk_python-0.15.1.dist-info/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
24
+ nmk_python-0.15.1.dist-info/METADATA,sha256=H4nqMsSwdZLASMcnB-TYIXZzekRoT6XnBq1cQP7WOH4,2790
25
+ nmk_python-0.15.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
26
+ nmk_python-0.15.1.dist-info/top_level.txt,sha256=MCb5w_hoOZ0kk3Dajxrd9Pz6lZ3pyuS6TQCRA3vddTo,11
27
+ nmk_python-0.15.1.dist-info/RECORD,,