cloudcosttree 0.1.35__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,48 @@
1
+ Metadata-Version: 2.4
2
+ Name: cloudcosttree
3
+ Version: 0.1.35
4
+ Summary: Estimate AWS infrastructure costs in a hierarchical tree before you apply
5
+ Author: CloudCostTree
6
+ License: Proprietary
7
+ Project-URL: Homepage, https://cloudcosttree.com
8
+ Project-URL: Repository, https://github.com/rulssss/cloudcosttree
9
+ Classifier: Environment :: Console
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: System Administrators
12
+ Classifier: Operating System :: MacOS
13
+ Classifier: Operating System :: POSIX :: Linux
14
+ Classifier: Operating System :: Microsoft :: Windows
15
+ Classifier: Topic :: Utilities
16
+ Requires-Python: >=3.8
17
+ Description-Content-Type: text/markdown
18
+
19
+ # cloudcosttree (pip)
20
+
21
+ `pip install cloudcosttree` — a thin wrapper that downloads and runs the real
22
+ [CloudCostTree](https://cloudcosttree.com) CLI (a Go binary, published at
23
+ [rulssss/cloudcosttree](https://github.com/rulssss/cloudcosttree)) on first
24
+ use. This package isn't a reimplementation; every `cloudcosttree` command
25
+ just execs the real binary.
26
+
27
+ ## Install
28
+
29
+ ```sh
30
+ pip install cloudcosttree
31
+ ```
32
+
33
+ The first `cloudcosttree` invocation downloads the matching platform binary
34
+ (and the bundled price catalog) into `~/.cloudcosttree/` — the same
35
+ directory `install.sh`/Homebrew installs already use. No AWS account or
36
+ credentials needed for a plain `analyze`/`tree`/`diff` run.
37
+
38
+ ## Upgrading
39
+
40
+ ```sh
41
+ pip install --upgrade cloudcosttree
42
+ ```
43
+
44
+ Downloads the CLI version matching the new package version on next run —
45
+ same as any other pip package's upgrade.
46
+
47
+ See the [main repo](https://github.com/rulssss/cloudcosttree#readme) for
48
+ full CLI documentation.
@@ -0,0 +1,30 @@
1
+ # cloudcosttree (pip)
2
+
3
+ `pip install cloudcosttree` — a thin wrapper that downloads and runs the real
4
+ [CloudCostTree](https://cloudcosttree.com) CLI (a Go binary, published at
5
+ [rulssss/cloudcosttree](https://github.com/rulssss/cloudcosttree)) on first
6
+ use. This package isn't a reimplementation; every `cloudcosttree` command
7
+ just execs the real binary.
8
+
9
+ ## Install
10
+
11
+ ```sh
12
+ pip install cloudcosttree
13
+ ```
14
+
15
+ The first `cloudcosttree` invocation downloads the matching platform binary
16
+ (and the bundled price catalog) into `~/.cloudcosttree/` — the same
17
+ directory `install.sh`/Homebrew installs already use. No AWS account or
18
+ credentials needed for a plain `analyze`/`tree`/`diff` run.
19
+
20
+ ## Upgrading
21
+
22
+ ```sh
23
+ pip install --upgrade cloudcosttree
24
+ ```
25
+
26
+ Downloads the CLI version matching the new package version on next run —
27
+ same as any other pip package's upgrade.
28
+
29
+ See the [main repo](https://github.com/rulssss/cloudcosttree#readme) for
30
+ full CLI documentation.
@@ -0,0 +1,31 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "cloudcosttree"
7
+ version = "0.1.35"
8
+ description = "Estimate AWS infrastructure costs in a hierarchical tree before you apply"
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = { text = "Proprietary" }
12
+ authors = [{ name = "CloudCostTree" }]
13
+ classifiers = [
14
+ "Environment :: Console",
15
+ "Intended Audience :: Developers",
16
+ "Intended Audience :: System Administrators",
17
+ "Operating System :: MacOS",
18
+ "Operating System :: POSIX :: Linux",
19
+ "Operating System :: Microsoft :: Windows",
20
+ "Topic :: Utilities",
21
+ ]
22
+
23
+ [project.urls]
24
+ Homepage = "https://cloudcosttree.com"
25
+ Repository = "https://github.com/rulssss/cloudcosttree"
26
+
27
+ [project.scripts]
28
+ cloudcosttree = "cloudcosttree.launcher:main"
29
+
30
+ [tool.setuptools.packages.find]
31
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,5 @@
1
+ # Kept in lockstep with the CLI release tag this package's launcher
2
+ # downloads (see launcher.py) -- `pip install --upgrade cloudcosttree`
3
+ # bumping this is what triggers a fresh binary download, the same way
4
+ # any other pip package's upgrade mechanism works.
5
+ __version__ = "0.1.35"
@@ -0,0 +1,111 @@
1
+ """Resolves (downloading on first use if needed) and execs the real
2
+ cloudcosttree CLI binary -- this package is a thin pip-installable wrapper
3
+ around the Go binary published at github.com/rulssss/cloudcosttree/releases,
4
+ not a reimplementation. Mirrors the same "resolve or download" pattern the
5
+ VS Code extension's binaryInstaller.ts already uses, simplified: no
6
+ background update-checking here -- `pip install --upgrade cloudcosttree`
7
+ bumping __version__ is what triggers a fresh binary download, matching
8
+ ordinary pip upgrade semantics instead of a bespoke self-updater.
9
+ """
10
+
11
+ from __future__ import annotations
12
+
13
+ import platform
14
+ import shutil
15
+ import stat
16
+ import subprocess
17
+ import sys
18
+ import urllib.request
19
+ from pathlib import Path
20
+
21
+ from . import __version__
22
+
23
+ RELEASES_REPO = "rulssss/cloudcosttree"
24
+
25
+ # Same platform/arch -> release-asset-name convention install.sh and the
26
+ # VS Code extension's binaryInstaller.ts both already use.
27
+ _OS_NAMES = {"Darwin": "darwin", "Linux": "linux", "Windows": "windows"}
28
+ _ARCH_NAMES = {
29
+ "x86_64": "amd64",
30
+ "amd64": "amd64",
31
+ "AMD64": "amd64",
32
+ "arm64": "arm64",
33
+ "aarch64": "arm64",
34
+ "ARM64": "arm64",
35
+ }
36
+
37
+
38
+ def _release_asset_name() -> str:
39
+ os_name = _OS_NAMES.get(platform.system())
40
+ arch_name = _ARCH_NAMES.get(platform.machine())
41
+ if not os_name or not arch_name:
42
+ raise RuntimeError(
43
+ f"cloudcosttree has no prebuilt binary for {platform.system()}/{platform.machine()}. "
44
+ f"Install it manually: see https://github.com/{RELEASES_REPO}#readme"
45
+ )
46
+ ext = ".exe" if os_name == "windows" else ""
47
+ return f"cloudcosttree-{os_name}-{arch_name}{ext}"
48
+
49
+
50
+ def _home_dir() -> Path:
51
+ # Matches pkg/cost/catalog.go's homeCatalogDir() convention exactly
52
+ # (~/.cloudcosttree) -- the same directory the Go binary itself already
53
+ # falls back to for prices.json, so a pip-installed and a
54
+ # brew/install.sh-installed cloudcosttree on the same machine share
55
+ # one cache location instead of each keeping a separate copy.
56
+ return Path.home() / ".cloudcosttree"
57
+
58
+
59
+ def _binary_path() -> Path:
60
+ asset = _release_asset_name()
61
+ ext = ".exe" if asset.endswith(".exe") else ""
62
+ # Version-suffixed filename: upgrading the pip package (which bumps
63
+ # __version__) naturally points at a not-yet-downloaded path, so there's
64
+ # no separate metadata file to track "is this stale" -- the filename
65
+ # itself answers that.
66
+ return _home_dir() / "bin" / f"cloudcosttree-{__version__}{ext}"
67
+
68
+
69
+ def _download(url: str, dest: Path) -> None:
70
+ dest.parent.mkdir(parents=True, exist_ok=True)
71
+ tmp = dest.with_suffix(dest.suffix + ".download")
72
+ try:
73
+ with urllib.request.urlopen(url) as resp, open(tmp, "wb") as f:
74
+ shutil.copyfileobj(resp, f)
75
+ except Exception as err:
76
+ tmp.unlink(missing_ok=True)
77
+ raise RuntimeError(
78
+ f"could not download {url} ({err}). Check your network connection, "
79
+ f"or install cloudcosttree manually: https://github.com/{RELEASES_REPO}#readme"
80
+ ) from err
81
+ tmp.replace(dest)
82
+
83
+
84
+ def _ensure_binary() -> Path:
85
+ binary = _binary_path()
86
+ if binary.exists():
87
+ return binary
88
+
89
+ asset = _release_asset_name()
90
+ print(f"cloudcosttree: downloading the CLI binary (v{__version__}, first run only)...", file=sys.stderr)
91
+ _download(f"https://github.com/{RELEASES_REPO}/releases/download/v{__version__}/{asset}", binary)
92
+ if platform.system() != "Windows":
93
+ binary.chmod(binary.stat().st_mode | stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH)
94
+
95
+ prices = _home_dir() / "prices.json"
96
+ try:
97
+ _download(f"https://github.com/{RELEASES_REPO}/releases/download/v{__version__}/prices.json", prices)
98
+ except RuntimeError as err:
99
+ # Non-fatal: DefaultPricesPath() will fall back to whatever
100
+ # `cloudcosttree update-prices` (network, no AWS account needed)
101
+ # or a --prices flag supplies instead -- same soft-degrade the CLI
102
+ # itself already applies to every other missing-data case.
103
+ print(f"cloudcosttree: warning: {err}", file=sys.stderr)
104
+
105
+ return binary
106
+
107
+
108
+ def main() -> None:
109
+ binary = _ensure_binary()
110
+ result = subprocess.run([str(binary), *sys.argv[1:]])
111
+ sys.exit(result.returncode)
@@ -0,0 +1,48 @@
1
+ Metadata-Version: 2.4
2
+ Name: cloudcosttree
3
+ Version: 0.1.35
4
+ Summary: Estimate AWS infrastructure costs in a hierarchical tree before you apply
5
+ Author: CloudCostTree
6
+ License: Proprietary
7
+ Project-URL: Homepage, https://cloudcosttree.com
8
+ Project-URL: Repository, https://github.com/rulssss/cloudcosttree
9
+ Classifier: Environment :: Console
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: System Administrators
12
+ Classifier: Operating System :: MacOS
13
+ Classifier: Operating System :: POSIX :: Linux
14
+ Classifier: Operating System :: Microsoft :: Windows
15
+ Classifier: Topic :: Utilities
16
+ Requires-Python: >=3.8
17
+ Description-Content-Type: text/markdown
18
+
19
+ # cloudcosttree (pip)
20
+
21
+ `pip install cloudcosttree` — a thin wrapper that downloads and runs the real
22
+ [CloudCostTree](https://cloudcosttree.com) CLI (a Go binary, published at
23
+ [rulssss/cloudcosttree](https://github.com/rulssss/cloudcosttree)) on first
24
+ use. This package isn't a reimplementation; every `cloudcosttree` command
25
+ just execs the real binary.
26
+
27
+ ## Install
28
+
29
+ ```sh
30
+ pip install cloudcosttree
31
+ ```
32
+
33
+ The first `cloudcosttree` invocation downloads the matching platform binary
34
+ (and the bundled price catalog) into `~/.cloudcosttree/` — the same
35
+ directory `install.sh`/Homebrew installs already use. No AWS account or
36
+ credentials needed for a plain `analyze`/`tree`/`diff` run.
37
+
38
+ ## Upgrading
39
+
40
+ ```sh
41
+ pip install --upgrade cloudcosttree
42
+ ```
43
+
44
+ Downloads the CLI version matching the new package version on next run —
45
+ same as any other pip package's upgrade.
46
+
47
+ See the [main repo](https://github.com/rulssss/cloudcosttree#readme) for
48
+ full CLI documentation.
@@ -0,0 +1,9 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/cloudcosttree/__init__.py
4
+ src/cloudcosttree/launcher.py
5
+ src/cloudcosttree.egg-info/PKG-INFO
6
+ src/cloudcosttree.egg-info/SOURCES.txt
7
+ src/cloudcosttree.egg-info/dependency_links.txt
8
+ src/cloudcosttree.egg-info/entry_points.txt
9
+ src/cloudcosttree.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ cloudcosttree = cloudcosttree.launcher:main
@@ -0,0 +1 @@
1
+ cloudcosttree