arga-cli 0.1.8__tar.gz → 0.1.9__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.
- {arga_cli-0.1.8 → arga_cli-0.1.9}/PKG-INFO +1 -1
- {arga_cli-0.1.8 → arga_cli-0.1.9}/arga_cli/main.py +39 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/arga_cli.egg-info/PKG-INFO +1 -1
- {arga_cli-0.1.8 → arga_cli-0.1.9}/pyproject.toml +1 -1
- {arga_cli-0.1.8 → arga_cli-0.1.9}/README.md +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/arga_cli/__init__.py +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/arga_cli/mcp.py +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/arga_cli/wizard/__init__.py +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/arga_cli/wizard/constants.py +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/arga_cli/wizard/env.py +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/arga_cli/wizard/output.py +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/arga_cli/wizard/prompts.py +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/arga_cli/wizard/provision.py +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/arga_cli/wizard/session.py +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/arga_cli/wizard/summary.py +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/arga_cli.egg-info/SOURCES.txt +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/arga_cli.egg-info/dependency_links.txt +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/arga_cli.egg-info/entry_points.txt +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/arga_cli.egg-info/requires.txt +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/arga_cli.egg-info/top_level.txt +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/setup.cfg +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/tests/test_cli_git.py +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/tests/test_cli_mcp.py +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/tests/test_cli_runs.py +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/tests/test_cli_test_url.py +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/tests/test_cli_validate_config.py +0 -0
- {arga_cli-0.1.8 → arga_cli-0.1.9}/tests/test_cli_validate_pr.py +0 -0
|
@@ -36,6 +36,44 @@ def _cli_version() -> str:
|
|
|
36
36
|
return "unknown"
|
|
37
37
|
|
|
38
38
|
|
|
39
|
+
VERSION_CHECK_PATH = Path.home() / ".config" / "arga" / "version_check.json"
|
|
40
|
+
VERSION_CHECK_TTL_SECONDS = 86400 # 24 hours
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _check_for_update() -> None:
|
|
44
|
+
"""Print a warning if a newer version is available on PyPI. Caches for 24h."""
|
|
45
|
+
try:
|
|
46
|
+
current = _cli_version()
|
|
47
|
+
if current == "unknown":
|
|
48
|
+
return
|
|
49
|
+
|
|
50
|
+
now = time.time()
|
|
51
|
+
cached_latest: str | None = None
|
|
52
|
+
if VERSION_CHECK_PATH.exists():
|
|
53
|
+
data = json.loads(VERSION_CHECK_PATH.read_text())
|
|
54
|
+
if now - data.get("checked_at", 0) < VERSION_CHECK_TTL_SECONDS:
|
|
55
|
+
cached_latest = data.get("latest")
|
|
56
|
+
|
|
57
|
+
if cached_latest is None:
|
|
58
|
+
resp = httpx.get("https://pypi.org/pypi/arga-cli/json", timeout=3.0)
|
|
59
|
+
resp.raise_for_status()
|
|
60
|
+
cached_latest = resp.json()["info"]["version"]
|
|
61
|
+
VERSION_CHECK_PATH.parent.mkdir(parents=True, exist_ok=True)
|
|
62
|
+
VERSION_CHECK_PATH.write_text(json.dumps({"latest": cached_latest, "checked_at": now}))
|
|
63
|
+
|
|
64
|
+
if cached_latest and cached_latest != current:
|
|
65
|
+
latest_parts = tuple(int(x) for x in cached_latest.split("."))
|
|
66
|
+
current_parts = tuple(int(x) for x in current.split("."))
|
|
67
|
+
if latest_parts > current_parts:
|
|
68
|
+
print(
|
|
69
|
+
f"\033[33mwarning: arga-cli {cached_latest} available (you have {current}). "
|
|
70
|
+
f"Update with: uv tool upgrade arga-cli\033[0m",
|
|
71
|
+
file=sys.stderr,
|
|
72
|
+
)
|
|
73
|
+
except Exception:
|
|
74
|
+
pass
|
|
75
|
+
|
|
76
|
+
|
|
39
77
|
class CliError(Exception):
|
|
40
78
|
"""Base CLI error."""
|
|
41
79
|
|
|
@@ -1743,6 +1781,7 @@ def main() -> None:
|
|
|
1743
1781
|
except httpx.HTTPError as exc:
|
|
1744
1782
|
print(f"Network error: {exc}", file=sys.stderr)
|
|
1745
1783
|
raise SystemExit(1) from exc
|
|
1784
|
+
_check_for_update()
|
|
1746
1785
|
raise SystemExit(exit_code)
|
|
1747
1786
|
|
|
1748
1787
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "arga-cli"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.9"
|
|
8
8
|
description = "Command-line interface for Arga authentication, MCP installation, and browser validation"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.12"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|