cmeel 0.45.0__py3-none-any.whl → 0.46.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.

Potentially problematic release.


This version of cmeel might be problematic. Click here for more details.

cmeel/__main__.py CHANGED
@@ -8,6 +8,7 @@ import sys
8
8
 
9
9
  from .docker import add_docker_arguments, docker_build
10
10
  from .env import add_paths_arguments, get_paths
11
+ from .release import add_release_arguments, release
11
12
 
12
13
  LOG = logging.getLogger("cmeel")
13
14
 
@@ -39,6 +40,7 @@ def parse_args() -> argparse.Namespace:
39
40
 
40
41
  add_paths_arguments(subparsers)
41
42
  add_docker_arguments(subparsers)
43
+ add_release_arguments(subparsers)
42
44
 
43
45
  args = parser.parse_args()
44
46
 
@@ -63,6 +65,8 @@ def main():
63
65
  args = parse_args()
64
66
  if args.cmd == "docker":
65
67
  docker_build(**vars(args))
68
+ if args.cmd == "release":
69
+ release(**vars(args))
66
70
  else:
67
71
  print(get_paths(**vars(args)))
68
72
 
cmeel/backports.py CHANGED
@@ -1,7 +1,7 @@
1
1
  # ruff: noqa
2
2
 
3
3
  try:
4
- from argparse import BooleanOptionalAction
4
+ from argparse import BooleanOptionalAction # type: ignore
5
5
  except ImportError:
6
6
  # Python < 3.9
7
7
  # https://github.com/python/cpython/blob/3.11/Lib/argparse.py#L885
cmeel/release.py ADDED
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env python
2
+ """Helper to release a cmeel project."""
3
+ from logging import getLogger
4
+ from pathlib import Path
5
+ from subprocess import check_call
6
+
7
+ try:
8
+ import tomllib # type: ignore
9
+ except ModuleNotFoundError:
10
+ import tomli as tomllib # type: ignore
11
+
12
+ LOG = getLogger("cmeel.release")
13
+
14
+
15
+ def add_release_arguments(subparsers):
16
+ """Append release command for argparse."""
17
+ sub = subparsers.add_parser("release", help="release a cmeel project.")
18
+ sub.set_defaults(cmd="release")
19
+
20
+
21
+ def release(**kwargs):
22
+ """Release a cmeel project."""
23
+ with Path("pyproject.toml").open("rb") as f:
24
+ pyproject = tomllib.load(f)
25
+
26
+ version = pyproject["project"]["version"]
27
+ build = pyproject.get("tool", {}).get("cmeel", {}).get("build-number", 0)
28
+ tag = f"v{version}.c{build}"
29
+ release = f"Cmeel Release {tag}"
30
+
31
+ LOG.info("Releasing vesion '%s'", tag)
32
+
33
+ commit_cmd = ["git", "commit", "-am", release]
34
+ LOG.debug("commit command: %s", commit_cmd)
35
+ check_call(commit_cmd)
36
+
37
+ tag_cmd = ["git", "tag", "-s", tag, "-m", release]
38
+ LOG.debug("tag command: %s", tag_cmd)
39
+ check_call(tag_cmd)
40
+
41
+ push_cmd = ["git", "push", "origin", tag]
42
+ LOG.debug("push command: %s", push_cmd)
43
+ check_call(push_cmd)
44
+
45
+
46
+ if __name__ == "__main__":
47
+ import logging
48
+
49
+ logging.basicConfig(level=logging.DEBUG)
50
+ release()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cmeel
3
- Version: 0.45.0
3
+ Version: 0.46.0
4
4
  Summary: Create Wheel from CMake projects
5
5
  Home-page: https://github.com/cmake-wheel/cmeel
6
6
  License: BSD-2-Clause
@@ -92,3 +92,11 @@ build-backend = "cmeel.build"
92
92
  Complete specification is available at:
93
93
  https://packaging.python.org/en/latest/specifications/declaring-project-metadata
94
94
 
