arga-cli 0.1.3__tar.gz → 0.1.4__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.3 → arga_cli-0.1.4}/PKG-INFO +1 -1
- {arga_cli-0.1.3 → arga_cli-0.1.4}/arga_cli/main.py +13 -0
- {arga_cli-0.1.3 → arga_cli-0.1.4}/arga_cli.egg-info/PKG-INFO +1 -1
- {arga_cli-0.1.3 → arga_cli-0.1.4}/pyproject.toml +1 -1
- {arga_cli-0.1.3 → arga_cli-0.1.4}/tests/test_cli_validate_config.py +14 -0
- {arga_cli-0.1.3 → arga_cli-0.1.4}/README.md +0 -0
- {arga_cli-0.1.3 → arga_cli-0.1.4}/arga_cli/__init__.py +0 -0
- {arga_cli-0.1.3 → arga_cli-0.1.4}/arga_cli/mcp.py +0 -0
- {arga_cli-0.1.3 → arga_cli-0.1.4}/arga_cli.egg-info/SOURCES.txt +0 -0
- {arga_cli-0.1.3 → arga_cli-0.1.4}/arga_cli.egg-info/dependency_links.txt +0 -0
- {arga_cli-0.1.3 → arga_cli-0.1.4}/arga_cli.egg-info/entry_points.txt +0 -0
- {arga_cli-0.1.3 → arga_cli-0.1.4}/arga_cli.egg-info/requires.txt +0 -0
- {arga_cli-0.1.3 → arga_cli-0.1.4}/arga_cli.egg-info/top_level.txt +0 -0
- {arga_cli-0.1.3 → arga_cli-0.1.4}/setup.cfg +0 -0
- {arga_cli-0.1.3 → arga_cli-0.1.4}/tests/test_cli_git.py +0 -0
- {arga_cli-0.1.3 → arga_cli-0.1.4}/tests/test_cli_mcp.py +0 -0
- {arga_cli-0.1.3 → arga_cli-0.1.4}/tests/test_cli_runs.py +0 -0
- {arga_cli-0.1.3 → arga_cli-0.1.4}/tests/test_cli_scan.py +0 -0
- {arga_cli-0.1.3 → arga_cli-0.1.4}/tests/test_cli_test_url.py +0 -0
- {arga_cli-0.1.3 → arga_cli-0.1.4}/tests/test_cli_validate_pr.py +0 -0
|
@@ -10,6 +10,7 @@ import tempfile
|
|
|
10
10
|
import time
|
|
11
11
|
import webbrowser
|
|
12
12
|
from datetime import datetime
|
|
13
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
13
14
|
from pathlib import Path
|
|
14
15
|
from typing import Any
|
|
15
16
|
from urllib.parse import urlencode
|
|
@@ -27,6 +28,13 @@ POLL_TIMEOUT_SECONDS = 600.0
|
|
|
27
28
|
SKIP_TRAILER = "[skip arga]"
|
|
28
29
|
|
|
29
30
|
|
|
31
|
+
def _cli_version() -> str:
|
|
32
|
+
try:
|
|
33
|
+
return version("arga-cli")
|
|
34
|
+
except PackageNotFoundError:
|
|
35
|
+
return "unknown"
|
|
36
|
+
|
|
37
|
+
|
|
30
38
|
class CliError(Exception):
|
|
31
39
|
"""Base CLI error."""
|
|
32
40
|
|
|
@@ -1240,6 +1248,11 @@ def run_wizard(args: argparse.Namespace) -> int:
|
|
|
1240
1248
|
|
|
1241
1249
|
def build_parser() -> argparse.ArgumentParser:
|
|
1242
1250
|
parser = argparse.ArgumentParser(prog="arga")
|
|
1251
|
+
parser.add_argument(
|
|
1252
|
+
"--version",
|
|
1253
|
+
action="version",
|
|
1254
|
+
version=f"%(prog)s {_cli_version()}",
|
|
1255
|
+
)
|
|
1243
1256
|
subparsers = parser.add_subparsers(dest="command", required=True)
|
|
1244
1257
|
|
|
1245
1258
|
login_parser = subparsers.add_parser("login", help="Authenticate the CLI")
|
|
@@ -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.4"
|
|
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"
|
|
@@ -127,3 +127,17 @@ def test_main_dispatches_validate_wrapper_before_argparse(monkeypatch) -> None:
|
|
|
127
127
|
raise AssertionError("Expected main() to exit")
|
|
128
128
|
|
|
129
129
|
assert captured["argv"] == ["config", "arga-labs/validation-server"]
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def test_main_supports_global_version_flag(monkeypatch, capsys) -> None:
|
|
133
|
+
monkeypatch.setattr(main, "_cli_version", lambda: "0.1.3")
|
|
134
|
+
monkeypatch.setattr(sys, "argv", ["arga", "--version"])
|
|
135
|
+
|
|
136
|
+
try:
|
|
137
|
+
main.main()
|
|
138
|
+
except SystemExit as exc:
|
|
139
|
+
assert exc.code == 0
|
|
140
|
+
else:
|
|
141
|
+
raise AssertionError("Expected main() to exit")
|
|
142
|
+
|
|
143
|
+
assert capsys.readouterr().out.strip() == "arga 0.1.3"
|
|
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
|