nacho-python 0.0.1__tar.gz → 0.0.2__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.
- {nacho_python-0.0.1/nacho_python.egg-info → nacho_python-0.0.2}/PKG-INFO +8 -8
- {nacho_python-0.0.1 → nacho_python-0.0.2}/README.md +7 -7
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/__init__.py +2 -2
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/_version.py +1 -1
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/schema.py +3 -3
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/server/__init__.py +2 -2
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/server/app.py +8 -2
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/storage/__init__.py +1 -1
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/utils/io.py +2 -2
- {nacho_python-0.0.1 → nacho_python-0.0.2/nacho_python.egg-info}/PKG-INFO +8 -8
- {nacho_python-0.0.1 → nacho_python-0.0.2}/pyproject.toml +3 -2
- {nacho_python-0.0.1 → nacho_python-0.0.2}/LICENSE +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/MANIFEST.in +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/cli/__init__.py +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/cli/main.py +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/config.py +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/env.py +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/event.py +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/server/auth.py +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/server/models.py +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/server/runtime.py +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/server/ui/index.html +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/storage/base.py +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/storage/file.py +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/storage/remote.py +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/utils/__init__.py +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho/utils/path.py +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho_python.egg-info/SOURCES.txt +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho_python.egg-info/dependency_links.txt +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho_python.egg-info/entry_points.txt +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho_python.egg-info/requires.txt +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/nacho_python.egg-info/top_level.txt +0 -0
- {nacho_python-0.0.1 → nacho_python-0.0.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nacho-python
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.2
|
|
4
4
|
Summary: Nacho - Lightweight, schema-first dynamic configuration service
|
|
5
5
|
Author-email: "Nya Foundation Team (k3scat)" <k3scat@github.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -45,15 +45,15 @@ Dynamic: license-file
|
|
|
45
45
|
|
|
46
46
|
# Nacho
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
<div align="center">
|
|
49
|
+
|
|
50
|
+
<pre>
|
|
51
|
+
_ _ _ ____ _ _ ___
|
|
52
|
+
| \ | | / \ / ___|| | | | / _ \
|
|
51
53
|
| \| | / _ \ | | | |_| || | | |
|
|
52
54
|
| |\ | / ___ \ | |___ | _ || |_| |
|
|
53
|
-
|_| \_|/_/ \_\ \____||_| |_| \___/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<div align="center">
|
|
55
|
+
|_| \_|/_/ \_\ \____||_| |_| \___/
|
|
56
|
+
</pre>
|
|
57
57
|
|
|
58
58
|
<h3>Lightweight, schema-first dynamic configuration service for Python.</h3>
|
|
59
59
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# Nacho
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
<pre>
|
|
6
|
+
_ _ _ ____ _ _ ___
|
|
7
|
+
| \ | | / \ / ___|| | | | / _ \
|
|
6
8
|
| \| | / _ \ | | | |_| || | | |
|
|
7
9
|
| |\ | / ___ \ | |___ | _ || |_| |
|
|
8
|
-
|_| \_|/_/ \_\ \____||_| |_| \___/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<div align="center">
|
|
10
|
+
|_| \_|/_/ \_\ \____||_| |_| \___/
|
|
11
|
+
</pre>
|
|
12
12
|
|
|
13
13
|
<h3>Lightweight, schema-first dynamic configuration service for Python.</h3>
|
|
14
14
|
|
|
@@ -13,14 +13,14 @@ from .storage import (
|
|
|
13
13
|
|
|
14
14
|
try:
|
|
15
15
|
from .storage import RemoteStorageBackend
|
|
16
|
-
except ImportError:
|
|
16
|
+
except ImportError: # pragma: no cover - optional 'remote' extra not installed
|
|
17
17
|
pass
|
|
18
18
|
|
|
19
19
|
try:
|
|
20
20
|
from .server.app import NachoOrchestrator
|
|
21
21
|
|
|
22
22
|
HAS_SERVER_DEPS = True
|
|
23
|
-
except ImportError:
|
|
23
|
+
except ImportError: # pragma: no cover - optional 'server' extra not installed
|
|
24
24
|
HAS_SERVER_DEPS = False
|
|
25
25
|
|
|
26
26
|
__all__ = [
|
|
@@ -19,7 +19,7 @@ try:
|
|
|
19
19
|
from jsonschema import validators as _jv
|
|
20
20
|
|
|
21
21
|
HAS_SCHEMA_DEPS = True
|
|
22
|
-
except ImportError:
|
|
22
|
+
except ImportError: # pragma: no cover - optional 'schema' extra not installed
|
|
23
23
|
HAS_SCHEMA_DEPS = False
|
|
24
24
|
|
|
25
25
|
|
|
@@ -108,13 +108,13 @@ class SchemaValidator:
|
|
|
108
108
|
import yaml
|
|
109
109
|
|
|
110
110
|
return yaml.safe_load(path.read_text(encoding="utf-8")) or {}
|
|
111
|
-
except ImportError:
|
|
111
|
+
except ImportError: # pragma: no cover - pyyaml is a core dependency
|
|
112
112
|
raise ImportError("YAML schema files require 'pyyaml'.")
|
|
113
113
|
|
|
114
114
|
if suffix == ".toml":
|
|
115
115
|
try:
|
|
116
116
|
import tomllib # type: ignore
|
|
117
|
-
except ImportError:
|
|
117
|
+
except ImportError: # pragma: no cover - Python < 3.11 fallback
|
|
118
118
|
import tomli as tomllib # type: ignore
|
|
119
119
|
return tomllib.loads(path.read_text(encoding="utf-8")) or {}
|
|
120
120
|
|
|
@@ -10,13 +10,13 @@ try:
|
|
|
10
10
|
import uvicorn
|
|
11
11
|
|
|
12
12
|
HAS_SERVER_DEPS = True
|
|
13
|
-
except ImportError:
|
|
13
|
+
except ImportError: # pragma: no cover - optional 'server' extra not installed
|
|
14
14
|
HAS_SERVER_DEPS = False
|
|
15
15
|
|
|
16
16
|
# Only import if dependencies are available
|
|
17
17
|
if HAS_SERVER_DEPS:
|
|
18
18
|
from .app import NachoOrchestrator
|
|
19
|
-
else:
|
|
19
|
+
else: # pragma: no cover - optional 'server' extra not installed
|
|
20
20
|
# Define a placeholder class that raises ImportError when instantiated
|
|
21
21
|
class NachoOrchestrator:
|
|
22
22
|
"""Placeholder class for NachoOrchestrator.
|
|
@@ -18,6 +18,7 @@ from nacho.config import Nacho
|
|
|
18
18
|
from nacho.schema import ValidationError
|
|
19
19
|
from nacho.server.auth import AuthGuard, AuthMiddleware
|
|
20
20
|
from nacho.utils.io import dump_string, load_string
|
|
21
|
+
from nacho.utils.path import get_nested_value
|
|
21
22
|
|
|
22
23
|
from .models import (
|
|
23
24
|
AppCreateRequest,
|
|
@@ -283,8 +284,11 @@ class NachoOrchestrator:
|
|
|
283
284
|
@self.app.get("/api/apps/{app_name}/config/{path:path}")
|
|
284
285
|
async def get_path(app_name: str, path: str) -> Dict[str, Any]:
|
|
285
286
|
app = self._get_app(app_name)
|
|
287
|
+
# Resolve against the snapshot directly: Nacho.get() deep-copies its
|
|
288
|
+
# result, so an identity-sentinel passed to it would never compare
|
|
289
|
+
# equal — get_nested_value preserves the sentinel by identity.
|
|
286
290
|
missing = object()
|
|
287
|
-
value = app.config.
|
|
291
|
+
value = get_nested_value(app.config.get_all(), path, missing)
|
|
288
292
|
if value is missing:
|
|
289
293
|
raise HTTPException(
|
|
290
294
|
status_code=status.HTTP_404_NOT_FOUND,
|
|
@@ -510,6 +514,8 @@ class NachoOrchestrator:
|
|
|
510
514
|
detail="Server is in read-only mode",
|
|
511
515
|
)
|
|
512
516
|
|
|
513
|
-
def run(
|
|
517
|
+
def run( # pragma: no cover - thin uvicorn wrapper, exercised via the CLI
|
|
518
|
+
self, host: str = "0.0.0.0", port: int = 8000, reload: bool = False
|
|
519
|
+
) -> None:
|
|
514
520
|
config = uvicorn.Config(app=self.app, host=host, port=port, reload=reload)
|
|
515
521
|
uvicorn.Server(config).run()
|
|
@@ -7,7 +7,7 @@ try:
|
|
|
7
7
|
|
|
8
8
|
HAS_REMOTE_DEPS = True
|
|
9
9
|
from .remote import RemoteStorageBackend
|
|
10
|
-
except ImportError:
|
|
10
|
+
except ImportError: # pragma: no cover - optional 'remote' extra not installed
|
|
11
11
|
HAS_REMOTE_DEPS = False
|
|
12
12
|
|
|
13
13
|
class RemoteStorageBackend: # type: ignore[no-redef]
|
|
@@ -13,12 +13,12 @@ import yaml
|
|
|
13
13
|
|
|
14
14
|
try:
|
|
15
15
|
import tomllib # Python ≥ 3.11
|
|
16
|
-
except ImportError:
|
|
16
|
+
except ImportError: # pragma: no cover - Python < 3.11 fallback
|
|
17
17
|
import tomli as tomllib # type: ignore[no-redef]
|
|
18
18
|
|
|
19
19
|
try:
|
|
20
20
|
import tomli_w
|
|
21
|
-
except ImportError:
|
|
21
|
+
except ImportError: # pragma: no cover - optional TOML-write dependency
|
|
22
22
|
tomli_w = None # type: ignore[assignment]
|
|
23
23
|
|
|
24
24
|
logger = logging.getLogger(__name__)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nacho-python
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.2
|
|
4
4
|
Summary: Nacho - Lightweight, schema-first dynamic configuration service
|
|
5
5
|
Author-email: "Nya Foundation Team (k3scat)" <k3scat@github.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -45,15 +45,15 @@ Dynamic: license-file
|
|
|
45
45
|
|
|
46
46
|
# Nacho
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
<div align="center">
|
|
49
|
+
|
|
50
|
+
<pre>
|
|
51
|
+
_ _ _ ____ _ _ ___
|
|
52
|
+
| \ | | / \ / ___|| | | | / _ \
|
|
51
53
|
| \| | / _ \ | | | |_| || | | |
|
|
52
54
|
| |\ | / ___ \ | |___ | _ || |_| |
|
|
53
|
-
|_| \_|/_/ \_\ \____||_| |_| \___/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<div align="center">
|
|
55
|
+
|_| \_|/_/ \_\ \____||_| |_| \___/
|
|
56
|
+
</pre>
|
|
57
57
|
|
|
58
58
|
<h3>Lightweight, schema-first dynamic configuration service for Python.</h3>
|
|
59
59
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "nacho-python"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.2"
|
|
8
8
|
description = "Nacho - Lightweight, schema-first dynamic configuration service"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -81,6 +81,7 @@ nacho = "nacho.cli.main:main_cli" # Updated script path
|
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
|
|
84
|
+
|
|
84
85
|
[tool.setuptools]
|
|
85
86
|
package-dir = {"" = "."} # Use current directory as source root
|
|
86
87
|
include-package-data = true
|
|
@@ -110,7 +111,7 @@ python_files = "test_*.py"
|
|
|
110
111
|
# Default run: fast tests only. Heavier suites are opt-in, e.g.
|
|
111
112
|
# pytest -m integration pytest -m e2e pytest -m docker
|
|
112
113
|
# pytest -m "" (run everything)
|
|
113
|
-
addopts = '-m "not integration and not e2e and not docker" --cov=nacho --cov-report=term-missing --strict-markers'
|
|
114
|
+
addopts = '-m "not integration and not e2e and not docker" --cov=nacho --cov-report=term-missing --cov-fail-under=95 --strict-markers'
|
|
114
115
|
asyncio_default_fixture_loop_scope = "function"
|
|
115
116
|
markers = [
|
|
116
117
|
"unit: fast tests with no external dependencies",
|
|
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
|