voom-cli 0.0.0__tar.gz → 0.2.0__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,60 @@
1
+ Metadata-Version: 2.4
2
+ Name: voom-cli
3
+ Version: 0.2.0
4
+ Summary: Fast, safe, parallel build-artifact pruning across every major language ecosystem
5
+ Author-email: Na'aman Hirschfeld <nhirschfeld@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/Goldziher/voom
8
+ Project-URL: Documentation, https://github.com/Goldziher/voom#readme
9
+ Project-URL: Repository, https://github.com/Goldziher/voom.git
10
+ Project-URL: Issues, https://github.com/Goldziher/voom/issues
11
+ Project-URL: Changelog, https://github.com/Goldziher/voom/blob/main/CHANGELOG.md
12
+ Keywords: clean,cleanup,build-artifacts,disk-space,monorepo,cli,prune,rust
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: System Administrators
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: MacOS
19
+ Classifier: Operating System :: Microsoft :: Windows
20
+ Classifier: Operating System :: POSIX :: Linux
21
+ Classifier: Programming Language :: Python :: 3
22
+ Classifier: Programming Language :: Python :: 3 :: Only
23
+ Classifier: Programming Language :: Python :: 3.10
24
+ Classifier: Programming Language :: Python :: 3.11
25
+ Classifier: Programming Language :: Python :: 3.12
26
+ Classifier: Programming Language :: Python :: 3.13
27
+ Classifier: Programming Language :: Python :: 3.14
28
+ Classifier: Programming Language :: Rust
29
+ Classifier: Topic :: Software Development :: Build Tools
30
+ Classifier: Topic :: System :: Filesystems
31
+ Classifier: Topic :: Utilities
32
+ Requires-Python: >=3.10
33
+ Description-Content-Type: text/markdown
34
+ License-File: LICENSE
35
+ Requires-Dist: certifi>=2024.7.4
36
+ Dynamic: license-file
37
+
38
+ # voom-cli
39
+
40
+ Fast, safe, parallel build-artifact pruning across every major language ecosystem.
41
+
42
+ ```bash
43
+ pip install voom-cli
44
+ voom --dry-run ~
45
+ ```
46
+
47
+ Or without installing:
48
+
49
+ ```bash
50
+ uvx --from voom-cli voom --dry-run ~
51
+ ```
52
+
53
+ The first run downloads the prebuilt `voom` binary for your platform from the
54
+ [GitHub release](https://github.com/Goldziher/voom/releases) matching this package's version
55
+ and caches it under `~/.cache/voom/`. Set `VOOM_BINARY` to point at your own build instead.
56
+
57
+ **voom deletes by default.** Use `--dry-run` to preview. It never removes a directory without
58
+ a marker file proving its ecosystem, and it never touches `node_modules/`.
59
+
60
+ Full documentation: <https://github.com/Goldziher/voom>
@@ -0,0 +1,23 @@
1
+ # voom-cli
2
+
3
+ Fast, safe, parallel build-artifact pruning across every major language ecosystem.
4
+
5
+ ```bash
6
+ pip install voom-cli
7
+ voom --dry-run ~
8
+ ```
9
+
10
+ Or without installing:
11
+
12
+ ```bash
13
+ uvx --from voom-cli voom --dry-run ~
14
+ ```
15
+
16
+ The first run downloads the prebuilt `voom` binary for your platform from the
17
+ [GitHub release](https://github.com/Goldziher/voom/releases) matching this package's version
18
+ and caches it under `~/.cache/voom/`. Set `VOOM_BINARY` to point at your own build instead.
19
+
20
+ **voom deletes by default.** Use `--dry-run` to preview. It never removes a directory without
21
+ a marker file proving its ecosystem, and it never touches `node_modules/`.
22
+
23
+ Full documentation: <https://github.com/Goldziher/voom>
@@ -0,0 +1,50 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "voom-cli"
7
+ version = "0.2.0"
8
+ description = "Fast, safe, parallel build-artifact pruning across every major language ecosystem"
9
+ readme = "README.md"
10
+ license = { text = "MIT" }
11
+ authors = [{ name = "Na'aman Hirschfeld", email = "nhirschfeld@gmail.com" }]
12
+ classifiers = [
13
+ "Development Status :: 4 - Beta",
14
+ "Environment :: Console",
15
+ "Intended Audience :: Developers",
16
+ "Intended Audience :: System Administrators",
17
+ "License :: OSI Approved :: MIT License",
18
+ # The wheel is pure Python; the binary it downloads exists only for these three, so a
19
+ # platform outside them fails at first run rather than at install. See voom/downloader.py.
20
+ "Operating System :: MacOS",
21
+ "Operating System :: Microsoft :: Windows",
22
+ "Operating System :: POSIX :: Linux",
23
+ "Programming Language :: Python :: 3",
24
+ "Programming Language :: Python :: 3 :: Only",
25
+ "Programming Language :: Python :: 3.10",
26
+ "Programming Language :: Python :: 3.11",
27
+ "Programming Language :: Python :: 3.12",
28
+ "Programming Language :: Python :: 3.13",
29
+ "Programming Language :: Python :: 3.14",
30
+ "Programming Language :: Rust",
31
+ "Topic :: Software Development :: Build Tools",
32
+ "Topic :: System :: Filesystems",
33
+ "Topic :: Utilities",
34
+ ]
35
+ keywords = ["clean", "cleanup", "build-artifacts", "disk-space", "monorepo", "cli", "prune", "rust"]
36
+ requires-python = ">=3.10"
37
+ dependencies = ["certifi>=2024.7.4"]
38
+
39
+ [project.urls]
40
+ Homepage = "https://github.com/Goldziher/voom"
41
+ Documentation = "https://github.com/Goldziher/voom#readme"
42
+ Repository = "https://github.com/Goldziher/voom.git"
43
+ Issues = "https://github.com/Goldziher/voom/issues"
44
+ Changelog = "https://github.com/Goldziher/voom/blob/main/CHANGELOG.md"
45
+
46
+ [project.scripts]
47
+ voom = "voom.cli:main"
48
+
49
+ [tool.setuptools]
50
+ packages = ["voom"]
@@ -0,0 +1 @@
1
+ __version__ = "0.2.0"
@@ -0,0 +1,9 @@
1
+ from __future__ import annotations
2
+
3
+ import sys
4
+
5
+ from .downloader import run_voom
6
+
7
+
8
+ def main() -> None:
9
+ run_voom(sys.argv[1:])
@@ -0,0 +1,156 @@
1
+ from __future__ import annotations
2
+
3
+ import os
4
+ import platform
5
+ import ssl
6
+ import subprocess
7
+ import sys
8
+ import tarfile
9
+ import tempfile
10
+ import zipfile
11
+ from pathlib import Path
12
+ from urllib.error import URLError
13
+ from urllib.request import Request, urlopen
14
+
15
+ import certifi
16
+
17
+ REPO = "Goldziher/voom"
18
+ BINARY = "voom"
19
+
20
+
21
+ def _platform_triple() -> str:
22
+ system = platform.system().lower()
23
+ machine = platform.machine().lower()
24
+
25
+ if system == "windows":
26
+ if machine in {"amd64", "x86_64"}:
27
+ return "x86_64-pc-windows-gnu"
28
+ if machine in {"x86", "i386", "i686"}:
29
+ raise RuntimeError("32-bit Windows is not supported")
30
+ elif system == "linux":
31
+ if machine in {"amd64", "x86_64"}:
32
+ return "x86_64-unknown-linux-gnu"
33
+ if machine in {"aarch64", "arm64"}:
34
+ return "aarch64-unknown-linux-gnu"
35
+ elif system == "darwin":
36
+ if machine in {"amd64", "x86_64"}:
37
+ return "x86_64-apple-darwin"
38
+ if machine in {"aarch64", "arm64"}:
39
+ return "aarch64-apple-darwin"
40
+
41
+ raise RuntimeError(f"Unsupported platform: {system} {machine}")
42
+
43
+
44
+ def _python_version_to_tag(version: str) -> str:
45
+ """Reverse PyPI's version normalization to recover the git tag.
46
+
47
+ PyPI stores ``0.2.0rc1`` where the git tag is ``v0.2.0-rc.1``. The release
48
+ workflow performs the forward conversion; this is the inverse, and the two
49
+ must stay in step or release-candidate installs will 404.
50
+ """
51
+ if "rc" in version:
52
+ core, suffix = version.split("rc")
53
+ return f"{core}-rc.{suffix}"
54
+ return version
55
+
56
+
57
+ def _asset(version: str) -> tuple[str, str]:
58
+ tag = _python_version_to_tag(version)
59
+ triple = _platform_triple()
60
+ ext = "zip" if "windows" in triple else "tar.gz"
61
+ url = f"https://github.com/{REPO}/releases/download/v{tag}/{BINARY}-{triple}.{ext}"
62
+ return url, ext
63
+
64
+
65
+ def _download(url: str, destination: Path) -> None:
66
+ request = Request(url, headers={"User-Agent": "voom-python-wrapper"})
67
+ context = ssl.create_default_context(cafile=certifi.where())
68
+ try:
69
+ with urlopen(request, timeout=30, context=context) as response:
70
+ if response.status != 200:
71
+ raise RuntimeError(f"HTTP {response.status}: {response.reason}")
72
+ destination.write_bytes(response.read())
73
+ except URLError as exc:
74
+ raise RuntimeError(f"Failed to download binary: {exc}") from exc
75
+
76
+
77
+ def _extract(archive: Path, ext: str, destination: Path) -> None:
78
+ names = (BINARY, f"{BINARY}.exe")
79
+ if ext == "zip":
80
+ with zipfile.ZipFile(archive) as zf:
81
+ for name in zf.namelist():
82
+ if name.endswith(names):
83
+ with zf.open(name) as src, destination.open("wb") as dst:
84
+ dst.write(src.read())
85
+ return
86
+ else:
87
+ with tarfile.open(archive, "r:gz") as tar:
88
+ for member in tar.getmembers():
89
+ if member.name.endswith(names):
90
+ extracted = tar.extractfile(member)
91
+ if extracted is None:
92
+ continue
93
+ with extracted as src, destination.open("wb") as dst:
94
+ dst.write(src.read())
95
+ return
96
+ raise RuntimeError("Binary not found in downloaded archive")
97
+
98
+
99
+ def _cache_root() -> Path:
100
+ """Where the downloaded binary lives, per user and per version.
101
+
102
+ Per user rather than beside the installed package: a wheel often lands somewhere the
103
+ running user cannot write, which is exactly when the first run needs to write. The npm
104
+ wrapper caches in the same place for the same reason (npm-package/download.js).
105
+ """
106
+ if platform.system().lower() == "windows":
107
+ local_app_data = os.getenv("LOCALAPPDATA")
108
+ if local_app_data:
109
+ return Path(local_app_data) / BINARY
110
+ return Path.home() / ".cache" / BINARY
111
+
112
+
113
+ def _cache_path(version: str) -> Path:
114
+ cache_dir = _cache_root() / version
115
+ cache_dir.mkdir(parents=True, exist_ok=True)
116
+ suffix = ".exe" if platform.system().lower() == "windows" else ""
117
+ return cache_dir / f"{BINARY}{suffix}"
118
+
119
+
120
+ def ensure_binary() -> str:
121
+ """Return a path to the voom binary, downloading it on first use."""
122
+ from . import __version__
123
+
124
+ override = os.getenv("VOOM_BINARY")
125
+ if override:
126
+ return override
127
+
128
+ binary_path = _cache_path(__version__)
129
+ if binary_path.exists() and os.access(binary_path, os.X_OK):
130
+ return str(binary_path)
131
+
132
+ url, ext = _asset(__version__)
133
+ print(f"Downloading voom binary v{__version__}...", file=sys.stderr)
134
+
135
+ with tempfile.TemporaryDirectory() as tmpdir:
136
+ archive_path = Path(tmpdir) / f"{BINARY}.{ext}"
137
+ _download(url, archive_path)
138
+ _extract(archive_path, ext, binary_path)
139
+
140
+ if platform.system().lower() != "windows":
141
+ binary_path.chmod(0o755)
142
+
143
+ print("Binary downloaded successfully.", file=sys.stderr)
144
+ return str(binary_path)
145
+
146
+
147
+ def run_voom(args: list[str]) -> None:
148
+ """Run the voom binary with the given arguments and exit with its status."""
149
+ binary_path = ensure_binary()
150
+
151
+ try:
152
+ result = subprocess.run([binary_path, *args], check=False)
153
+ except FileNotFoundError as exc:
154
+ raise RuntimeError(f"Binary not found at {binary_path}") from exc
155
+
156
+ sys.exit(result.returncode)
@@ -0,0 +1,60 @@
1
+ Metadata-Version: 2.4
2
+ Name: voom-cli
3
+ Version: 0.2.0
4
+ Summary: Fast, safe, parallel build-artifact pruning across every major language ecosystem
5
+ Author-email: Na'aman Hirschfeld <nhirschfeld@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/Goldziher/voom
8
+ Project-URL: Documentation, https://github.com/Goldziher/voom#readme
9
+ Project-URL: Repository, https://github.com/Goldziher/voom.git
10
+ Project-URL: Issues, https://github.com/Goldziher/voom/issues
11
+ Project-URL: Changelog, https://github.com/Goldziher/voom/blob/main/CHANGELOG.md
12
+ Keywords: clean,cleanup,build-artifacts,disk-space,monorepo,cli,prune,rust
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: System Administrators
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: MacOS
19
+ Classifier: Operating System :: Microsoft :: Windows
20
+ Classifier: Operating System :: POSIX :: Linux
21
+ Classifier: Programming Language :: Python :: 3
22
+ Classifier: Programming Language :: Python :: 3 :: Only
23
+ Classifier: Programming Language :: Python :: 3.10
24
+ Classifier: Programming Language :: Python :: 3.11
25
+ Classifier: Programming Language :: Python :: 3.12
26
+ Classifier: Programming Language :: Python :: 3.13
27
+ Classifier: Programming Language :: Python :: 3.14
28
+ Classifier: Programming Language :: Rust
29
+ Classifier: Topic :: Software Development :: Build Tools
30
+ Classifier: Topic :: System :: Filesystems
31
+ Classifier: Topic :: Utilities
32
+ Requires-Python: >=3.10
33
+ Description-Content-Type: text/markdown
34
+ License-File: LICENSE
35
+ Requires-Dist: certifi>=2024.7.4
36
+ Dynamic: license-file
37
+
38
+ # voom-cli
39
+
40
+ Fast, safe, parallel build-artifact pruning across every major language ecosystem.
41
+
42
+ ```bash
43
+ pip install voom-cli
44
+ voom --dry-run ~
45
+ ```
46
+
47
+ Or without installing:
48
+
49
+ ```bash
50
+ uvx --from voom-cli voom --dry-run ~
51
+ ```
52
+
53
+ The first run downloads the prebuilt `voom` binary for your platform from the
54
+ [GitHub release](https://github.com/Goldziher/voom/releases) matching this package's version
55
+ and caches it under `~/.cache/voom/`. Set `VOOM_BINARY` to point at your own build instead.
56
+
57
+ **voom deletes by default.** Use `--dry-run` to preview. It never removes a directory without
58
+ a marker file proving its ecosystem, and it never touches `node_modules/`.
59
+
60
+ Full documentation: <https://github.com/Goldziher/voom>
@@ -2,7 +2,11 @@ LICENSE
2
2
  README.md
3
3
  pyproject.toml
4
4
  voom/__init__.py
5
+ voom/cli.py
6
+ voom/downloader.py
5
7
  voom_cli.egg-info/PKG-INFO
6
8
  voom_cli.egg-info/SOURCES.txt
7
9
  voom_cli.egg-info/dependency_links.txt
10
+ voom_cli.egg-info/entry_points.txt
11
+ voom_cli.egg-info/requires.txt
8
12
  voom_cli.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ voom = voom.cli:main
@@ -0,0 +1 @@
1
+ certifi>=2024.7.4
voom_cli-0.0.0/PKG-INFO DELETED
@@ -1,32 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: voom-cli
3
- Version: 0.0.0
4
- Summary: Fast, safe, parallel build-artifact pruning across 20+ language ecosystems. Name placeholder — the first functional release is 0.1.0.
5
- Author-email: Na'aman Hirschfeld <nhirschfeld@gmail.com>
6
- License: MIT
7
- Project-URL: Homepage, https://github.com/Goldziher/voom
8
- Project-URL: Repository, https://github.com/Goldziher/voom.git
9
- Project-URL: Issues, https://github.com/Goldziher/voom/issues
10
- Keywords: cleanup,build,artifacts,disk-space,cli,prune,rust
11
- Classifier: Development Status :: 1 - Planning
12
- Classifier: Intended Audience :: Developers
13
- Classifier: License :: OSI Approved :: MIT License
14
- Classifier: Programming Language :: Python :: 3
15
- Classifier: Environment :: Console
16
- Classifier: Topic :: Utilities
17
- Requires-Python: >=3.8
18
- Description-Content-Type: text/markdown
19
- License-File: LICENSE
20
- Dynamic: license-file
21
-
22
- # voom-cli
23
-
24
- Fast, safe, parallel build-artifact pruning across 20+ language ecosystems.
25
-
26
- > Named for the substance in Little Cat Z's hat in *The Cat in the Hat Comes Back* —
27
- > the stuff that cleans up every last speck of pink snow in one go.
28
-
29
- **This `0.0.0` release is a name placeholder** and installs nothing. The first functional
30
- release is `0.1.0`.
31
-
32
- See <https://github.com/Goldziher/voom>.
voom_cli-0.0.0/README.md DELETED
@@ -1,11 +0,0 @@
1
- # voom-cli
2
-
3
- Fast, safe, parallel build-artifact pruning across 20+ language ecosystems.
4
-
5
- > Named for the substance in Little Cat Z's hat in *The Cat in the Hat Comes Back* —
6
- > the stuff that cleans up every last speck of pink snow in one go.
7
-
8
- **This `0.0.0` release is a name placeholder** and installs nothing. The first functional
9
- release is `0.1.0`.
10
-
11
- See <https://github.com/Goldziher/voom>.
@@ -1,29 +0,0 @@
1
- [build-system]
2
- requires = ["setuptools>=61.0", "wheel"]
3
- build-backend = "setuptools.build_meta"
4
-
5
- [project]
6
- name = "voom-cli"
7
- version = "0.0.0"
8
- description = "Fast, safe, parallel build-artifact pruning across 20+ language ecosystems. Name placeholder — the first functional release is 0.1.0."
9
- readme = "README.md"
10
- license = { text = "MIT" }
11
- authors = [{ name = "Na'aman Hirschfeld", email = "nhirschfeld@gmail.com" }]
12
- keywords = ["cleanup", "build", "artifacts", "disk-space", "cli", "prune", "rust"]
13
- requires-python = ">=3.8"
14
- classifiers = [
15
- "Development Status :: 1 - Planning",
16
- "Intended Audience :: Developers",
17
- "License :: OSI Approved :: MIT License",
18
- "Programming Language :: Python :: 3",
19
- "Environment :: Console",
20
- "Topic :: Utilities",
21
- ]
22
-
23
- [project.urls]
24
- Homepage = "https://github.com/Goldziher/voom"
25
- Repository = "https://github.com/Goldziher/voom.git"
26
- Issues = "https://github.com/Goldziher/voom/issues"
27
-
28
- [tool.setuptools]
29
- packages = ["voom"]
@@ -1 +0,0 @@
1
- __version__ = "0.0.0"
@@ -1,32 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: voom-cli
3
- Version: 0.0.0
4
- Summary: Fast, safe, parallel build-artifact pruning across 20+ language ecosystems. Name placeholder — the first functional release is 0.1.0.
5
- Author-email: Na'aman Hirschfeld <nhirschfeld@gmail.com>
6
- License: MIT
7
- Project-URL: Homepage, https://github.com/Goldziher/voom
8
- Project-URL: Repository, https://github.com/Goldziher/voom.git
9
- Project-URL: Issues, https://github.com/Goldziher/voom/issues
10
- Keywords: cleanup,build,artifacts,disk-space,cli,prune,rust
11
- Classifier: Development Status :: 1 - Planning
12
- Classifier: Intended Audience :: Developers
13
- Classifier: License :: OSI Approved :: MIT License
14
- Classifier: Programming Language :: Python :: 3
15
- Classifier: Environment :: Console
16
- Classifier: Topic :: Utilities
17
- Requires-Python: >=3.8
18
- Description-Content-Type: text/markdown
19
- License-File: LICENSE
20
- Dynamic: license-file
21
-
22
- # voom-cli
23
-
24
- Fast, safe, parallel build-artifact pruning across 20+ language ecosystems.
25
-
26
- > Named for the substance in Little Cat Z's hat in *The Cat in the Hat Comes Back* —
27
- > the stuff that cleans up every last speck of pink snow in one go.
28
-
29
- **This `0.0.0` release is a name placeholder** and installs nothing. The first functional
30
- release is `0.1.0`.
31
-
32
- See <https://github.com/Goldziher/voom>.
File without changes
File without changes