corio 2.2.0__tar.gz → 2.2.1__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.
- {corio-2.2.0 → corio-2.2.1}/PKG-INFO +9 -1
- {corio-2.2.0 → corio-2.2.1}/corio/__init__.py +4 -4
- {corio-2.2.0 → corio-2.2.1}/corio/ai/agentic.py +2 -2
- {corio-2.2.0 → corio-2.2.1}/corio/api.py +1 -1
- {corio-2.2.0 → corio-2.2.1}/corio/caching.py +1 -1
- {corio-2.2.0 → corio-2.2.1}/corio/db/document.py +1 -1
- {corio-2.2.0 → corio-2.2.1}/corio/dm.py +1 -1
- {corio-2.2.0 → corio-2.2.1}/corio/dns/client.py +3 -3
- {corio-2.2.0 → corio-2.2.1}/corio/dns/dm.py +1 -1
- {corio-2.2.0 → corio-2.2.1}/corio/dns/proxy.py +1 -1
- {corio-2.2.0 → corio-2.2.1}/corio/dns/server.py +1 -1
- {corio-2.2.0 → corio-2.2.1}/corio/encrypt.py +1 -1
- corio-2.2.1/corio/entrypoint.py +98 -0
- {corio-2.2.0 → corio-2.2.1}/corio/google_api.py +1 -1
- {corio-2.2.0 → corio-2.2.1}/corio/ha/utils.py +2 -2
- corio-2.2.0/corio/http.py → corio-2.2.1/corio/https.py +2 -2
- {corio-2.2.0 → corio-2.2.1}/corio/infra/incrementor_pyproject.py +1 -1
- {corio-2.2.0 → corio-2.2.1}/corio/infra/releaser.py +3 -3
- {corio-2.2.0 → corio-2.2.1}/corio/infra/repository.py +1 -1
- {corio-2.2.0 → corio-2.2.1}/corio/infra/stack.py +1 -1
- {corio-2.2.0 → corio-2.2.1}/corio/interface/controls.py +1 -1
- {corio-2.2.0 → corio-2.2.1}/corio/interface/interface.py +1 -1
- {corio-2.2.0 → corio-2.2.1}/corio/json_fix.py +1 -1
- {corio-2.2.0 → corio-2.2.1}/corio/mqtt.py +1 -1
- {corio-2.2.0 → corio-2.2.1}/corio/parallel.py +1 -1
- {corio-2.2.0 → corio-2.2.1}/corio/path/path.py +8 -8
- {corio-2.2.0 → corio-2.2.1}/corio/patterns.py +2 -2
- {corio-2.2.0 → corio-2.2.1}/corio/process.py +1 -1
- {corio-2.2.0 → corio-2.2.1}/corio/pyproject.package.toml +6 -12
- corio-2.2.0/corio/random.py → corio-2.2.1/corio/rand.py +0 -1
- {corio-2.2.0 → corio-2.2.1}/corio/secrets.py +16 -6
- {corio-2.2.0 → corio-2.2.1}/corio/semantic.py +1 -1
- {corio-2.2.0 → corio-2.2.1}/corio/sets.py +8 -1
- {corio-2.2.0 → corio-2.2.1}/corio/tests/test_json.py +2 -2
- {corio-2.2.0 → corio-2.2.1}/corio/tests/test_yaml.py +2 -2
- {corio-2.2.0 → corio-2.2.1}/corio/webhook.py +1 -1
- corio-2.2.0/corio/yaml.py → corio-2.2.1/corio/yml.py +15 -2
- {corio-2.2.0 → corio-2.2.1}/corio.egg-info/PKG-INFO +9 -1
- {corio-2.2.0 → corio-2.2.1}/corio.egg-info/SOURCES.txt +9 -19
- corio-2.2.1/corio.egg-info/entry_points.txt +2 -0
- {corio-2.2.0 → corio-2.2.1}/corio.egg-info/requires.txt +9 -0
- {corio-2.2.0 → corio-2.2.1}/pyproject.toml +6 -12
- corio-2.2.0/corio/entrypoints/cache_hfh.py +0 -3
- corio-2.2.0/corio/entrypoints/doc_serve.py +0 -19
- corio-2.2.0/corio/entrypoints/ep_test.py +0 -2
- corio-2.2.0/corio/entrypoints/infra.py +0 -9
- corio-2.2.0/corio/entrypoints/install_yamlscript.py +0 -8
- corio-2.2.0/corio/entrypoints/pyproject.py +0 -13
- corio-2.2.0/corio/entrypoints/remote_debug_test.py +0 -8
- corio-2.2.0/corio/entrypoints/secrets.py +0 -29
- corio-2.2.0/corio/entrypoints/shell_debug.py +0 -8
- corio-2.2.0/corio/packaging.py +0 -14
- corio-2.2.0/corio/tests/__init__.py +0 -0
- corio-2.2.0/corio.egg-info/entry_points.txt +0 -10
- {corio-2.2.0 → corio-2.2.1}/LICENSE +0 -0
- {corio-2.2.0 → corio-2.2.1}/README.md +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/ai/__init__.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/ai/infer.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/aio.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/augmentation.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/av.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/constants.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/context.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/dataclass.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/datatype.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/db/__init__.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/debug.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/dns/__init__.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/docker/__init__.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/dt.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/env.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/function.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/ha/__init__.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/ha/constants.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/ha/core.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/ha/supervisor.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/hash.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/hfh.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/hook.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/infra/__init__.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/infra/api.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/infra/project.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/inherit.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/inspection.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/interface/__init__.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/interface/context.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/iterator.py +0 -0
- /corio-2.2.0/corio/json.py → /corio-2.2.1/corio/jsn.py +0 -0
- /corio-2.2.0/corio/logging.py → /corio-2.2.1/corio/logs.py +0 -0
- /corio-2.2.0/corio/html.py → /corio-2.2.1/corio/markup.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/merging.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/metric.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/name.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/net.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/netrc.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/openai.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/path/__init__.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/path/app.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/path/type.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/paths.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/pdf.py +0 -0
- /corio-2.2.0/corio/platform.py → /corio-2.2.1/corio/plat.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/profiling.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/setup/__init__.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/spaces.py +0 -0
- /corio-2.2.0/corio/string.py → /corio-2.2.1/corio/strings.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/tabular.py +0 -0
- {corio-2.2.0/corio/entrypoints → corio-2.2.1/corio/tests}/__init__.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/tests/conftest.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/tests/helpers.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/tests/test_datatype.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/tests/test_environment.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/tests/test_path.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/tokenization.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/toml.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/tools.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/unicode.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/version/__init__.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/version/version.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio/youtube.py +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio.egg-info/dependency_links.txt +0 -0
- {corio-2.2.0 → corio-2.2.1}/corio.egg-info/top_level.txt +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/add-service +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/add-user-path +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/add-ve-shell +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/apt-essentials +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/apt-headless +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/auth-token +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/compose-update +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/compress-dir +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/cru +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/docker-build-bases +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/docker-build-bases-dev +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/docker-install-deps +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/docker-install-prod +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/docker-prune +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/docker-sandbox +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/docker-sandbox-init +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/docs-deploy +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/download +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/encrypt-secrets +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/fmtr-test-script +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/git-clone +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/ha-addon-launch +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/infra +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/infra-sync +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/install-browser +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/install-docker +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/install-ts +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/install-ys +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/mirror-dir +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/opt-dev-init +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/parse-args +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/pypi-check +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/pypi-reserve +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/run-script +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/set-password +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/set-secure-path +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/set-user-sudo +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/snips-install +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/ssh-auth +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/ssh-serve +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/tasmota-config +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/tasmota-flash +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/tasmota-terminal +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/vlc-tn +0 -0
- {corio-2.2.0 → corio-2.2.1}/scripts/vm-launch +0 -0
- {corio-2.2.0 → corio-2.2.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: corio
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.1
|
|
4
4
|
Summary: Collection of high-level tools to simplify everyday development tasks, with a focus on AI/ML
|
|
5
5
|
Author-email: Frontmatter AI <innovative.fowler@mask.pro.fmtr.dev>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -273,6 +273,14 @@ Requires-Dist: pydantic; extra == "secrets"
|
|
|
273
273
|
Requires-Dist: pydantic-extra-types; extra == "secrets"
|
|
274
274
|
Requires-Dist: pycountry; extra == "secrets"
|
|
275
275
|
Requires-Dist: pygit2; extra == "secrets"
|
|
276
|
+
Provides-Extra: cli
|
|
277
|
+
Requires-Dist: pydantic-settings; extra == "cli"
|
|
278
|
+
Requires-Dist: pydantic; extra == "cli"
|
|
279
|
+
Requires-Dist: pydantic-extra-types; extra == "cli"
|
|
280
|
+
Requires-Dist: pycountry; extra == "cli"
|
|
281
|
+
Requires-Dist: yamlscript; extra == "cli"
|
|
282
|
+
Requires-Dist: pyyaml; extra == "cli"
|
|
283
|
+
Requires-Dist: logfire; extra == "cli"
|
|
276
284
|
Provides-Extra: all
|
|
277
285
|
Requires-Dist: logfire; extra == "all"
|
|
278
286
|
Requires-Dist: semver; extra == "all"
|
|
@@ -4,7 +4,7 @@ IMPORT_HOOK = ImportHook()
|
|
|
4
4
|
|
|
5
5
|
from corio.constants import Constants
|
|
6
6
|
from corio.path.path import Path, PackagePaths
|
|
7
|
-
from corio.
|
|
7
|
+
from corio.logs import logger
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
try:
|
|
@@ -13,9 +13,9 @@ except ImportError as exception:
|
|
|
13
13
|
AppPaths = MissingExtraMockModule('path.app', exception)
|
|
14
14
|
|
|
15
15
|
try:
|
|
16
|
-
from corio.
|
|
17
|
-
except ImportError as exception:
|
|
18
|
-
Client = MissingExtraMockModule('
|
|
16
|
+
from corio.https import Client
|
|
17
|
+
except (ImportError, RuntimeError) as exception:
|
|
18
|
+
Client = MissingExtraMockModule('https', exception)
|
|
19
19
|
|
|
20
20
|
try:
|
|
21
21
|
from corio.profiling import Timer
|
|
@@ -12,8 +12,8 @@ from typing import List, Optional, Any, Annotated, Generic
|
|
|
12
12
|
|
|
13
13
|
from corio import env as env
|
|
14
14
|
from corio.constants import Constants
|
|
15
|
-
from corio.
|
|
16
|
-
from corio.
|
|
15
|
+
from corio.logs import logger
|
|
16
|
+
from corio.strings import truncate_mid
|
|
17
17
|
|
|
18
18
|
logfire.instrument_pydantic_ai()
|
|
19
19
|
|
|
@@ -8,7 +8,7 @@ from fastapi import FastAPI, Request
|
|
|
8
8
|
|
|
9
9
|
from corio import env
|
|
10
10
|
from corio.iterator import enlist
|
|
11
|
-
from corio.
|
|
11
|
+
from corio.logs import logger
|
|
12
12
|
|
|
13
13
|
for name in ["uvicorn.access", "uvicorn.error", "uvicorn"]:
|
|
14
14
|
logger_uvicorn = logging.getLogger(name)
|
|
@@ -9,7 +9,7 @@ from typing import ClassVar, List, Any, Dict
|
|
|
9
9
|
|
|
10
10
|
from corio.datatype import is_optional, none_else
|
|
11
11
|
from corio.iterator import get_class_lookup
|
|
12
|
-
from corio.
|
|
12
|
+
from corio.strings import camel_to_snake
|
|
13
13
|
from corio.tools import Auto, Required, Empty
|
|
14
14
|
|
|
15
15
|
|
|
@@ -5,9 +5,9 @@ from typing import Optional, Dict
|
|
|
5
5
|
from dns import query as dnspython_query, message as dnspython_message, rdatatype as dnspython_rdatatype, rcode as dnspython_rcode
|
|
6
6
|
from httpx_retries import Retry, RetryTransport
|
|
7
7
|
|
|
8
|
-
from corio import
|
|
8
|
+
from corio import https as https
|
|
9
9
|
from corio.dns.dm import Exchange, Response
|
|
10
|
-
from corio.
|
|
10
|
+
from corio.logs import logger
|
|
11
11
|
|
|
12
12
|
RETRY_STRATEGY = Retry(
|
|
13
13
|
total=2, # initial + 1 retry
|
|
@@ -21,7 +21,7 @@ RETRY_STRATEGY = Retry(
|
|
|
21
21
|
)
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
class HTTPClientDoH(
|
|
24
|
+
class HTTPClientDoH(https.Client):
|
|
25
25
|
"""
|
|
26
26
|
|
|
27
27
|
Base HTTP client for DoH-appropriate retry strategy.
|
|
@@ -8,7 +8,7 @@ from dns import rcode as dnspython_rcode, reversename as dnspython_reversename
|
|
|
8
8
|
from dns.message import Message, QueryMessage
|
|
9
9
|
from dns.rrset import RRset
|
|
10
10
|
|
|
11
|
-
from corio.
|
|
11
|
+
from corio.strings import join
|
|
12
12
|
|
|
13
13
|
TTL_CODE_DEFAULTS = {
|
|
14
14
|
dnspython_rcode.NOERROR: 300, # Successful query
|
|
@@ -8,7 +8,7 @@ from pyrage import x25519
|
|
|
8
8
|
|
|
9
9
|
import corio.env as env
|
|
10
10
|
from corio.constants import Constants
|
|
11
|
-
from corio.
|
|
11
|
+
from corio.jsn import to_json, from_json
|
|
12
12
|
from corio.path import Path
|
|
13
13
|
|
|
14
14
|
SerializableScalar = Union[str, int, float, bool, None]
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
from pydantic_settings import CliSubCommand
|
|
2
|
+
|
|
3
|
+
from corio import dm
|
|
4
|
+
from corio import secrets
|
|
5
|
+
from corio import sets
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class DocServe(dm.Base):
|
|
9
|
+
def run(self):
|
|
10
|
+
from corio.infra.project import Project
|
|
11
|
+
from corio.infra.releaser import ReleaseDocumentation
|
|
12
|
+
from corio.path import PackagePaths, Path
|
|
13
|
+
|
|
14
|
+
paths = PackagePaths(Path.cwd())
|
|
15
|
+
project = Project(paths.name_ns)
|
|
16
|
+
release = ReleaseDocumentation(project.releaser)
|
|
17
|
+
|
|
18
|
+
with paths.repo.chdir:
|
|
19
|
+
return release.serve(
|
|
20
|
+
host="0.0.0.0",
|
|
21
|
+
port=8180 + paths.metadata.port,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class Docs(dm.Base):
|
|
26
|
+
serve: CliSubCommand[DocServe]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class Pyproject(dm.Base):
|
|
30
|
+
def run(self):
|
|
31
|
+
from corio.infra.incrementor_pyproject import IncrementorPyproject
|
|
32
|
+
from corio.infra.project import Project
|
|
33
|
+
from corio.paths import paths
|
|
34
|
+
|
|
35
|
+
project = Project(paths.name_ns)
|
|
36
|
+
project.versions.pinned = project.versions.old
|
|
37
|
+
return IncrementorPyproject(project.releaser).apply()
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class EpTest(dm.Base):
|
|
41
|
+
def run(self):
|
|
42
|
+
print("Ran test entrypoint.")
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class ShellDebug(dm.Base):
|
|
46
|
+
def run(self):
|
|
47
|
+
from corio import debug
|
|
48
|
+
|
|
49
|
+
return debug.debug_shell()
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class CacheHfh(dm.Base):
|
|
53
|
+
def run(self):
|
|
54
|
+
import corio
|
|
55
|
+
|
|
56
|
+
return corio.hfh.main()
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class Infra(dm.Base):
|
|
60
|
+
def run(self):
|
|
61
|
+
from corio.infra.api import Api
|
|
62
|
+
|
|
63
|
+
return Api.launch()
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class InstallYamlscript(dm.Base):
|
|
67
|
+
def run(self):
|
|
68
|
+
from corio import yml
|
|
69
|
+
|
|
70
|
+
return yml.install()
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class RemoteDebugTest(dm.Base):
|
|
74
|
+
def run(self):
|
|
75
|
+
from corio import debug
|
|
76
|
+
|
|
77
|
+
return debug.trace(is_debug=True)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
class Cli(sets.Base, cli_parse_args=True):
|
|
81
|
+
secrets: CliSubCommand[secrets.Cli]
|
|
82
|
+
docs: CliSubCommand[Docs]
|
|
83
|
+
pyproject: CliSubCommand[Pyproject]
|
|
84
|
+
ep_test: CliSubCommand[EpTest]
|
|
85
|
+
shell_debug: CliSubCommand[ShellDebug]
|
|
86
|
+
cache_hfh: CliSubCommand[CacheHfh]
|
|
87
|
+
infra: CliSubCommand[Infra]
|
|
88
|
+
install_yamlscript: CliSubCommand[InstallYamlscript]
|
|
89
|
+
remote_debug_test: CliSubCommand[RemoteDebugTest]
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def main():
|
|
93
|
+
config = Cli()
|
|
94
|
+
config.run()
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
if __name__ == "__main__":
|
|
98
|
+
main()
|
|
@@ -6,7 +6,7 @@ from google.oauth2.credentials import Credentials
|
|
|
6
6
|
from google_auth_oauthlib.flow import InstalledAppFlow
|
|
7
7
|
from googleapiclient.discovery import build, Resource
|
|
8
8
|
|
|
9
|
-
from corio.
|
|
9
|
+
from corio.logs import logger
|
|
10
10
|
from corio.path import Path
|
|
11
11
|
|
|
12
12
|
|
|
@@ -2,9 +2,9 @@ import httpx
|
|
|
2
2
|
from functools import cached_property
|
|
3
3
|
from httpx_retries import RetryTransport, Retry
|
|
4
4
|
|
|
5
|
-
from corio import
|
|
5
|
+
from corio import logs
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
logs.logger.instrument_httpx()
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class Client(httpx.Client):
|
|
@@ -5,7 +5,7 @@ from itertools import chain
|
|
|
5
5
|
from corio.constants import Constants
|
|
6
6
|
from corio.infra.releaser import Incrementor
|
|
7
7
|
from corio.iterator import dedupe
|
|
8
|
-
from corio.
|
|
8
|
+
from corio.logs import logger
|
|
9
9
|
from corio.path import Path
|
|
10
10
|
from corio.toml import ensure_table
|
|
11
11
|
|
|
@@ -13,11 +13,11 @@ gh_deploy = cli.commands["gh-deploy"].callback
|
|
|
13
13
|
serve = cli.commands["serve"].callback
|
|
14
14
|
|
|
15
15
|
from corio import env as env
|
|
16
|
-
from corio import
|
|
16
|
+
from corio import https as https
|
|
17
17
|
from corio.constants import Constants
|
|
18
18
|
from corio.infra.project import Project
|
|
19
19
|
from corio.inherit import Inherit
|
|
20
|
-
from corio.
|
|
20
|
+
from corio.logs import logger
|
|
21
21
|
from corio.path import Path
|
|
22
22
|
|
|
23
23
|
|
|
@@ -367,7 +367,7 @@ class ReleaseGithub(Release):
|
|
|
367
367
|
}
|
|
368
368
|
|
|
369
369
|
with logger.span(f'Creating release "{name}"...'):
|
|
370
|
-
response =
|
|
370
|
+
response = https.client.post(url, json=payload, headers=headers)
|
|
371
371
|
|
|
372
372
|
response.raise_for_status()
|
|
373
373
|
|
|
@@ -6,7 +6,7 @@ from corio.docker import DockerClient
|
|
|
6
6
|
from corio.infra.project import Project
|
|
7
7
|
from corio.inherit import Inherit
|
|
8
8
|
from corio.iterator import IndexList
|
|
9
|
-
from corio.
|
|
9
|
+
from corio.logs import logger
|
|
10
10
|
from corio.merging import merge
|
|
11
11
|
from corio.path import Path, PackagePaths
|
|
12
12
|
|
|
@@ -9,7 +9,7 @@ from corio import env
|
|
|
9
9
|
from corio.constants import Constants
|
|
10
10
|
from corio.function import MethodDecorator
|
|
11
11
|
from corio.interface.context import Context
|
|
12
|
-
from corio.
|
|
12
|
+
from corio.logs import logger
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class update(MethodDecorator):
|
|
@@ -4,7 +4,7 @@ from dataclasses import dataclass, asdict
|
|
|
4
4
|
from paho.mqtt.client import CleanStartOption, MQTT_CLEAN_START_FIRST_ONLY
|
|
5
5
|
from typing import Literal, Self
|
|
6
6
|
|
|
7
|
-
from corio.
|
|
7
|
+
from corio.logs import logger, get_current_level, get_native_level_from_otel
|
|
8
8
|
|
|
9
9
|
LOGGER = logging.getLogger("mqtt")
|
|
10
10
|
LOGGER.handlers.clear()
|
|
@@ -15,8 +15,8 @@ from typing import Self, Tuple, Callable
|
|
|
15
15
|
from typing import Union, Any
|
|
16
16
|
|
|
17
17
|
from corio.constants import Constants
|
|
18
|
-
from corio.
|
|
19
|
-
from corio.
|
|
18
|
+
from corio.plat import is_wsl
|
|
19
|
+
from corio.strings import join_natural
|
|
20
20
|
|
|
21
21
|
if typing.TYPE_CHECKING:
|
|
22
22
|
from datetime import datetime, timezone
|
|
@@ -116,7 +116,7 @@ class Path(type(Path())):
|
|
|
116
116
|
Write the specified object to the path as a JSON string
|
|
117
117
|
|
|
118
118
|
"""
|
|
119
|
-
from corio.
|
|
119
|
+
from corio.jsn import to_json
|
|
120
120
|
json_str = to_json(obj)
|
|
121
121
|
return self.write_text(json_str, encoding=Constants.ENCODING)
|
|
122
122
|
|
|
@@ -126,7 +126,7 @@ class Path(type(Path())):
|
|
|
126
126
|
Read JSON from the file and return as a Python object
|
|
127
127
|
|
|
128
128
|
"""
|
|
129
|
-
from corio.
|
|
129
|
+
from corio.jsn import from_json
|
|
130
130
|
json_str = self.read_text(encoding=Constants.ENCODING)
|
|
131
131
|
obj = from_json(json_str)
|
|
132
132
|
return obj
|
|
@@ -137,8 +137,8 @@ class Path(type(Path())):
|
|
|
137
137
|
Write the specified object to the path as a JSON string
|
|
138
138
|
|
|
139
139
|
"""
|
|
140
|
-
from corio import
|
|
141
|
-
yaml_str =
|
|
140
|
+
from corio import yml
|
|
141
|
+
yaml_str = yml.to_yaml(obj)
|
|
142
142
|
return self.write_text(yaml_str, encoding=Constants.ENCODING)
|
|
143
143
|
|
|
144
144
|
def read_yaml(self) -> Any:
|
|
@@ -147,9 +147,9 @@ class Path(type(Path())):
|
|
|
147
147
|
Read YAML from the file and return as a Python object
|
|
148
148
|
|
|
149
149
|
"""
|
|
150
|
-
from corio import
|
|
150
|
+
from corio import yml
|
|
151
151
|
yaml_str = self.read_text(encoding=Constants.ENCODING)
|
|
152
|
-
obj =
|
|
152
|
+
obj = yml.from_yaml(yaml_str)
|
|
153
153
|
return obj
|
|
154
154
|
|
|
155
155
|
def write_toml(self, obj) -> int:
|
|
@@ -5,8 +5,8 @@ from typing import List, Any
|
|
|
5
5
|
import regex as re
|
|
6
6
|
|
|
7
7
|
from corio import Constants
|
|
8
|
-
from corio.
|
|
9
|
-
from corio.
|
|
8
|
+
from corio.logs import logger
|
|
9
|
+
from corio.strings import join
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class RewriteCircularLoopError(Exception):
|
|
@@ -56,14 +56,15 @@ ha = ["env.io"]
|
|
|
56
56
|
"ha.api" = ["ha", "homeassistant_api", "aiohasupervisor"]
|
|
57
57
|
doc = ["mkdocs", "mkdocs-material", "mkdocstrings[python]", "mike", "mkdocs-include-dir-to-nav"]
|
|
58
58
|
youtube = ["pytubefix"]
|
|
59
|
-
infra = ["version.dev", "logging", "setup", "doc", "sets", "build", "twine", "packaging", "vcs", "docker.client", "merging", "http", "api", "tomlkit", "secrets"]
|
|
59
|
+
infra = ["version.dev", "logging", "setup", "doc", "sets", "build", "twine", "packaging", "vcs", "docker.client", "merging", "http", "api", "tomlkit", "secrets", "cli"]
|
|
60
60
|
vcs = ["pygit2"]
|
|
61
61
|
tasmota = ["decode-config", "esptool"]
|
|
62
62
|
encrypt = ["pyrage"]
|
|
63
63
|
secrets = ["encrypt", "env.io", "yaml", "logging", "sets", "vcs"]
|
|
64
|
+
cli = ["sets", "logging"]
|
|
64
65
|
|
|
65
66
|
[tool.corio.metadata]
|
|
66
|
-
version = "2.2.
|
|
67
|
+
version = "2.2.1"
|
|
67
68
|
port = 0
|
|
68
69
|
base = "python"
|
|
69
70
|
description = "Collection of high-level tools to simplify everyday development tasks, with a focus on AI/ML"
|
|
@@ -92,7 +93,7 @@ corio = ["pyproject.package.toml"]
|
|
|
92
93
|
|
|
93
94
|
[project]
|
|
94
95
|
name = "corio"
|
|
95
|
-
version = "2.2.
|
|
96
|
+
version = "2.2.1"
|
|
96
97
|
description = "Collection of high-level tools to simplify everyday development tasks, with a focus on AI/ML"
|
|
97
98
|
readme = "README.md"
|
|
98
99
|
dependencies = []
|
|
@@ -158,6 +159,7 @@ vcs = ["pygit2"]
|
|
|
158
159
|
tasmota = ["decode-config", "esptool"]
|
|
159
160
|
encrypt = ["pyrage"]
|
|
160
161
|
secrets = ["pyrage", "dotenv", "yamlscript", "pyyaml", "logfire", "pydantic-settings", "pydantic", "pydantic-extra-types", "pycountry", "pygit2"]
|
|
162
|
+
cli = ["pydantic-settings", "pydantic", "pydantic-extra-types", "pycountry", "yamlscript", "pyyaml", "logfire"]
|
|
161
163
|
all = ["logfire", "semver", "pydevd-pycharm~=251.25410.159", "pydantic-settings", "pydantic", "pydantic-extra-types", "pycountry", "yamlscript", "pyyaml", "beanie", "setuptools", "mkdocs", "mkdocs-material", "mkdocstrings[python]", "mike", "mkdocs-include-dir-to-nav", "build", "twine", "packaging", "pygit2", "python-on-whales", "deepmerge", "httpx", "httpx_retries", "logfire[httpx]", "fastapi", "uvicorn[standard]", "logfire[fastapi]", "tomlkit", "pyrage", "dotenv", "pytest-cov", "dask[bag]", "distributed", "bokeh", "tokenizers", "faker", "sre_yield", "contexttimer", "Unidecode", "tinynetrc", "huggingface_hub", "peft", "transformers[sentencepiece]", "torchvision", "torchaudio", "cuda-bindings==13.2.0", "cuda-pathfinder==1.5.4", "cuda-toolkit==13.0.2", "nvidia-cublas==13.1.0.3", "nvidia-cuda-cupti==13.0.85", "nvidia-cuda-nvrtc==13.0.88", "nvidia-cuda-runtime==13.0.96", "nvidia-cudnn-cu13==9.19.0.56", "nvidia-cufft==12.0.0.61", "nvidia-cufile==1.15.1.6", "nvidia-curand==10.4.0.35", "nvidia-cusolver==12.0.4.66", "nvidia-cusparse==12.6.3.3", "nvidia-cusparselt-cu13==0.8.0", "nvidia-nccl-cu13==2.28.9", "nvidia-nvjitlink==13.0.88", "nvidia-nvshmem-cu13==3.4.5", "nvidia-nvtx==13.0.85", "torch==2.11.0", "triton==3.6.0", "openai", "pydantic-ai-slim[logfire,openai]", "ollama", "json_repair", "sentence_transformers", "pandas", "tabulate", "openpyxl", "odfpy", "deepdiff", "html2text", "flet[all] <0.80.0", "flet-video", "flet-webview", "google-auth", "google-auth-oauthlib", "google-auth-httplib2", "google-api-python-client", "diskcache", "cachetools", "pymupdf", "pymupdf4llm", "appdirs", "filetype", "dnspython[doh]", "regex", "playwright", "aiomqtt", "av", "homeassistant_api", "aiohasupervisor", "pytubefix", "decode-config", "esptool"]
|
|
162
164
|
|
|
163
165
|
[[project.authors]]
|
|
@@ -168,15 +170,7 @@ email = "innovative.fowler@mask.pro.fmtr.dev"
|
|
|
168
170
|
Homepage = "https://github.com/fmtr/corio"
|
|
169
171
|
|
|
170
172
|
[project.scripts]
|
|
171
|
-
corio
|
|
172
|
-
corio-pyproject = "corio.entrypoints.pyproject:main"
|
|
173
|
-
corio-ep-test = "corio.entrypoints.ep_test:main"
|
|
174
|
-
corio-shell-debug = "corio.entrypoints.shell_debug:main"
|
|
175
|
-
corio-cache-hfh = "corio.entrypoints.cache_hfh:main"
|
|
176
|
-
corio-infra = "corio.entrypoints.infra:main"
|
|
177
|
-
corio-install-yamlscript = "corio.entrypoints.install_yamlscript:main"
|
|
178
|
-
corio-secrets = "corio.entrypoints.secrets:main"
|
|
179
|
-
corio-remote-debug-test = "corio.entrypoints.remote_debug_test:main"
|
|
173
|
+
corio = "corio.entrypoint:main"
|
|
180
174
|
|
|
181
175
|
[dependency-groups]
|
|
182
176
|
dev = ["logfire", "semver", "pydevd-pycharm~=251.25410.159", "pydantic-settings", "pydantic", "pydantic-extra-types", "pycountry", "yamlscript", "pyyaml", "beanie", "setuptools", "mkdocs", "mkdocs-material", "mkdocstrings[python]", "mike", "mkdocs-include-dir-to-nav", "build", "twine", "packaging", "pygit2", "python-on-whales", "deepmerge", "httpx", "httpx_retries", "logfire[httpx]", "fastapi", "uvicorn[standard]", "logfire[fastapi]", "tomlkit", "pyrage", "dotenv"]
|
|
@@ -3,27 +3,33 @@ from __future__ import annotations
|
|
|
3
3
|
from functools import cached_property
|
|
4
4
|
from typing import ClassVar
|
|
5
5
|
from typing import Generator
|
|
6
|
+
from typing import TYPE_CHECKING
|
|
6
7
|
|
|
7
8
|
from pydantic import Field
|
|
9
|
+
from pydantic_settings import CLI_SUPPRESS
|
|
8
10
|
from pydantic_settings import CliSubCommand
|
|
9
11
|
|
|
10
12
|
from corio import dm as dm
|
|
11
13
|
from corio import sets as sets
|
|
12
|
-
from corio.encrypt import EncryptorValuesSelect, EncryptorValues
|
|
13
14
|
from corio.iterator import flatten_tree, strip_none, IndexList
|
|
14
|
-
from corio.
|
|
15
|
+
from corio.logs import logger
|
|
15
16
|
from corio.path import Path
|
|
16
|
-
from corio.
|
|
17
|
+
from corio.strings import join_natural, MASK_QUOTE
|
|
18
|
+
|
|
19
|
+
if TYPE_CHECKING:
|
|
20
|
+
from corio.encrypt import EncryptorValues, EncryptorValuesSelect
|
|
17
21
|
|
|
18
22
|
ALL = '+'
|
|
19
23
|
|
|
24
|
+
token_hex=None # FastAPI tries to import this?
|
|
25
|
+
|
|
20
26
|
class Definition(dm.Base):
|
|
21
27
|
"""
|
|
22
28
|
|
|
23
29
|
Pair of lists of files - and the nodes to encrypt within those files
|
|
24
30
|
|
|
25
31
|
"""
|
|
26
|
-
config:
|
|
32
|
+
config: Cli | None = Field(default=None, exclude=True, repr=False, description=CLI_SUPPRESS)
|
|
27
33
|
files: list[str]
|
|
28
34
|
nodes: list[str] = Field(default_factory=list)
|
|
29
35
|
|
|
@@ -34,6 +40,8 @@ class Definition(dm.Base):
|
|
|
34
40
|
Create encryptor with only the nodes specified
|
|
35
41
|
|
|
36
42
|
"""
|
|
43
|
+
from corio.encrypt import EncryptorValuesSelect
|
|
44
|
+
|
|
37
45
|
return EncryptorValuesSelect(nodes=self.nodes)
|
|
38
46
|
|
|
39
47
|
def is_keys_values_aligned(self, black_robin: dict) -> bool:
|
|
@@ -137,7 +145,7 @@ class Command(dm.Base):
|
|
|
137
145
|
CLI subcommand base
|
|
138
146
|
|
|
139
147
|
"""
|
|
140
|
-
config:
|
|
148
|
+
config: Cli | None = Field(default=None, exclude=True, repr=False, description=CLI_SUPPRESS)
|
|
141
149
|
context: list[str]
|
|
142
150
|
|
|
143
151
|
def is_black(self, path: Path) -> bool:
|
|
@@ -318,6 +326,8 @@ class Decrypt(Command):
|
|
|
318
326
|
Decryption doesn't need definitions, so can use a generic values encryptor
|
|
319
327
|
|
|
320
328
|
"""
|
|
329
|
+
from corio.encrypt import EncryptorValues
|
|
330
|
+
|
|
321
331
|
return EncryptorValues()
|
|
322
332
|
|
|
323
333
|
def is_included_self_suffix(self, path: Path) -> bool:
|
|
@@ -359,7 +369,7 @@ class Decrypt(Command):
|
|
|
359
369
|
return path_red
|
|
360
370
|
|
|
361
371
|
|
|
362
|
-
class
|
|
372
|
+
class Cli(sets.Base):
|
|
363
373
|
"""
|
|
364
374
|
|
|
365
375
|
Secrets encryptions definitions file in repo root
|
|
@@ -51,9 +51,16 @@ class Base(BaseSettings, CliRunMixin):
|
|
|
51
51
|
|
|
52
52
|
"""
|
|
53
53
|
|
|
54
|
+
cli_parse_args = cls.model_config.get('cli_parse_args')
|
|
55
|
+
if cli_parse_args is None:
|
|
56
|
+
cli_parse_args = False
|
|
57
|
+
|
|
54
58
|
sources = (
|
|
55
59
|
init_settings,
|
|
56
|
-
CliSettingsSource(
|
|
60
|
+
CliSettingsSource(
|
|
61
|
+
settings_cls,
|
|
62
|
+
cli_parse_args=cli_parse_args,
|
|
63
|
+
),
|
|
57
64
|
EnvSettingsSource(settings_cls, env_prefix=cls.get_env_prefix(), env_nested_delimiter=cls.ENV_NESTED_DELIMITER),
|
|
58
65
|
YamlScriptConfigSettingsSource(settings_cls, yaml_file=cls.find_yaml_file()),
|
|
59
66
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from corio import
|
|
1
|
+
from corio import jsn
|
|
2
2
|
from corio.tests.helpers import SERIALIZATION_DATA
|
|
3
3
|
|
|
4
4
|
|
|
@@ -9,5 +9,5 @@ def test_json():
|
|
|
9
9
|
|
|
10
10
|
"""
|
|
11
11
|
expected = SERIALIZATION_DATA
|
|
12
|
-
actual =
|
|
12
|
+
actual = jsn.from_json(jsn.to_json(expected))
|
|
13
13
|
assert actual == expected
|