nmk-python 0.13.4__py3-none-any.whl → 0.14.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/build.py CHANGED
@@ -8,10 +8,10 @@ from nmk_base.venvbuilder import VenvUpdateBuilder
8
8
 
9
9
 
10
10
  class PackageBuilder(NmkTaskBuilder):
11
- def build(self, setup: str, artifacts: str):
11
+ def build(self, artifacts: str, build_dir: str):
12
12
  # Delegate to setup
13
13
  run_with_logs(
14
- [sys.executable, setup, "sdist", "-d", artifacts, "bdist_wheel", "-d", artifacts],
14
+ [sys.executable, "-c", "from setuptools import setup; setup()", "build", "-b", build_dir, "bdist_wheel", "-d", artifacts],
15
15
  self.logger,
16
16
  cwd=self.model.config[NmkRootConfig.PROJECT_DIR].value,
17
17
  )
nmk_python/build.yml CHANGED
@@ -8,6 +8,9 @@ config:
8
8
  # Python artifacts directory
9
9
  pythonArtifacts: ${outputDir}/artifacts
10
10
 
11
+ # Python build directory
12
+ pythonBuildDir: ${outputDir}/python
13
+
11
14
  # Python source distribution + wheel artifacts
12
15
  pythonDist: ${pythonArtifacts}/${pythonPackage}-${pythonVersion}.tar.gz
13
16
  pythonWheel: ${pythonArtifacts}/${pythonPackageForWheel}-${pythonVersion}-py3-none-any.whl
@@ -29,7 +32,6 @@ config:
29
32
  - "*.egg-info/"
30
33
  - "*.pyc"
31
34
  - __pycache__
32
- - build/
33
35
 
34
36
  # Additional github publish step: publish on pypi.org
35
37
  githubPublishSteps:
@@ -59,8 +61,8 @@ tasks:
59
61
  - ${pythonSetupCfg}
60
62
  builder: nmk_python.build.PackageBuilder
61
63
  params:
62
- setup: ${pythonSetupPy}
63
64
  artifacts: ${pythonArtifacts}
65
+ build_dir: ${pythonBuildDir}
64
66
 
65
67
  # Python module install
66
68
  py.install:
nmk_python/setup.py CHANGED
@@ -1,4 +1,4 @@
1
- import shutil
1
+ import platform
2
2
  from configparser import ConfigParser
3
3
  from pathlib import Path
4
4
  from typing import List, Union
@@ -11,15 +11,24 @@ LIST_SEPARATOR = "\n"
11
11
 
12
12
  class PythonSupportedVersionsResolver(NmkListConfigResolver):
13
13
  def get_value(self, name: str) -> List[str]:
14
+ def split_version(v: str) -> List[int]:
15
+ return list(map(int, v.split(".")))
16
+
14
17
  # Get min/max values, and verify consistency
15
18
  min_ver, max_ver = self.model.config["pythonMinVersion"].value, self.model.config["pythonMaxVersion"].value
16
- min_split, max_split = list(map(int, min_ver.split("."))), list(map(int, max_ver.split(".")))
19
+ min_split, max_split = split_version(min_ver), split_version(max_ver)
17
20
  prefix = "Inconsistency in python min/max supported versions: "
18
21
  assert len(min_split) == len(max_split), prefix + "not the same segments count"
19
22
  assert len(min_split) == 2, prefix + "can only deal with X.Y versions (2 segments expected)"
20
23
  assert min_split[0] == max_split[0], prefix + "can't deal with different major versions"
21
24
  assert max_split[1] > min_split[1], prefix + "max isn't greater than min"
22
25
 
26
+ # Also verifies current runtime is in range
27
+ p_ver = platform.python_version()
28
+ cur_split = split_version(p_ver)
29
+ assert cur_split[0] == max_split[0], prefix + f"current python major version ({p_ver}) doesn't match with supported versions range"
30
+ assert min_split[1] <= cur_split[1] <= max_split[1], prefix + f"current python version ({p_ver}) is out of supported versions range"
31
+
23
32
  # Iterate and return versions range
24
33
  return [f"{min_split[0]}.{sub}" for sub in range(min_split[1], max_split[1] + 1)]
25
34
 
@@ -29,13 +38,9 @@ class PythonSetupBuilder(TemplateBuilder):
29
38
  # Turn list into a single block of text values
30
39
  return (LIST_SEPARATOR + LIST_SEPARATOR.join([self.relative_path(str(v)) for v in values])) if isinstance(values, list) else values
31
40
 
32
- def build(self, setup_py_template: str, setup_cfg_files: List[str], setup_items: dict):
33
- # Copy setup.py
34
- setup_py_output = self.outputs[0]
35
- shutil.copyfile(Path(setup_py_template), setup_py_output)
36
-
41
+ def build(self, setup_cfg_files: List[str], setup_items: dict):
37
42
  # Merge setup fragments to generate final setup