95
+ ## Install
96
+
97
+ If you want to use the helpers provided by cmeel, to *eg*. test building a project in a manylinux container with
98
+ `cmeel docker`, the best way to install cmeel is to use pipx: `pipx install cmeel`
99
+
100
+ Otherwise, if you just want to use the build backend, there is no need to install anything: your frontent (*eg.* `pip`)
101
+ should do this for you
102
+
@@ -1,6 +1,6 @@
1
1
  cmeel/__init__.py,sha256=qXgvoZwlDxRzuWhU5M88WFU42uSbOQS9TY4CfmKJTKY,352
2
- cmeel/__main__.py,sha256=oUdz8nBX0mtsDHoMh-_leiTY7grjFwrEzV-wkupKfYk,1661
3
- cmeel/backports.py,sha256=ahVkwvNplt4xqY8RAb7lzzDks9tzrgB5QEAGVzkeBqg,1457
2
+ cmeel/__main__.py,sha256=93iGesD3k13_2asPHJXeJXJGvO9lg42A7-jlk9B-cYk,1811
3
+ cmeel/backports.py,sha256=ZJ34NDWgrlrSkq8AGrKof9SQexQH8sver2HmJIur80c,1473
4
4
  cmeel/build.py,sha256=dvUj6ofbpQLau3VvlvagqP0X6ap0cjB1r0jPecfvphI,12583
5
5
  cmeel/config.py,sha256=VrxuFCaoQ7c9cVeGNNMFR7Hl6Vv_G44x8perI-XhrjA,3634
6
6
  cmeel/consts.py,sha256=HRFNs1Zusp1aw7TfzseUcE6Llz4zbCGhxw0O1Wc5c5E,179
@@ -8,10 +8,11 @@ cmeel/docker.py,sha256=wT-VZuGKj1wcdldwgsYcWmJK_rjo2Eh1USEDMOmlsBU,2775
8
8
  cmeel/env.py,sha256=OOA64v6KysZTvFup5rZuBFYVSDvPoW_6PqUcuf4m0Os,1235
9
9
  cmeel/metadata.py,sha256=sjcuglpUdalkTIB6REaH7eoD-6f04jzYIO9rftTaZOQ,8017
10
10
  cmeel/pth.py,sha256=N0G1d8BHRcuzNEfQaK9WMW0h6s-Sjigc7JUAPPoeu4Q,403
11
+ cmeel/release.py,sha256=j8vxeAevtUFfwlV4gXGJ6tWqR-CNHn_d69FRhgeWkjY,1356
11
12
  cmeel/run.py,sha256=sD2Is7MEb5yIUu6dMjzyOJgb-ErJh-EBII9WzL13zco,743
12
13
  cmeel.pth,sha256=CD-QdG4ceUgq5wIEJZpipOSZQF8apq7i9u9RhsBWbc8,17
13
- cmeel-0.45.0.dist-info/LICENSE,sha256=4QHEuqIDbscybBc21CcazwRjix-rV-AH2QAZ4IqxlzQ,1324
14
- cmeel-0.45.0.dist-info/METADATA,sha256=Uf18Ajzg2ePo2nQZ48aRMvDb2tIlSnmCNPnTgz3CxRw,4615
15
- cmeel-0.45.0.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
16
- cmeel-0.45.0.dist-info/entry_points.txt,sha256=AiK0nCTi1LpRXxyiSCcbPsLYIpSvYW8GF7jcllMIl1U,45
17
- cmeel-0.45.0.dist-info/RECORD,,
14
+ cmeel-0.46.0.dist-info/LICENSE,sha256=4QHEuqIDbscybBc21CcazwRjix-rV-AH2QAZ4IqxlzQ,1324
15
+ cmeel-0.46.0.dist-info/METADATA,sha256=vz4wds3k1z0N_FqB5cWMDkldwoYXLrase179R_9QkeA,4968
16
+ cmeel-0.46.0.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
17
+ cmeel-0.46.0.dist-info/entry_points.txt,sha256=AiK0nCTi1LpRXxyiSCcbPsLYIpSvYW8GF7jcllMIl1U,45
18
+ cmeel-0.46.0.dist-info/RECORD,,
File without changes