tenzir-platform-cli 6.20.0rc1__tar.gz

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.
@@ -0,0 +1,30 @@
1
+ Metadata-Version: 2.4
2
+ Name: tenzir-platform-cli
3
+ Version: 6.20.0rc1
4
+ Summary: Command-line client for the Tenzir Platform
5
+ Author-email: Tenzir <engineering@tenzir.com>
6
+ License-Expression: BSD-3-Clause
7
+ Project-URL: Homepage, https://tenzir.com
8
+ Project-URL: Documentation, https://tenzir.com/docs/reference/platform/command-line-interface
9
+ Requires-Python: >=3.10
10
+ Description-Content-Type: text/markdown
11
+
12
+ # Tenzir Platform CLI
13
+
14
+ This package distributes the compiled Tenzir Platform CLI for Linux x86_64 and
15
+ ARM64, and macOS 13 or later on ARM64. Install it with
16
+ `pip install tenzir-platform-cli`, then run
17
+ `platform-cli --help`.
18
+
19
+ The `tenzir` package installs this dependency automatically and exposes
20
+ it through `tenzir platform`. With `TENZIR_UNIFIED=1`, platform commands are also
21
+ available directly through `tenzir`.
22
+
23
+ Build a wheel from a repository checkout with
24
+ `uv build --wheel --package tenzir-platform-cli` in `engine/python/`. The build
25
+ uses the engine flake's `platform-cli` output. To package an existing binary, set
26
+ `TENZIR_PLATFORM_CLI_PATH` to its absolute path. Set `TENZIR_WHEEL_PLATFORM` when
27
+ packaging a binary for a different architecture.
28
+
29
+ macOS releases use `TENZIR_SIGNED_TARBALL_PATH` to extract the signed and
30
+ notarized executable from the native package without changing its bytes.
@@ -0,0 +1,19 @@
1
+ # Tenzir Platform CLI
2
+
3
+ This package distributes the compiled Tenzir Platform CLI for Linux x86_64 and
4
+ ARM64, and macOS 13 or later on ARM64. Install it with
5
+ `pip install tenzir-platform-cli`, then run
6
+ `platform-cli --help`.
7
+
8
+ The `tenzir` package installs this dependency automatically and exposes
9
+ it through `tenzir platform`. With `TENZIR_UNIFIED=1`, platform commands are also
10
+ available directly through `tenzir`.
11
+
12
+ Build a wheel from a repository checkout with
13
+ `uv build --wheel --package tenzir-platform-cli` in `engine/python/`. The build
14
+ uses the engine flake's `platform-cli` output. To package an existing binary, set
15
+ `TENZIR_PLATFORM_CLI_PATH` to its absolute path. Set `TENZIR_WHEEL_PLATFORM` when
16
+ packaging a binary for a different architecture.
17
+
18
+ macOS releases use `TENZIR_SIGNED_TARBALL_PATH` to extract the signed and
19
+ notarized executable from the native package without changing its bytes.
@@ -0,0 +1,28 @@
1
+ [build-system]
2
+ requires = ["setuptools>=80", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "tenzir-platform-cli"
7
+ version = "6.20.0rc1"
8
+ description = "Command-line client for the Tenzir Platform"
9
+ requires-python = ">=3.10"
10
+ license = "BSD-3-Clause"
11
+ readme = "README.md"
12
+ authors = [{ name = "Tenzir", email = "engineering@tenzir.com" }]
13
+
14
+ [project.urls]
15
+ Homepage = "https://tenzir.com"
16
+ Documentation = "https://tenzir.com/docs/reference/platform/command-line-interface"
17
+
18
+ [project.scripts]
19
+ platform-cli = "tenzir_platform_cli._bin:main"
20
+
21
+ [tool.setuptools]
22
+ package-dir = {"" = "src"}
23
+
24
+ [tool.setuptools.packages.find]
25
+ where = ["src"]
26
+
27
+ [tool.setuptools.package-data]
28
+ tenzir_platform_cli = ["platform-cli"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,88 @@
1
+ from __future__ import annotations
2
+
3
+ import os
4
+ import platform
5
+ import shutil
6
+ import subprocess
7
+ import tarfile
8
+ from pathlib import Path
9
+ from typing import override
10
+
11
+ from setuptools import Distribution, setup
12
+ from setuptools.command.bdist_wheel import bdist_wheel as _bdist_wheel
13
+ from setuptools.command.build_py import build_py as _build_py
14
+
15
+ ROOT = Path(__file__).resolve().parent
16
+ BINARY = ROOT / "src" / "tenzir_platform_cli" / "platform-cli"
17
+
18
+
19
+ class BuildPy(_build_py):
20
+ @override
21
+ def run(self) -> None:
22
+ signed_tarball = os.environ.get("TENZIR_SIGNED_TARBALL_PATH")
23
+ binary_path = os.environ.get("TENZIR_PLATFORM_CLI_PATH")
24
+ if signed_tarball:
25
+ # Preserve the exact signed and notarized macOS executable bytes.
26
+ with tarfile.open(signed_tarball) as archive:
27
+ member = archive.getmember("opt/tenzir/libexec/platform-cli")
28
+ with archive.extractfile(member) as source, BINARY.open("wb") as dest:
29
+ shutil.copyfileobj(source, dest)
30
+ BINARY.chmod(member.mode)
31
+ elif binary_path:
32
+ source = Path(binary_path)
33
+ shutil.copy2(source, BINARY)
34
+ else:
35
+ repo_root = Path(os.environ.get("TENZIR_REPO_ROOT", ROOT.parents[1]))
36
+ result = subprocess.run(
37
+ [
38
+ "nix",
39
+ "--accept-flake-config",
40
+ "build",
41
+ "--no-link",
42
+ "--print-out-paths",
43
+ f"{repo_root}#platform-cli",
44
+ ],
45
+ cwd=repo_root,
46
+ check=True,
47
+ capture_output=True,
48
+ text=True,
49
+ )
50
+ source = Path(result.stdout.splitlines()[-1]) / "bin" / "platform-cli"
51
+ shutil.copy2(source, BINARY)
52
+ try:
53
+ super().run()
54
+ finally:
55
+ BINARY.unlink()
56
+
57
+
58
+ class BinaryDistribution(Distribution):
59
+ @override
60
+ def has_ext_modules(self) -> bool:
61
+ return True
62
+
63
+
64
+ class BdistWheel(_bdist_wheel):
65
+ @override
66
+ def run(self) -> None:
67
+ try:
68
+ super().run()
69
+ finally:
70
+ shutil.rmtree(ROOT / "build", ignore_errors=True)
71
+
72
+ @override
73
+ def get_tag(self) -> tuple[str, str, str]:
74
+ tag = os.environ.get("TENZIR_WHEEL_PLATFORM")
75
+ if not tag:
76
+ tags = {
77
+ ("Linux", "x86_64"): "manylinux_2_5_x86_64.musllinux_1_1_x86_64",
78
+ ("Linux", "aarch64"): "manylinux_2_17_aarch64.musllinux_1_1_aarch64",
79
+ ("Darwin", "arm64"): "macosx_13_0_arm64",
80
+ }
81
+ tag = tags[platform.system(), platform.machine()]
82
+ return "py3", "none", tag
83
+
84
+
85
+ _ = setup(
86
+ distclass=BinaryDistribution,
87
+ cmdclass={"build_py": BuildPy, "bdist_wheel": BdistWheel},
88
+ )
@@ -0,0 +1,13 @@
1
+ import os
2
+ import sys
3
+ from pathlib import Path
4
+ from typing import NoReturn
5
+
6
+
7
+ def exec_cli(arguments: list[str]) -> NoReturn:
8
+ binary = Path(__file__).with_name("platform-cli")
9
+ os.execv(binary, ["platform-cli", *arguments])
10
+
11
+
12
+ def main() -> NoReturn:
13
+ exec_cli(sys.argv[1:])
@@ -0,0 +1,30 @@
1
+ Metadata-Version: 2.4
2
+ Name: tenzir-platform-cli
3
+ Version: 6.20.0rc1
4
+ Summary: Command-line client for the Tenzir Platform
5
+ Author-email: Tenzir <engineering@tenzir.com>
6
+ License-Expression: BSD-3-Clause
7
+ Project-URL: Homepage, https://tenzir.com
8
+ Project-URL: Documentation, https://tenzir.com/docs/reference/platform/command-line-interface
9
+ Requires-Python: >=3.10
10
+ Description-Content-Type: text/markdown
11
+
12
+ # Tenzir Platform CLI
13
+
14
+ This package distributes the compiled Tenzir Platform CLI for Linux x86_64 and
15
+ ARM64, and macOS 13 or later on ARM64. Install it with
16
+ `pip install tenzir-platform-cli`, then run
17
+ `platform-cli --help`.
18
+
19
+ The `tenzir` package installs this dependency automatically and exposes
20
+ it through `tenzir platform`. With `TENZIR_UNIFIED=1`, platform commands are also
21
+ available directly through `tenzir`.
22
+
23
+ Build a wheel from a repository checkout with
24
+ `uv build --wheel --package tenzir-platform-cli` in `engine/python/`. The build
25
+ uses the engine flake's `platform-cli` output. To package an existing binary, set
26
+ `TENZIR_PLATFORM_CLI_PATH` to its absolute path. Set `TENZIR_WHEEL_PLATFORM` when
27
+ packaging a binary for a different architecture.
28
+
29
+ macOS releases use `TENZIR_SIGNED_TARBALL_PATH` to extract the signed and
30
+ notarized executable from the native package without changing its bytes.
@@ -0,0 +1,10 @@
1
+ README.md
2
+ pyproject.toml
3
+ setup.py
4
+ src/tenzir_platform_cli/__init__.py
5
+ src/tenzir_platform_cli/_bin.py
6
+ src/tenzir_platform_cli.egg-info/PKG-INFO
7
+ src/tenzir_platform_cli.egg-info/SOURCES.txt
8
+ src/tenzir_platform_cli.egg-info/dependency_links.txt
9
+ src/tenzir_platform_cli.egg-info/entry_points.txt
10
+ src/tenzir_platform_cli.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ platform-cli = tenzir_platform_cli._bin:main