38
- setup_cfg_output = self.outputs[1]
43
+ setup_cfg_output = self.main_output
39
44
  c = ConfigParser()
40
45
  for f_path in map(Path, setup_cfg_files):
41
46
  # Update config with rendered template
nmk_python/setup.yml CHANGED
@@ -1,26 +1,21 @@
1
1
  config:
2
2
  # Generated setup config files
3
3
  pythonSetupCfg: ${PROJECTDIR}/setup.cfg
4
- pythonSetupPy: ${PROJECTDIR}/setup.py
5
4
 
6
5
  # Paths to setup.cfg fragments to be merged
7
6
  pythonSetupCfgFiles: []
8
7
 
9
- # Template for setup.py file
10
- pythonSetupPyTemplate: ${BASEDIR}/templates/setup.py
11
-
12
8
  # Contributed setup items from yml files
13
9
  pythonSetupItems: {}
14
10
 
15
11
  # Python supported versions range (min-max)
16
12
  pythonMinVersion: "3.8"
17
- pythonMaxVersion: "3.11"
13
+ pythonMaxVersion: "3.12"
18
14
  pythonSupportedVersions:
19
15
  __resolver__: nmk_python.setup.PythonSupportedVersionsResolver
20
16
 
21
17
  # Contribute to gitignore
22
18
  gitIgnoredFiles:
23
- - ${pythonSetupPy}
24
19
  - ${pythonSetupCfg}
25
20
 
26
21
  tasks:
@@ -28,11 +23,9 @@ tasks:
28
23
  description: Generate python setup files
29
24
  emoji: ":snake:.:toolbox:"
30
25
  input:
31
- - ${pythonSetupPyTemplate}
32
26
  - ${pythonSetupCfgFiles}
33
27
  - ${pythonVersionStamp}
34
28
  output:
35
- - ${pythonSetupPy}
36
29
  - ${pythonSetupCfg}
37
30
  deps:
38
31
  - py.version
@@ -40,6 +33,5 @@ tasks:
40
33
  if: ${pythonSrcFiles} # Only if python source files are found
41
34
  builder: nmk_python.setup.PythonSetupBuilder
42
35
  params:
43
- setup_py_template: ${pythonSetupPyTemplate}
44
36
  setup_cfg_files: ${pythonSetupCfgFiles}
45
37
  setup_items: ${pythonSetupItems}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nmk-python
3
- Version: 0.13.4
3
+ Version: 0.14.0
4
4
  Summary: Python plugin for nmk build system
5
5
  Home-page: https://github.com/dynod/nmk-python
6
6
  Author: The dynod project
@@ -10,6 +10,7 @@ Classifier: Programming Language :: Python :: 3.8
10
10
  Classifier: Programming Language :: Python :: 3.9
11
11
  Classifier: Programming Language :: Python :: 3.10
12
12
  Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
13
14
  Description-Content-Type: text/markdown
14
15
  License-File: LICENSE
15
16
  Requires-Dist: nmk-base
