ragbits-cli 1.0.0__tar.gz → 1.2.0__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.
- {ragbits_cli-1.0.0 → ragbits_cli-1.2.0}/.gitignore +4 -0
- {ragbits_cli-1.0.0 → ragbits_cli-1.2.0}/CHANGELOG.md +12 -0
- {ragbits_cli-1.0.0 → ragbits_cli-1.2.0}/PKG-INFO +2 -2
- {ragbits_cli-1.0.0 → ragbits_cli-1.2.0}/pyproject.toml +2 -2
- ragbits_cli-1.2.0/tests/unit/test_utils.py +38 -0
- {ragbits_cli-1.0.0 → ragbits_cli-1.2.0}/README.md +0 -0
- {ragbits_cli-1.0.0 → ragbits_cli-1.2.0}/src/ragbits/cli/__init__.py +0 -0
- {ragbits_cli-1.0.0 → ragbits_cli-1.2.0}/src/ragbits/cli/_utils.py +0 -0
- {ragbits_cli-1.0.0 → ragbits_cli-1.2.0}/src/ragbits/cli/py.typed +0 -0
- {ragbits_cli-1.0.0 → ragbits_cli-1.2.0}/src/ragbits/cli/state.py +0 -0
- {ragbits_cli-1.0.0 → ragbits_cli-1.2.0}/tests/unit/test_state.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ragbits-cli
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: A CLI application for ragbits - building blocks for rapid development of GenAI applications
|
|
5
5
|
Project-URL: Homepage, https://github.com/deepsense-ai/ragbits
|
|
6
6
|
Project-URL: Bug Reports, https://github.com/deepsense-ai/ragbits/issues
|
|
@@ -22,7 +22,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
22
22
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
23
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
24
|
Requires-Python: >=3.10
|
|
25
|
-
Requires-Dist: ragbits-core==1.
|
|
25
|
+
Requires-Dist: ragbits-core==1.2.0
|
|
26
26
|
Requires-Dist: typer<1.0.0,>=0.12.5
|
|
27
27
|
Description-Content-Type: text/markdown
|
|
28
28
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "ragbits-cli"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.2.0"
|
|
4
4
|
description = "A CLI application for ragbits - building blocks for rapid development of GenAI applications"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
@@ -31,7 +31,7 @@ classifiers = [
|
|
|
31
31
|
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
32
32
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
33
33
|
]
|
|
34
|
-
dependencies = ["typer>=0.12.5,<1.0.0", "ragbits-core==1.
|
|
34
|
+
dependencies = ["typer>=0.12.5,<1.0.0", "ragbits-core==1.2.0"]
|
|
35
35
|
|
|
36
36
|
[project.urls]
|
|
37
37
|
"Homepage" = "https://github.com/deepsense-ai/ragbits"
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
|
|
3
|
+
from ragbits.cli._utils import get_instance_or_exit
|
|
4
|
+
from ragbits.core.utils.config_handling import WithConstructionConfig
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ExampleClassForCLI(WithConstructionConfig):
|
|
8
|
+
default_module = sys.modules[__name__]
|
|
9
|
+
configuration_key = "example_cli"
|
|
10
|
+
|
|
11
|
+
def __init__(self, foo: str, bar: int) -> None:
|
|
12
|
+
self.foo = foo
|
|
13
|
+
self.bar = bar
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def sync_factory_for_cli() -> ExampleClassForCLI:
|
|
17
|
+
return ExampleClassForCLI("sync_cli", 123)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
async def async_factory_for_cli() -> ExampleClassForCLI:
|
|
21
|
+
"""Async factory function for testing CLI with async support."""
|
|
22
|
+
return ExampleClassForCLI("async_cli", 456)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def test_get_instance_or_exit_with_sync_factory():
|
|
26
|
+
"""Test that get_instance_or_exit works with sync factory functions."""
|
|
27
|
+
instance = get_instance_or_exit(ExampleClassForCLI, factory_path="sync_factory_for_cli")
|
|
28
|
+
assert isinstance(instance, ExampleClassForCLI)
|
|
29
|
+
assert instance.foo == "sync_cli"
|
|
30
|
+
assert instance.bar == 123
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def test_get_instance_or_exit_with_async_factory():
|
|
34
|
+
"""Test that get_instance_or_exit works with async factory functions."""
|
|
35
|
+
instance = get_instance_or_exit(ExampleClassForCLI, factory_path="async_factory_for_cli")
|
|
36
|
+
assert isinstance(instance, ExampleClassForCLI)
|
|
37
|
+
assert instance.foo == "async_cli"
|
|
38
|
+
assert instance.bar == 456
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|