nmk-python 1.13.0__py3-none-any.whl → 2.0.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/backends/factory.py +1 -2
- nmk_python/build.py +3 -31
- nmk_python/build.yml +1 -17
- nmk_python/version.yml +2 -2
- {nmk_python-1.13.0.dist-info → nmk_python-2.0.0.dist-info}/METADATA +4 -4
- {nmk_python-1.13.0.dist-info → nmk_python-2.0.0.dist-info}/RECORD +10 -11
- {nmk_python-1.13.0.dist-info → nmk_python-2.0.0.dist-info}/WHEEL +1 -1
- nmk_python/backends/pip_build_backend.py +0 -53
- {nmk_python-1.13.0.dist-info → nmk_python-2.0.0.dist-info}/entry_points.txt +0 -0
- {nmk_python-1.13.0.dist-info → nmk_python-2.0.0.dist-info}/licenses/LICENSE +0 -0
- {nmk_python-1.13.0.dist-info → nmk_python-2.0.0.dist-info}/top_level.txt +0 -0
nmk_python/backends/factory.py
CHANGED
|
@@ -5,11 +5,10 @@ Build backend factory definition module
|
|
|
5
5
|
from nmk.model.model import NmkModel
|
|
6
6
|
|
|
7
7
|
from .build_backend import PythonBuildBackend
|
|
8
|
-
from .pip_build_backend import PipBuildBackend
|
|
9
8
|
from .uv_build_backend import UvBuildBackend
|
|
10
9
|
|
|
11
10
|
# Supported backends mapping
|
|
12
|
-
_SUPPORTED_BACKENDS = {"
|
|
11
|
+
_SUPPORTED_BACKENDS = {"uv": UvBuildBackend}
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
class BuildBackendFactory:
|
nmk_python/build.py
CHANGED
|
@@ -139,13 +139,12 @@ class Installer(NmkTaskBuilder):
|
|
|
139
139
|
Install built wheel in venv
|
|
140
140
|
"""
|
|
141
141
|
|
|
142
|
-
def build(self, name: str, wheel: str,
|
|
142
|
+
def build(self, name: str, wheel: str, to_remove: str = ""): # pyright: ignore[reportIncompatibleMethodOverride]
|
|
143
143
|
"""
|
|
144
144
|
Install wheel in venv
|
|
145
145
|
|
|
146
146
|
:param name: wheel name to be installed
|
|
147
147
|
:param wheel: wheel path to be installed
|
|
148
|
-
:param pip_args: pip command line arguments; deprecated, not used anymore
|
|
149
148
|
:param to_remove: stamp file to be removed
|
|
150
149
|
"""
|
|
151
150
|
|
|
@@ -166,7 +165,7 @@ class Uninstaller(NmkTaskBuilder):
|
|
|
166
165
|
Uninstall current project wheel from venv
|
|
167
166
|
"""
|
|
168
167
|
|
|
169
|
-
def build(self, name: str, local_deps: list[str] | None = None
|
|
168
|
+
def build(self, name: str, local_deps: list[str] | None = None): # pyright: ignore[reportIncompatibleMethodOverride]
|
|
170
169
|
"""
|
|
171
170
|
Uninstall wheel from venv
|
|
172
171
|
|
|
@@ -174,17 +173,8 @@ class Uninstaller(NmkTaskBuilder):
|
|
|
174
173
|
|
|
175
174
|
:param name: wheel name to be uninstalled
|
|
176
175
|
:param local_deps: list of workspace local dependencies patterns, used to find additional wheels to uninstall
|
|
177
|
-
:param lock_files: list of paths to lock files to be cleaned
|
|
178
176
|
"""
|
|
179
177
|
|
|
180
|
-
# Clean lock files, if required and present
|
|
181
|
-
project_root = self.model.env_backend.project_path
|
|
182
|
-
for lock_file_path in filter(
|
|
183
|
-
lambda p: p.is_file(), map(lambda p: p if p.is_absolute() else project_root / p, map(Path, lock_files if lock_files else []))
|
|
184
|
-
):
|
|
185
|
-
self.logger.debug(f"Removing lock file: {lock_file_path}")
|
|
186
|
-
lock_file_path.unlink()
|
|
187
|
-
|
|
188
178
|
# Find local deps to uninstall, from provided packages
|
|
189
179
|
wheel_names = set([name])
|
|
190
180
|
eb = cast(EnvBackend, self.model.env_backend) # type: ignore
|
|
@@ -204,11 +194,9 @@ class EditableBuilder(NmkTaskBuilder):
|
|
|
204
194
|
Install python project in editable mode
|
|
205
195
|
"""
|
|
206
196
|
|
|
207
|
-
def build(self
|
|
197
|
+
def build(self):
|
|
208
198
|
"""
|
|
209
199
|
Install project in venv as editable package
|
|
210
|
-
|
|
211
|
-
:param pip_args: pip command line arguments; deprecated, not used anymore
|
|
212
200
|
"""
|
|
213
201
|
|
|
214
202
|
# Check if project can be installed in editable mode
|
|
@@ -381,22 +369,6 @@ class DepsMetadataBuilder(NmkTaskBuilder):
|
|
|
381
369
|
assert (errors == 0) or not fail_on_error, f"{errors} error(s) found while checking dependencies vs constraints"
|
|
382
370
|
|
|
383
371
|
|
|
384
|
-
class PythonIgnoredLockfileResolver(NmkListConfigResolver):
|
|
385
|
-
"""
|
|
386
|
-
Python ignored lockfile resolver
|
|
387
|
-
"""
|
|
388
|
-
|
|
389
|
-
def get_value(self, name: str) -> list[str]: # pyright: ignore[reportIncompatibleMethodOverride]
|
|
390
|
-
"""
|
|
391
|
-
Return the list of lockfiles to be ignored, depending on the env backend and if the project is locked or not
|
|
392
|
-
"""
|
|
393
|
-
|
|
394
|
-
# Ignore uv.lock file if using uv env backend and project is not locked
|
|
395
|
-
if not self.model.env_backend.is_locked and self.model.env_backend.name == "uv":
|
|
396
|
-
return ["uv.lock"]
|
|
397
|
-
return [] # pragma: no cover
|
|
398
|
-
|
|
399
|
-
|
|
400
372
|
class PythonMergedConstraintsResolver(NmkListConfigResolver):
|
|
401
373
|
"""
|
|
402
374
|
Python merged constraints resolver
|
nmk_python/build.yml
CHANGED
|
@@ -59,37 +59,22 @@ config:
|
|
|
59
59
|
# Python editable install stamp
|
|
60
60
|
pythonEditableStamp: ${outputDir}/.pyeditable
|
|
61
61
|
|
|
62
|
-
# Python ignored lockfile, depending on the env backend and if the project is locked or not
|
|
63
|
-
pythonIgnoredLockfile:
|
|
64
|
-
__resolver__: nmk_python.build.PythonIgnoredLockfileResolver
|
|
65
|
-
|
|
66
62
|
# Python files to be ignored
|
|
67
63
|
gitIgnoredFiles:
|
|
68
64
|
- .eggs/
|
|
69
65
|
- "*.egg-info/"
|
|
70
66
|
- "*.pyc"
|
|
71
67
|
- __pycache__
|
|
72
|
-
- ${pythonIgnoredLockfile}
|
|
73
68
|
|
|
74
69
|
# Additional github publish step: publish on pypi.org
|
|
75
70
|
githubPublishSteps:
|
|
76
71
|
- name: Publish package on pypi.org
|
|
77
|
-
uses: pypa/gh-action-pypi-publish@v1.
|
|
72
|
+
uses: pypa/gh-action-pypi-publish@v1.14.3
|
|
78
73
|
with:
|
|
79
74
|
user: __token__
|
|
80
75
|
password: ${{ secrets.pypi_password }}
|
|
81
76
|
packages_dir: ${r!pythonBuildDir}/wheel_dist
|
|
82
77
|
|
|
83
|
-
# Wheel install arguments (for pip backend)
|
|
84
|
-
pythonWheelPipInstallArgs:
|
|
85
|
-
- --force-reinstall # force reinstall because otherwise install will be skipped if version didn't changed
|
|
86
|
-
- --no-deps # but skip dependencies to avoid reinstalling everything (deps are already installed by py.venv task)
|
|
87
|
-
|
|
88
|
-
# Editable install arguments (for pip backend)
|
|
89
|
-
pythonEditablePipInstallArgs:
|
|
90
|
-
- --no-deps # skip dependencies to avoid reinstalling everything
|
|
91
|
-
- --no-build-isolation # disable dependencies install when building for "editable" mode
|
|
92
|
-
|
|
93
78
|
# Wheel install arguments (for uv backend)
|
|
94
79
|
pythonWheelUvInstallArgs: []
|
|
95
80
|
|
|
@@ -212,5 +197,4 @@ tasks:
|
|
|
212
197
|
params:
|
|
213
198
|
name: ${pythonPackage}
|
|
214
199
|
local_deps: ${pythonLocalDepsPatterns}
|
|
215
|
-
lock_files: ${pythonIgnoredLockfile}
|
|
216
200
|
if: ${pythonSrcFiles} # Only if python source files are found
|
nmk_python/version.yml
CHANGED
|
@@ -17,8 +17,8 @@ config:
|
|
|
17
17
|
pythonVersionStamp: ${outputDir}/.pythonversion
|
|
18
18
|
|
|
19
19
|
# Python supported versions range (min-max)
|
|
20
|
-
pythonMinVersion: "3.
|
|
21
|
-
pythonMaxVersion: "3.
|
|
20
|
+
pythonMinVersion: "3.11"
|
|
21
|
+
pythonMaxVersion: "3.15"
|
|
22
22
|
pythonSupportedVersions:
|
|
23
23
|
__resolver__: nmk_python.version.PythonSupportedVersionsResolver
|
|
24
24
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nmk-python
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: Python plugin for nmk build system
|
|
5
5
|
Author: The dynod project
|
|
6
6
|
Maintainer: The dynod project
|
|
@@ -8,12 +8,12 @@ License: MIT License
|
|
|
8
8
|
Project-URL: Homepage, https://github.com/dynod/nmk-python
|
|
9
9
|
Project-URL: Repository, https://github.com/dynod/nmk-python
|
|
10
10
|
Project-URL: Issues, https://github.com/dynod/nmk/issues?q=is%3Aopen+is%3Aissue+label%3Aplugin%3Apython
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.13
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
-
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
16
|
+
Requires-Python: >=3.11
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
License-File: LICENSE
|
|
19
19
|
Requires-Dist: nmk-base>=1.5.0
|
|
@@ -37,7 +37,7 @@ Python plugin for nmk build system
|
|
|
37
37
|
[](https://github.com/dynod/nmk-python/blob/main/LICENSE)
|
|
38
38
|
[](https://github.com/dynod/nmk-python/actions?query=branch%3Amain)
|
|
39
39
|
[](https://github.com/dynod/nmk/issues?q=is%3Aopen+is%3Aissue+label%3Aplugin%3Apython)
|
|
40
|
-
[](https://www.python.org/)
|
|
41
41
|
[](https://pypi.org/project/nmk-python/)
|
|
42
42
|
[](https://astral.sh/ruff)
|
|
43
43
|
[](https://app.codecov.io/gh/dynod/nmk-python)
|
|
@@ -1,7 +1,7 @@
|
|
|
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=
|
|
4
|
-
nmk_python/build.yml,sha256=
|
|
3
|
+
nmk_python/build.py,sha256=0wah9c6GHzhEo9sELn2fCTBzCO1H9uPiZUYFO_Ayo-M,16277
|
|
4
|
+
nmk_python/build.yml,sha256=db5NXEPIyvYEDCJboBtcNGabnLYNeD2y-l7MxVJmDoE,5764
|
|
5
5
|
nmk_python/doc.yml,sha256=12amAlYylH7JAHaqBIOoEZ_LrXY_bPNKuHrrwUkIj8w,932
|
|
6
6
|
nmk_python/files.py,sha256=K6Y-XKXuf8jh4x333Qgj6G1MyB-BgZ5Kd2-XCZhsfR4,2000
|
|
7
7
|
nmk_python/files.yml,sha256=jlp87gW9rTASUnsy7id7VWanaMUMN_py82bMa2adniM,813
|
|
@@ -12,13 +12,12 @@ nmk_python/ruff.yml,sha256=L3vSTLGI3ZP46D64VxenhF9Gz3lo5-J9cRwgKBrVl48,2732
|
|
|
12
12
|
nmk_python/tests.py,sha256=p2dl41eZW8cpUMOa2DXi3CN3iVQEnElC88Ke89PRyy8,1597
|
|
13
13
|
nmk_python/tests.yml,sha256=WwQPgVKztrWAn-JXdMdhYuu0DrnQSXgkwWNn8Nn7X0o,1636
|
|
14
14
|
nmk_python/version.py,sha256=ivSff_1l-u-rSACF91s58zX_EUzl0ate_JcX_l7dSQk,2739
|
|
15
|
-
nmk_python/version.yml,sha256=
|
|
15
|
+
nmk_python/version.yml,sha256=R8l1xXwMdU3JGlK0dpSH3mf7HYLmwETH0kdRUAcGgJ0,1159
|
|
16
16
|
nmk_python/_buildenv/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
nmk_python/_buildenv/template.py,sha256=-yugMcl93gcKfPKrLYTmIMOEIoNvVWGVnqkY3-z4JF8,3922
|
|
18
18
|
nmk_python/backends/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
19
|
nmk_python/backends/build_backend.py,sha256=WO0wZaxGdPna4K2yK7pNLtZX3cKf6atLLa00931N43Y,1400
|
|
20
|
-
nmk_python/backends/factory.py,sha256=
|
|
21
|
-
nmk_python/backends/pip_build_backend.py,sha256=4MGYghBeMjZhUlKTwE0svSHArYwOAaK1I6_gmeNnwaI,1698
|
|
20
|
+
nmk_python/backends/factory.py,sha256=hlR-CTE4wAoYBO1t2DQe_ISXv8rSMft8kKQSjeAKr5M,855
|
|
22
21
|
nmk_python/backends/uv_build_backend.py,sha256=gpM1L5FuJ5CF-OkRORnAbZHACPNhjkoO1sKZtdAhpf0,1671
|
|
23
22
|
nmk_python/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
23
|
nmk_python/templates/build.toml.jinja,sha256=D-RYPUGiqkYUKyQt_dP_tNFU-83eer7bnv57k4pMmIw,2137
|
|
@@ -30,9 +29,9 @@ nmk_python/templates/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
30
29
|
nmk_python/templates/src/__init__.py.jinja,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
30
|
nmk_python/templates/src/sample.py.jinja,sha256=OOTps7EjviwYFCIb5GpMHcidxhBY5NLQVlcFLqxuxNU,227
|
|
32
31
|
nmk_python/templates/src/test_sample.py.jinja,sha256=u-ShBoKDF3se9KvgQ1SzO4NwymjqNowwURF4Q1oR3wo,221
|
|
33
|
-
nmk_python-
|
|
34
|
-
nmk_python-
|
|
35
|
-
nmk_python-
|
|
36
|
-
nmk_python-
|
|
37
|
-
nmk_python-
|
|
38
|
-
nmk_python-
|
|
32
|
+
nmk_python-2.0.0.dist-info/licenses/LICENSE,sha256=PROo9EW7wP6jmSr_90OluItAsIB411b_CAqEBioMKpI,1074
|
|
33
|
+
nmk_python-2.0.0.dist-info/METADATA,sha256=aGsUG9vkfMt-WQA_VQaKmsoSJy8Wbxme3ymoXrIfg_U,3204
|
|
34
|
+
nmk_python-2.0.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
35
|
+
nmk_python-2.0.0.dist-info/entry_points.txt,sha256=QLXIIXl6wODHDnVkh7KuiLv_XzfFtNfdWwpxyB675ak,88
|
|
36
|
+
nmk_python-2.0.0.dist-info/top_level.txt,sha256=MCb5w_hoOZ0kk3Dajxrd9Pz6lZ3pyuS6TQCRA3vddTo,11
|
|
37
|
+
nmk_python-2.0.0.dist-info/RECORD,,
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Pip build backend module.
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
import sys
|
|
6
|
-
from pathlib import Path
|
|
7
|
-
from typing import cast
|
|
8
|
-
|
|
9
|
-
from nmk.utils import run_with_logs
|
|
10
|
-
|
|
11
|
-
from .build_backend import PythonBuildBackend
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class PipBuildBackend(PythonBuildBackend):
|
|
15
|
-
"""
|
|
16
|
-
Pip build backend implementation
|
|
17
|
-
|
|
18
|
-
:param model: NmkModel instance
|
|
19
|
-
"""
|
|
20
|
-
|
|
21
|
-
def install_editable(self):
|
|
22
|
-
# Prepare install args
|
|
23
|
-
install_args = ["install", "-e", "."]
|
|
24
|
-
|
|
25
|
-
# Add extra args from model config
|
|
26
|
-
install_args += cast(list[str], self._model.config["pythonEditablePipInstallArgs"].value)
|
|
27
|
-
|
|
28
|
-
# Delegate to subprocess
|
|
29
|
-
self._env_backend.subprocess(install_args, cwd=self._env_backend.project_path)
|
|
30
|
-
|
|
31
|
-
def install_wheel(self, wheel_path: Path):
|
|
32
|
-
# Prepare install args
|
|
33
|
-
install_args = ["install", str(wheel_path)]
|
|
34
|
-
|
|
35
|
-
# Add extra args from model config
|
|
36
|
-
install_args += cast(list[str], self._model.config["pythonWheelPipInstallArgs"].value)
|
|
37
|
-
|
|
38
|
-
# Delegate to subprocess
|
|
39
|
-
self._env_backend.subprocess(install_args, cwd=self._env_backend.project_path)
|
|
40
|
-
|
|
41
|
-
def build_wheel(self, build_dir: Path, built_wheel_name: str, wheel_version: str) -> Path:
|
|
42
|
-
# Delegate to build module
|
|
43
|
-
run_with_logs([sys.executable, "-m", "build", "--wheel", "--skip-dependency-check", "--no-isolation"], cwd=build_dir)
|
|
44
|
-
|
|
45
|
-
# Return built wheel path
|
|
46
|
-
return build_dir / "dist" / built_wheel_name
|
|
47
|
-
|
|
48
|
-
def uninstall_wheels(self, wheel_names: list[str]):
|
|
49
|
-
# Prepare uninstall args
|
|
50
|
-
uninstall_args = ["uninstall", "--yes"] + wheel_names
|
|
51
|
-
|
|
52
|
-
# Delegate to subprocess
|
|
53
|
-
self._env_backend.subprocess(uninstall_args, cwd=self._env_backend.project_path)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|