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.
Files changed (23) hide show
  1. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/PKG-INFO +1 -1
  2. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/pyproject.toml +1 -1
  3. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/src/toolfuncs/__init__.py +1 -1
  4. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/src/toolfuncs/__main__.py +7 -0
  5. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/tests/test_sdk_cli.py +9 -0
  6. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/uv.lock +1 -1
  7. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/.github/workflows/release.yml +0 -0
  8. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/.gitignore +0 -0
  9. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/.python-version +0 -0
  10. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/README.md +0 -0
  11. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/docs/contract.md +0 -0
  12. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/src/toolfuncs/_errors.py +0 -0
  13. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/src/toolfuncs/_import_path.py +0 -0
  14. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/src/toolfuncs/_setup.py +0 -0
  15. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/src/toolfuncs/_tools.py +0 -0
  16. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/src/toolfuncs/agent_hooks.py +0 -0
  17. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/src/toolfuncs/py.typed +0 -0
  18. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/src/toolfuncs/sdk.py +0 -0
  19. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/tests/__init__.py +0 -0
  20. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/tests/conftest.py +0 -0
  21. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/tests/test_agent_hooks.py +0 -0
  22. {toolfuncs-0.3.2 → toolfuncs-0.3.3}/tests/test_import_path.py +0 -0
  23. {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.2
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "toolfuncs"
3
- version = "0.3.2"
3
+ version = "0.3.3"
4
4
  description = "Executable typed Python function tools discovered through PATH"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -29,7 +29,7 @@ from .sdk import (
29
29
  validators,
30
30
  )
31
31
 
32
- __version__ = "0.3.2"
32
+ __version__ = "0.3.3"
33
33
 
34
34
  __all__ = [
35
35
  "ALLOW_FLOATING_VCS_SHEBANG",
@@ -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)
@@ -601,7 +601,7 @@ wheels = [
601
601
 
602
602
  [[package]]
603
603
  name = "toolfuncs"
604
- version = "0.3.2"
604
+ version = "0.3.3"
605
605
  source = { editable = "." }
606
606
  dependencies = [
607
607
  { name = "cyclopts" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes