trackfw 0.1.2__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.
trackfw/__init__.py
ADDED
|
File without changes
|
trackfw/_cli.py
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"""Entry point para o CLI trackfw via PyPI."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import sys
|
|
5
|
+
import platform
|
|
6
|
+
import urllib.request
|
|
7
|
+
import tarfile
|
|
8
|
+
import zipfile
|
|
9
|
+
import tempfile
|
|
10
|
+
import shutil
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
VERSION = "0.1.2"
|
|
14
|
+
REPO = "kgsaran/trackfw"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _platform_info():
|
|
18
|
+
system = platform.system().lower()
|
|
19
|
+
machine = platform.machine().lower()
|
|
20
|
+
os_map = {"linux": "linux", "darwin": "darwin", "windows": "windows"}
|
|
21
|
+
arch_map = {"x86_64": "amd64", "amd64": "amd64", "aarch64": "arm64", "arm64": "arm64"}
|
|
22
|
+
return os_map.get(system), arch_map.get(machine)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _binary_path():
|
|
26
|
+
pkg_dir = Path(__file__).parent
|
|
27
|
+
is_windows = platform.system() == "Windows"
|
|
28
|
+
name = "trackfw-bin.exe" if is_windows else "trackfw-bin"
|
|
29
|
+
return pkg_dir / name
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _download_binary(dest: Path):
|
|
33
|
+
os_name, arch = _platform_info()
|
|
34
|
+
if not os_name or not arch:
|
|
35
|
+
print(
|
|
36
|
+
f"trackfw: plataforma não suportada ({platform.system()}/{platform.machine()})",
|
|
37
|
+
file=sys.stderr,
|
|
38
|
+
)
|
|
39
|
+
sys.exit(1)
|
|
40
|
+
|
|
41
|
+
is_windows = os_name == "windows"
|
|
42
|
+
ext = ".zip" if is_windows else ".tar.gz"
|
|
43
|
+
filename = f"trackfw_{VERSION}_{os_name}_{arch}{ext}"
|
|
44
|
+
url = f"https://github.com/{REPO}/releases/download/v{VERSION}/{filename}"
|
|
45
|
+
|
|
46
|
+
print(f"trackfw: baixando binário v{VERSION} para {os_name}/{arch}...", file=sys.stderr)
|
|
47
|
+
|
|
48
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
49
|
+
tmp_archive = os.path.join(tmp, filename)
|
|
50
|
+
urllib.request.urlretrieve(url, tmp_archive)
|
|
51
|
+
|
|
52
|
+
extracted_bin_name = "trackfw.exe" if is_windows else "trackfw"
|
|
53
|
+
if is_windows:
|
|
54
|
+
with zipfile.ZipFile(tmp_archive) as zf:
|
|
55
|
+
zf.extract(extracted_bin_name, tmp)
|
|
56
|
+
else:
|
|
57
|
+
with tarfile.open(tmp_archive, "r:gz") as tf:
|
|
58
|
+
member = tf.getmember(extracted_bin_name)
|
|
59
|
+
tf.extract(member, tmp, filter="data")
|
|
60
|
+
|
|
61
|
+
extracted = os.path.join(tmp, extracted_bin_name)
|
|
62
|
+
dest.parent.mkdir(parents=True, exist_ok=True)
|
|
63
|
+
shutil.move(extracted, str(dest))
|
|
64
|
+
|
|
65
|
+
if not is_windows:
|
|
66
|
+
dest.chmod(0o755)
|
|
67
|
+
|
|
68
|
+
print("trackfw: binário instalado.", file=sys.stderr)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def main():
|
|
72
|
+
binary = _binary_path()
|
|
73
|
+
|
|
74
|
+
if not binary.exists():
|
|
75
|
+
_download_binary(binary)
|
|
76
|
+
|
|
77
|
+
if platform.system() == "Windows":
|
|
78
|
+
import subprocess
|
|
79
|
+
result = subprocess.run([str(binary)] + sys.argv[1:])
|
|
80
|
+
sys.exit(result.returncode)
|
|
81
|
+
else:
|
|
82
|
+
os.execv(str(binary), [str(binary)] + sys.argv[1:])
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: trackfw
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Governed software delivery framework: ADR → REQ → ROADMAP → kanban
|
|
5
|
+
License: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/kgsaran/trackfw
|
|
7
|
+
Project-URL: Repository, https://github.com/kgsaran/trackfw
|
|
8
|
+
Keywords: cli,adr,roadmap,governance,delivery
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
14
|
+
Requires-Python: >=3.8
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
trackfw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
trackfw/_cli.py,sha256=qJm8C5iGq6qQHVU0AQuqFKGtaazQOabxfp4JxYzR9Os,2483
|
|
3
|
+
trackfw-0.1.2.dist-info/METADATA,sha256=aWwfdy3ixtL0k4xfKlxfz8ExGcY3cRrhP-PgJCIQHLs,568
|
|
4
|
+
trackfw-0.1.2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
5
|
+
trackfw-0.1.2.dist-info/entry_points.txt,sha256=V0l7xbVuBLs800_A5XM4RKlpPbMhWDf19svIYc-GIZQ,46
|
|
6
|
+
trackfw-0.1.2.dist-info/top_level.txt,sha256=QcEAelieptNDOjEcAuzQ2K9wyNkTrOpI__YVu8lgr6M,8
|
|
7
|
+
trackfw-0.1.2.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
trackfw
|