toolfuncs 0.3.2__tar.gz → 0.3.3__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.
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/PKG-INFO +1 -1
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/pyproject.toml +1 -1
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/src/toolfuncs/__init__.py +1 -1
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/src/toolfuncs/__main__.py +7 -0
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/tests/test_sdk_cli.py +9 -0
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/uv.lock +1 -1
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/.github/workflows/release.yml +0 -0
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/.gitignore +0 -0
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/.python-version +0 -0
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/README.md +0 -0
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/docs/contract.md +0 -0
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/src/toolfuncs/_errors.py +0 -0
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/src/toolfuncs/_import_path.py +0 -0
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/src/toolfuncs/_setup.py +0 -0
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/src/toolfuncs/_tools.py +0 -0
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/src/toolfuncs/agent_hooks.py +0 -0
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/src/toolfuncs/py.typed +0 -0
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/src/toolfuncs/sdk.py +0 -0
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/tests/__init__.py +0 -0
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/tests/conftest.py +0 -0
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/tests/test_agent_hooks.py +0 -0
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/tests/test_import_path.py +0 -0
- {toolfuncs-0.3.2 → toolfuncs-0.3.3}/tests/test_tools.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: toolfuncs
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: Executable typed Python function tools discovered through PATH
|
|
5
5
|
Project-URL: Repository, https://github.com/nimashoghi/toolfuncs
|
|
6
6
|
Project-URL: Issues, https://github.com/nimashoghi/toolfuncs/issues
|
|
@@ -11,6 +11,7 @@ from typing import Any
|
|
|
11
11
|
|
|
12
12
|
from pydantic_core import to_jsonable_python
|
|
13
13
|
|
|
14
|
+
from . import __version__
|
|
14
15
|
from ._setup import setup
|
|
15
16
|
from ._tools import (
|
|
16
17
|
ALLOW_FLOATING_VCS_SHEBANG,
|
|
@@ -24,6 +25,7 @@ from .sdk import _run
|
|
|
24
25
|
|
|
25
26
|
_HELP = f"""\
|
|
26
27
|
Usage:
|
|
28
|
+
toolfuncs --version
|
|
27
29
|
toolfuncs list
|
|
28
30
|
toolfuncs setup [--bin-dir DIRECTORY]
|
|
29
31
|
|
|
@@ -42,6 +44,11 @@ def main(argv: Sequence[str] | None = None) -> int:
|
|
|
42
44
|
if not tokens or tokens[0] in {"-h", "--help", "help"}:
|
|
43
45
|
print(_HELP, end="")
|
|
44
46
|
return 0
|
|
47
|
+
if tokens[0] in {"-V", "--version"}:
|
|
48
|
+
if len(tokens) != 1:
|
|
49
|
+
raise SystemExit("toolfuncs --version accepts no arguments")
|
|
50
|
+
print(__version__)
|
|
51
|
+
return 0
|
|
45
52
|
|
|
46
53
|
command = tokens.pop(0)
|
|
47
54
|
if command == "__run-source":
|
|
@@ -25,6 +25,15 @@ from .conftest import run_python
|
|
|
25
25
|
_INSTALL_HOOKS = setup_impl._install_hooks
|
|
26
26
|
|
|
27
27
|
|
|
28
|
+
@pytest.mark.parametrize("flag", ["--version", "-V"])
|
|
29
|
+
def test_cli_prints_installed_version(tmp_path: Path, flag: str) -> None:
|
|
30
|
+
completed = run_python(["-m", "toolfuncs", flag], cwd=tmp_path)
|
|
31
|
+
|
|
32
|
+
assert completed.returncode == 0
|
|
33
|
+
assert completed.stdout == "0.3.3\n"
|
|
34
|
+
assert completed.stderr == ""
|
|
35
|
+
|
|
36
|
+
|
|
28
37
|
@pytest.fixture(autouse=True)
|
|
29
38
|
def _avoid_installing_live_agent_hooks(monkeypatch: pytest.MonkeyPatch) -> None:
|
|
30
39
|
monkeypatch.setattr(setup_impl, "_install_hooks", lambda _hook_wrapper: None)
|
|
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
|