@@ -22,7 +23,7 @@ Python plugin for nmk build system
22
23
  [![License: MPL](https://img.shields.io/github/license/dynod/nmk-python?color=green)](https://github.com/dynod/nmk-python/blob/main/LICENSE)
23
24
  [![Checks](https://img.shields.io/github/actions/workflow/status/dynod/nmk-python/build.yml?branch=main&label=build%20%26%20u.t.)](https://github.com/dynod/nmk-python/actions?query=branch%3Amain)
24
25
  [![Issues](https://img.shields.io/github/issues-search/dynod/nmk?label=issues&query=is%3Aopen+is%3Aissue+label%3Aplugin%3Apython)](https://github.com/dynod/nmk/issues?q=is%3Aopen+is%3Aissue+label%3Aplugin%3Apython)
25
- [![Supported python versions](https://img.shields.io/badge/python-3.8%20--%203.11-blue)](https://www.python.org/)
26
+ [![Supported python versions](https://img.shields.io/badge/python-3.8%20--%203.12-blue)](https://www.python.org/)
26
27
  [![PyPI](https://img.shields.io/pypi/v/nmk-python)](https://pypi.org/project/nmk-python/)
27
28
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
28
29
  [![Flake8 analysis result](https://img.shields.io/badge/flake8-0-green)](https://flake8.pycqa.org/)
@@ -1,7 +1,7 @@
1
1
  nmk_python/__init__.py,sha256=pVT-8I5dH_SkG5OQBtnOyIrWTtBh16mdua0Rah5ADPw,705
2
2
  nmk_python/badges.yml,sha256=TaauzvFP9KIiudSeq-YihcaZACKis6wwF526miVOguw,926
3
- nmk_python/build.py,sha256=achAaE64DrRt6UXmFm3r2jM5BZblN8b4Xemji0qXoLQ,1090
4
- nmk_python/build.yml,sha256=KDT1zdtEvVJW1C1oXU3b6n4bRAws7ltxoLfAiEDeKIY,2594
3
+ nmk_python/build.py,sha256=y5W5mcn0ZYSvFC28cxxxOtpm2qodiVFAANxMtBBVKpg,1134
4
+ nmk_python/build.yml,sha256=_a4uEFIYa5wuP6lJhn5sKYfp5sdzrVpy7hgq-j7Uhyw,2652
5
5
  nmk_python/doc.yml,sha256=12amAlYylH7JAHaqBIOoEZ_LrXY_bPNKuHrrwUkIj8w,932
6
6
  nmk_python/files.py,sha256=2loPwmbZdqYNod6ML85s0dpBY4jx6--AB5M2zQLzi5s,1152
7
7
  nmk_python/files.yml,sha256=fg8oPpTdjOSquIWw_cqcn5UyXfQHZzCVNSyHc95wfvE,703
@@ -10,8 +10,8 @@ nmk_python/flake.yml,sha256=FaoIzqVuD_YxbW6YruuO-Sfm0YAiwpztOdZv_evJvNA,1701
10
10
  nmk_python/format.py,sha256=JQCtKrWB8IsGzcqRTBZ7AbsVe6eG50sFibucj8ig4Ls,546
11
11
  nmk_python/format.yml,sha256=3R2Bhbg3AZRV8YgKVBjGY8WnnNJA-28GS867RDeW2AY,1068
12
12
  nmk_python/plugin.yml,sha256=ZXP1G7n6zrEu9H50_H_1XqDG-vE09x8SMJJpai7niQ8,1139
13
- nmk_python/setup.py,sha256=i0AhL9FFgkOcQVkwwH0O2xjh6GPSfCEbCZhJ7-CkXn0,2659
14
- nmk_python/setup.yml,sha256=zeqHvQEEa-JvY14AdcxSpeJ68aTrvQh9ytGxeb4-Bdc,1354
13
+ nmk_python/setup.py,sha256=URmntiw4rCe999CgRoO7EhnvvYyO1NAeeO42qplzY2M,2995
14
+ nmk_python/setup.yml,sha256=glSyp98_OwoZbJSgoopgkCFiUeKkbkCntLQTSl4S8sw,1068
15
15
  nmk_python/tests.py,sha256=rKKJKKx4g3C6TAVR_aNhsgPlMN3bU61dUqKx3seqq4s,935
16
16
  nmk_python/tests.yml,sha256=-rMWZC5PeadjOQu82d_OpmupFDs4Q1mzU3XxZBBlLTM,1825
17
17
  nmk_python/version.py,sha256=f-b--EYQMw2G2I8gCeMHDwOM8OQC8nu_a2cEtkAS6rQ,1278
@@ -23,9 +23,8 @@ nmk_python/templates/isort.cfg,sha256=7ZGCSLYAm1ZPmREwzDQS718e8Zp3Aa7ETtX5uuVxvR
23
23
  nmk_python/templates/pytest.cfg,sha256=m1oCLagZkiwimF4qES5d6BEMJRZm_SiqZMllJK5fj9E,561
24
24
  nmk_python/templates/python-settings.json.jinja,sha256=nwuuBJwj-nY6q5d1bBhnCV4nVa1YZvhm7QGBM2fubCM,1094
25
25
  nmk_python/templates/python-test-debug-launch.json.jinja,sha256=J_xju2EpHNXvgvqBxlf99p7g-ZMh3xE-_2r7o_57gpU,364
26
- nmk_python/templates/setup.py,sha256=mvQPLGpb840eTFw3tsRMvQzq6c3cQ4WHMnBzK1PJT_E,61
27
- nmk_python-0.13.4.dist-info/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
28
- nmk_python-0.13.4.dist-info/METADATA,sha256=zhnoupPiv0XYYeFWwI2rt-f7niM6QS6pfw6D6Y3zTPM,2798
29
- nmk_python-0.13.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
30
- nmk_python-0.13.4.dist-info/top_level.txt,sha256=MCb5w_hoOZ0kk3Dajxrd9Pz6lZ3pyuS6TQCRA3vddTo,11
31
- nmk_python-0.13.4.dist-info/RECORD,,
26
+ nmk_python-0.14.0.dist-info/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
27
+ nmk_python-0.14.0.dist-info/METADATA,sha256=vjQjoXs_pVJU6jhe7oD2iAn5TDKf7MNSQaXAivLxkuU,2849
28
+ nmk_python-0.14.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
29
+ nmk_python-0.14.0.dist-info/top_level.txt,sha256=MCb5w_hoOZ0kk3Dajxrd9Pz6lZ3pyuS6TQCRA3vddTo,11
30
+ nmk_python-0.14.0.dist-info/RECORD,,
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env python3
2
- from setuptools import setup
3
-
4
- setup()