nmk-python 0.17.0__py3-none-any.whl → 0.17.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
@@ -4,6 +4,7 @@ Python package build module
4
4
 
5
5
  import shutil
6
6
  import sys
7
+ from logging import Logger
7
8
  from pathlib import Path
8
9
 
9
10
  from nmk.model.builder import NmkTaskBuilder
@@ -15,6 +16,15 @@ from tomlkit import loads
15
16
  from tomlkit.toml_file import TOMLFile
16
17
 
17
18
 
19
+ # Install filter for Windows
20
+ def _can_install(name: str, logger: Logger) -> bool:
21
+ # On Windows, refuse to install nmk package while running nmk (wont' work)
22
+ if is_windows() and name == "nmk":
23
+ logger.warning("Can't install nmk while running nmk!")
24
+ return False
25
+ return True
26
+
27
+
18
28
  class PackageBuilder(NmkTaskBuilder):
19
29
  """
20
30
  Python package builder
@@ -120,14 +130,13 @@ class Installer(VenvUpdateBuilder):
120
130
  :param to_remove: stamp file to be removed
121
131
  """
122
132
 
123
- # On Windows, refuse to install nmk package while running nmk (wont' work)
124
- if is_windows() and name == "nmk":
125
- self.logger.warning("Can't install nmk while running nmk!")
126
- else:
133
+ # Check if wheel can be installed
134
+ if _can_install(name, self.logger):
135
+ # Install wheel in current venv
127
136
  super().build(pip_args)
128
137
 
129
- # Remove stamp file
130
- Path(to_remove).unlink(missing_ok=True)
138
+ # Remove stamp file
139
+ Path(to_remove).unlink(missing_ok=True)
131
140
 
132
141
 
133
142
  class Uninstaller(NmkTaskBuilder):
@@ -160,8 +169,10 @@ class EditableBuilder(NmkTaskBuilder):
160
169
  :param pip_args: pip command line arguments
161
170
  """
162
171
 
163
- # Delegate to pip
164
- run_pip(["install", "-e", "."], logger=self.logger, extra_args=pip_args)
172
+ # Check if project can be installed in editable mode
173
+ if _can_install(self.model.config["pythonPackage"].value, self.logger):
174
+ # Delegate to pip
175
+ run_pip(["install", "-e", "."], logger=self.logger, extra_args=pip_args)
165
176
 
166
- # Touch stamp file
167
- self.main_output.touch()
177
+ # Touch stamp file
178
+ self.main_output.touch()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nmk-python
3
- Version: 0.17.0
3
+ Version: 0.17.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=O7BLqbxKtvjVbMb9cr45ViOoRRcp_9p5Nd8DwViMiTI,5863
3
+ nmk_python/build.py,sha256=uTOaj-iPOrJdoynXqdnN-2OlXXas_S45YjgIaC_n2Ok,6275
4
4
  nmk_python/build.yml,sha256=miakmtxwHhtFXK257saotRhtgjGbKhq8F3OPAADZ6EA,4011
5
5
  nmk_python/doc.yml,sha256=12amAlYylH7JAHaqBIOoEZ_LrXY_bPNKuHrrwUkIj8w,932
6
6
  nmk_python/files.py,sha256=gtPf6ldR5F4oGsAdzFnEIbI9MqqvF3z5JQnyONZmLmk,1863
@@ -19,8 +19,8 @@ nmk_python/templates/pytest.toml.jinja,sha256=zQ3SRWnF23Omxm7zInE54j0l3OyjXSOn5p
19
19
  nmk_python/templates/python-settings.json.jinja,sha256=-6J1tybWEzChxlDqu4tp9BMWxbYD8HpztGs9G8LkC_w,877
20
20
  nmk_python/templates/python-test-debug-launch.json.jinja,sha256=J_xju2EpHNXvgvqBxlf99p7g-ZMh3xE-_2r7o_57gpU,364
21
21
  nmk_python/templates/ruff.toml.jinja,sha256=DTHe1ixK1SBY8d2xBCfkGz89HzjAoMO7Ogs12AY1i4Y,346
22
- nmk_python-0.17.0.dist-info/LICENSE,sha256=PROo9EW7wP6jmSr_90OluItAsIB411b_CAqEBioMKpI,1074
23
- nmk_python-0.17.0.dist-info/METADATA,sha256=Mhi9Uk_UPU7kc7HlvdBtoe_TQa814aJ3uac-YiWCXJA,2947
24
- nmk_python-0.17.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
25
- nmk_python-0.17.0.dist-info/top_level.txt,sha256=MCb5w_hoOZ0kk3Dajxrd9Pz6lZ3pyuS6TQCRA3vddTo,11
26
- nmk_python-0.17.0.dist-info/RECORD,,
22
+ nmk_python-0.17.1.dist-info/LICENSE,sha256=PROo9EW7wP6jmSr_90OluItAsIB411b_CAqEBioMKpI,1074
23
+ nmk_python-0.17.1.dist-info/METADATA,sha256=qIfnrB8msgjFhdqaGbeLq_aj74iwf6JNUL55ZJercrg,2947
24
+ nmk_python-0.17.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
25
+ nmk_python-0.17.1.dist-info/top_level.txt,sha256=MCb5w_hoOZ0kk3Dajxrd9Pz6lZ3pyuS6TQCRA3vddTo,11
26
+ nmk_python-0.17.1.dist-info/RECORD,,