corio 2.2.6__tar.gz → 2.2.7__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.6 → corio-2.2.7}/PKG-INFO +4 -1
- {corio-2.2.6 → corio-2.2.7}/corio/infra/incrementor_pyproject.py +81 -87
- {corio-2.2.6 → corio-2.2.7}/corio/pyproject.package.toml +12 -15
- {corio-2.2.6 → corio-2.2.7}/corio/tests/test_infra.py +48 -37
- {corio-2.2.6 → corio-2.2.7}/corio.egg-info/PKG-INFO +4 -1
- {corio-2.2.6 → corio-2.2.7}/corio.egg-info/SOURCES.txt +0 -1
- {corio-2.2.6 → corio-2.2.7}/corio.egg-info/requires.txt +4 -0
- {corio-2.2.6 → corio-2.2.7}/pyproject.toml +12 -15
- corio-2.2.6/scripts/infra-sync +0 -24
- {corio-2.2.6 → corio-2.2.7}/LICENSE +0 -0
- {corio-2.2.6 → corio-2.2.7}/README.md +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/__init__.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/ai/__init__.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/ai/agentic.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/ai/infer.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/aio.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/api.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/augmentation.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/av.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/caching.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/constants.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/context.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/dataclass.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/datatype.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/db/__init__.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/db/document.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/debug.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/dm.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/dns/__init__.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/dns/client.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/dns/dm.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/dns/proxy.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/dns/server.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/docker/__init__.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/dt.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/encrypt.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/entrypoint.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/env.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/function.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/google_api.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/ha/__init__.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/ha/constants.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/ha/core.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/ha/supervisor.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/ha/utils.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/hash.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/hfh.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/hook.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/https.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/infra/__init__.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/infra/api.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/infra/project.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/infra/releaser.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/infra/repository.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/infra/stack.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/inherit.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/inspection.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/interface/__init__.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/interface/context.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/interface/controls.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/interface/interface.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/iterator.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/jsn.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/json_fix.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/logs.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/markup.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/merging.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/metric.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/mqtt.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/name.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/net.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/netrc.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/openai.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/parallel.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/path/__init__.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/path/app.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/path/path.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/path/type.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/paths.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/patterns.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/pdf.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/plat.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/process.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/profiling.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/rand.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/sec.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/semantic.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/sets.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/setup/__init__.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/spaces.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/strings.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tabular.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/__init__.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/conftest.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/helpers.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/test_caching.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/test_datatype.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/test_dns.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/test_dt.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/test_encrypt.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/test_env.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/test_hash.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/test_hook.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/test_iterator.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/test_jsn.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/test_name.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/test_path.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/test_patterns.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/test_rand.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/test_strings.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/test_toml.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/test_tools.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tests/test_yaml.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tokenization.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/toml.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/tools.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/unicode.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/version/__init__.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/version/version.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/webhook.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/yml.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio/youtube.py +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio.egg-info/dependency_links.txt +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio.egg-info/entry_points.txt +0 -0
- {corio-2.2.6 → corio-2.2.7}/corio.egg-info/top_level.txt +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/add-service +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/add-user-path +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/add-ve-shell +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/apt-essentials +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/apt-headless +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/auth-token +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/compose-update +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/compress-dir +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/cru +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/docker-build-bases +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/docker-build-bases-dev +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/docker-install-deps +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/docker-install-prod +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/docker-prune +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/docker-sandbox +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/docker-sandbox-init +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/docs-deploy +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/download +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/encrypt-secrets +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/fmtr-test-script +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/git-clone +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/ha-addon-launch +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/infra +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/install-browser +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/install-docker +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/install-ts +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/install-ys +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/mirror-dir +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/opt-dev-init +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/parse-args +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/pypi-check +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/pypi-reserve +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/run-script +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/run-tests +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/set-password +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/set-secure-path +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/set-user-sudo +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/snips-install +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/ssh-auth +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/ssh-serve +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/tasmota-config +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/tasmota-flash +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/tasmota-terminal +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/vlc-tn +0 -0
- {corio-2.2.6 → corio-2.2.7}/scripts/vm-launch +0 -0
- {corio-2.2.6 → corio-2.2.7}/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.7
|
|
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
|
|
@@ -44,6 +44,9 @@ Requires-Dist: pytest-cov; extra == "dev"
|
|
|
44
44
|
Provides-Extra: test
|
|
45
45
|
Requires-Dist: pytest; extra == "test"
|
|
46
46
|
Requires-Dist: pytest-cov; extra == "test"
|
|
47
|
+
Provides-Extra: yml
|
|
48
|
+
Requires-Dist: yamlscript; extra == "yml"
|
|
49
|
+
Requires-Dist: pyyaml; extra == "yml"
|
|
47
50
|
Provides-Extra: yaml
|
|
48
51
|
Requires-Dist: yamlscript; extra == "yaml"
|
|
49
52
|
Requires-Dist: pyyaml; extra == "yaml"
|
|
@@ -12,16 +12,12 @@ from corio.path import Path, PackagePaths
|
|
|
12
12
|
from corio.path.path import Metadata
|
|
13
13
|
from corio.toml import ensure_table
|
|
14
14
|
|
|
15
|
-
|
|
16
15
|
class IncrementorPyproject(Incrementor):
|
|
17
16
|
AUTHOR_EMAIL = "innovative.fowler@mask.pro.fmtr.dev"
|
|
18
17
|
ENTRYPOINT_COMMAND_SEP = "-"
|
|
19
18
|
ENTRYPOINT_FUNCTION_SEP = "_"
|
|
20
19
|
ENTRYPOINT_FUNC_NAME = "main"
|
|
21
20
|
DEPENDENCIES_SECTION_PATH = ("tool", "corio", "dependencies")
|
|
22
|
-
TEST_FILENAME_PREFIX = "test_"
|
|
23
|
-
TEST_FILENAME_SUFFIX = ".py"
|
|
24
|
-
TOX_REQUIRES = ["tox>=4.22", "tox-uv>=1"]
|
|
25
21
|
|
|
26
22
|
@cached_property
|
|
27
23
|
def path(self) -> Path:
|
|
@@ -86,7 +82,7 @@ class IncrementorPyproject(Incrementor):
|
|
|
86
82
|
|
|
87
83
|
if requirement.specifier:
|
|
88
84
|
operators = {specifier.operator for specifier in requirement.specifier}
|
|
89
|
-
if
|
|
85
|
+
if operators != {"~="}:
|
|
90
86
|
return dep
|
|
91
87
|
|
|
92
88
|
extras = ""
|
|
@@ -97,23 +93,22 @@ class IncrementorPyproject(Incrementor):
|
|
|
97
93
|
if requirement.marker:
|
|
98
94
|
marker = f"; {requirement.marker}"
|
|
99
95
|
|
|
100
|
-
pinned = f"{requirement.name}{extras}
|
|
96
|
+
pinned = f"{requirement.name}{extras}~={metadata.version}{marker}"
|
|
101
97
|
logger.info(f'Pinning editable dependency "{dep}" -> "{pinned}".')
|
|
102
98
|
return pinned
|
|
103
99
|
|
|
104
|
-
def _process_deps(self, deps: str|list[str]) -> str|list[str]:
|
|
100
|
+
def _process_deps(self, deps: str | list[str]) -> str | list[str]:
|
|
105
101
|
|
|
106
102
|
if isinstance(deps, list):
|
|
107
|
-
deps=[self._process_deps(dep) for dep in deps]
|
|
108
|
-
deps=dedupe(deps)
|
|
103
|
+
deps = [self._process_deps(dep) for dep in deps]
|
|
104
|
+
deps = dedupe(deps)
|
|
109
105
|
return deps
|
|
110
106
|
|
|
111
|
-
dep=deps
|
|
112
|
-
dep=self._pin_editable(dep)
|
|
107
|
+
dep = deps
|
|
108
|
+
dep = self._pin_editable(dep)
|
|
113
109
|
|
|
114
110
|
return dep
|
|
115
111
|
|
|
116
|
-
|
|
117
112
|
def apply(self) -> Path | list[Path] | None:
|
|
118
113
|
if not self.path.exists():
|
|
119
114
|
logger.info(f'pyproject.toml not found: "{self.path}". Skipping.')
|
|
@@ -132,7 +127,6 @@ class IncrementorPyproject(Incrementor):
|
|
|
132
127
|
self.path.write_toml(data)
|
|
133
128
|
return self.path
|
|
134
129
|
|
|
135
|
-
|
|
136
130
|
@property
|
|
137
131
|
def _author(self) -> str:
|
|
138
132
|
if self.paths.metadata.is_client:
|
|
@@ -196,13 +190,11 @@ class IncrementorPyproject(Incrementor):
|
|
|
196
190
|
values_resolved += resolve_values(value)
|
|
197
191
|
return values_resolved
|
|
198
192
|
|
|
199
|
-
|
|
200
193
|
extras = {key: dedupe(resolve_values(key)) for key in dependencies}
|
|
201
194
|
install = extras.pop("install", [])
|
|
202
195
|
extras["all"] = dedupe(list(chain.from_iterable(extras.values())))
|
|
203
196
|
return install, extras
|
|
204
197
|
|
|
205
|
-
|
|
206
198
|
def _enrich_toml(self, data):
|
|
207
199
|
version = str(self.version)
|
|
208
200
|
logger.info(f'Applying release version "{version}" to "{self.path}"...')
|
|
@@ -223,7 +215,6 @@ class IncrementorPyproject(Incrementor):
|
|
|
223
215
|
elif "license-files" in project:
|
|
224
216
|
del project["license-files"]
|
|
225
217
|
|
|
226
|
-
|
|
227
218
|
deps_corio = data.get("tool", {}).get("corio", {}).get("dependencies", None)
|
|
228
219
|
if deps_corio is not None:
|
|
229
220
|
install, extras = self._flatten_dependencies(deps_corio)
|
|
@@ -232,7 +223,6 @@ class IncrementorPyproject(Incrementor):
|
|
|
232
223
|
else:
|
|
233
224
|
logger.info(f'No dependencies section found in "{self.path}". Skipping dependency enrichment.')
|
|
234
225
|
|
|
235
|
-
|
|
236
226
|
deps = project.get("dependencies")
|
|
237
227
|
if deps is not None:
|
|
238
228
|
project["dependencies"] = self._process_deps(deps)
|
|
@@ -278,89 +268,93 @@ class IncrementorPyproject(Incrementor):
|
|
|
278
268
|
del setuptools["script-files"]
|
|
279
269
|
|
|
280
270
|
dependencies = project.get("optional-dependencies", {})
|
|
281
|
-
|
|
271
|
+
gen = GeneratorTestEnvs(paths=self.paths, optionals=dependencies)
|
|
272
|
+
|
|
282
273
|
tox = ensure_table(data, ("tool", "tox"))
|
|
283
|
-
tox["requires"] =
|
|
284
|
-
tox["env_list"] = list(envs.keys())
|
|
285
|
-
tox["env"] = envs
|
|
274
|
+
tox["requires"] = gen.TOX_REQUIRES
|
|
275
|
+
tox["env_list"] = list(gen.envs.keys())
|
|
276
|
+
tox["env"] = gen.envs
|
|
286
277
|
|
|
287
278
|
return data
|
|
288
279
|
|
|
280
|
+
class GeneratorTestEnvs:
|
|
281
|
+
TEST_FILENAME_PREFIX = "test_"
|
|
282
|
+
TEST_FILENAME_SUFFIX = ".py"
|
|
283
|
+
TOX_REQUIRES = ["tox>=4.22", "tox-uv>=1"]
|
|
284
|
+
|
|
285
|
+
def __init__(self, *, paths, optionals: dict[str, list[str]]):
|
|
286
|
+
self.paths = paths
|
|
287
|
+
self.optionals = optionals
|
|
288
|
+
|
|
289
289
|
@cached_property
|
|
290
290
|
def _tests_modules(self) -> list[str]:
|
|
291
|
-
if not self.paths.tests.exists():
|
|
292
|
-
return []
|
|
293
|
-
|
|
294
291
|
modules = []
|
|
295
|
-
for path in
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
292
|
+
for path in self.paths.path.iterdir():
|
|
293
|
+
if path.is_dir():
|
|
294
|
+
if path.name in {"tests", "__pycache__"}:
|
|
295
|
+
continue
|
|
296
|
+
module = path.name
|
|
297
|
+
else:
|
|
298
|
+
if path.suffix != self.TEST_FILENAME_SUFFIX:
|
|
299
|
+
continue
|
|
300
|
+
if path.stem.startswith("_"):
|
|
301
|
+
continue
|
|
302
|
+
module = path.stem
|
|
303
|
+
|
|
304
|
+
path_test = self.get_path_test(module)
|
|
305
|
+
if not path_test.exists():
|
|
306
|
+
continue
|
|
307
|
+
modules.append(module)
|
|
308
|
+
|
|
309
|
+
return dedupe(sorted(modules))
|
|
310
|
+
|
|
311
|
+
@property
|
|
312
|
+
def deps_test(self):
|
|
313
|
+
return sorted(self.optionals['test'])
|
|
314
|
+
|
|
315
|
+
def get_deps(self, name):
|
|
316
|
+
|
|
318
317
|
deps = []
|
|
319
|
-
for
|
|
320
|
-
|
|
321
|
-
|
|
318
|
+
keys = [key for key in self.optionals.keys() if key == name or key.startswith(f"{name}.")]
|
|
319
|
+
for key in keys:
|
|
320
|
+
deps += self.optionals[key]
|
|
321
|
+
|
|
322
|
+
deps += self.deps_test
|
|
323
|
+
|
|
324
|
+
deps = sorted(dedupe(deps))
|
|
325
|
+
|
|
322
326
|
return deps
|
|
323
327
|
|
|
324
|
-
def
|
|
325
|
-
self
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
env = {
|
|
336
|
-
"description": f"Run {name} tests.",
|
|
337
|
-
"deps": deps,
|
|
338
|
-
"commands": [["python", "-m", "pytest", "-q", str(path_tests)]],
|
|
328
|
+
def get_path_test(self, module: str) -> Path:
|
|
329
|
+
return self.paths.tests / f"{self.TEST_FILENAME_PREFIX}{module}{self.TEST_FILENAME_SUFFIX}"
|
|
330
|
+
|
|
331
|
+
def get_env(self, name, deps, path):
|
|
332
|
+
path=path.relative_to(self.paths.repo)
|
|
333
|
+
return {
|
|
334
|
+
name: dict(
|
|
335
|
+
description=f"Run {name} tests.",
|
|
336
|
+
deps=deps,
|
|
337
|
+
commands=[["python", "-m", "pytest", "-q", str(path)]],
|
|
338
|
+
)
|
|
339
339
|
}
|
|
340
|
-
return env
|
|
341
340
|
|
|
342
|
-
|
|
341
|
+
@cached_property
|
|
342
|
+
def env(self):
|
|
343
|
+
name = self.paths.name_ns
|
|
344
|
+
path_tests = self.paths.tests
|
|
345
|
+
return self.get_env(name, self.deps_test, path_tests)
|
|
346
|
+
|
|
347
|
+
@cached_property
|
|
348
|
+
def envs(self) -> dict[str, dict]:
|
|
349
|
+
|
|
350
|
+
if not self._tests_modules:
|
|
351
|
+
return {}
|
|
352
|
+
|
|
343
353
|
if not self.paths.metadata.test_envs:
|
|
344
|
-
|
|
345
|
-
return {}
|
|
346
|
-
return {
|
|
347
|
-
self.paths.name_ns: self._tox_get_env(
|
|
348
|
-
name=self.paths.name_ns,
|
|
349
|
-
path_tests=self.paths.tests,
|
|
350
|
-
extras=["test"],
|
|
351
|
-
dependencies=dependencies,
|
|
352
|
-
)
|
|
353
|
-
}
|
|
354
|
+
return self.env
|
|
354
355
|
|
|
355
356
|
envs = {}
|
|
356
357
|
for module in self._tests_modules:
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
envs[name] = self._tox_get_env(
|
|
361
|
-
name=name,
|
|
362
|
-
path_tests=path_test,
|
|
363
|
-
extras=extras,
|
|
364
|
-
dependencies=dependencies,
|
|
365
|
-
)
|
|
366
|
-
return envs
|
|
358
|
+
path_test = self.get_path_test(module)
|
|
359
|
+
envs |= self.get_env(module, self.get_deps(module), path_test)
|
|
360
|
+
return envs
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "corio"
|
|
3
|
-
version = "2.2.
|
|
3
|
+
version = "2.2.7"
|
|
4
4
|
description = "Collection of high-level tools to simplify everyday development tasks, with a focus on AI/ML"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
dependencies = []
|
|
@@ -11,6 +11,7 @@ keywords = []
|
|
|
11
11
|
[project.optional-dependencies]
|
|
12
12
|
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", "pytest", "pytest-cov"]
|
|
13
13
|
test = ["pytest", "pytest-cov"]
|
|
14
|
+
yml = ["yamlscript", "pyyaml"]
|
|
14
15
|
yaml = ["yamlscript", "pyyaml"]
|
|
15
16
|
logging = ["logfire"]
|
|
16
17
|
parallel = ["dask[bag]", "distributed", "bokeh"]
|
|
@@ -82,7 +83,7 @@ Homepage = "https://github.com/fmtr/corio"
|
|
|
82
83
|
corio = "corio.entrypoint:main"
|
|
83
84
|
|
|
84
85
|
[tool.corio.metadata]
|
|
85
|
-
version = "2.2.
|
|
86
|
+
version = "2.2.7"
|
|
86
87
|
port = 0
|
|
87
88
|
base = "python"
|
|
88
89
|
description = "Collection of high-level tools to simplify everyday development tasks, with a focus on AI/ML"
|
|
@@ -103,7 +104,8 @@ test_envs = true
|
|
|
103
104
|
dev = ["logging", "version.dev", "debug", "sets", "yaml", "db.document", "infra"]
|
|
104
105
|
install = []
|
|
105
106
|
test = ["pytest", "pytest-cov"]
|
|
106
|
-
|
|
107
|
+
yml = ["yamlscript", "pyyaml"]
|
|
108
|
+
yaml = ["yml"]
|
|
107
109
|
logging = ["logfire", "version"]
|
|
108
110
|
parallel = ["dask[bag]", "distributed", "bokeh"]
|
|
109
111
|
tokenization = ["tokenizers"]
|
|
@@ -163,7 +165,7 @@ secrets = ["encrypt", "env.io", "yaml", "logging", "sets", "vcs"]
|
|
|
163
165
|
cli = ["sets", "logging"]
|
|
164
166
|
|
|
165
167
|
[tool.setuptools]
|
|
166
|
-
script-files = ["scripts/opt-dev-init", "scripts/docker-prune", "scripts/vlc-tn", "scripts/ha-addon-launch", "scripts/install-ys", "scripts/tasmota-config", "scripts/download", "scripts/run-script", "scripts/ssh-auth", "scripts/cru", "scripts/ssh-serve", "scripts/set-secure-path", "scripts/vm-launch", "scripts/auth-token", "scripts/set-user-sudo", "scripts/docker-build-bases", "scripts/fmtr-test-script", "scripts/compose-update", "scripts/add-ve-shell", "scripts/apt-headless", "scripts/snips-install", "scripts/install-ts", "scripts/tasmota-flash", "scripts/docs-deploy", "scripts/
|
|
168
|
+
script-files = ["scripts/opt-dev-init", "scripts/docker-prune", "scripts/vlc-tn", "scripts/ha-addon-launch", "scripts/install-ys", "scripts/tasmota-config", "scripts/download", "scripts/run-script", "scripts/ssh-auth", "scripts/cru", "scripts/ssh-serve", "scripts/set-secure-path", "scripts/vm-launch", "scripts/auth-token", "scripts/set-user-sudo", "scripts/docker-build-bases", "scripts/fmtr-test-script", "scripts/compose-update", "scripts/add-ve-shell", "scripts/apt-headless", "scripts/snips-install", "scripts/install-ts", "scripts/tasmota-flash", "scripts/docs-deploy", "scripts/parse-args", "scripts/docker-install-deps", "scripts/run-tests", "scripts/pypi-reserve", "scripts/install-docker", "scripts/set-password", "scripts/tasmota-terminal", "scripts/mirror-dir", "scripts/compress-dir", "scripts/pypi-check", "scripts/git-clone", "scripts/docker-sandbox", "scripts/docker-install-prod", "scripts/docker-sandbox-init", "scripts/install-browser", "scripts/docker-build-bases-dev", "scripts/apt-essentials", "scripts/encrypt-secrets", "scripts/add-user-path", "scripts/infra", "scripts/add-service"]
|
|
167
169
|
|
|
168
170
|
[tool.setuptools.packages.find]
|
|
169
171
|
where = ["."]
|
|
@@ -175,11 +177,11 @@ corio = ["pyproject.package.toml"]
|
|
|
175
177
|
|
|
176
178
|
[tool.tox]
|
|
177
179
|
requires = ["tox>=4.22", "tox-uv>=1"]
|
|
178
|
-
env_list = ["caching", "datatype", "dns", "dt", "encrypt", "env", "hash", "hook", "infra", "iterator", "jsn", "name", "path", "patterns", "rand", "strings", "toml", "tools"
|
|
180
|
+
env_list = ["caching", "datatype", "dns", "dt", "encrypt", "env", "hash", "hook", "infra", "iterator", "jsn", "name", "path", "patterns", "rand", "strings", "toml", "tools"]
|
|
179
181
|
|
|
180
182
|
[tool.tox.env.caching]
|
|
181
183
|
description = "Run caching tests."
|
|
182
|
-
deps = ["
|
|
184
|
+
deps = ["cachetools", "diskcache", "pytest", "pytest-cov"]
|
|
183
185
|
commands = [["python", "-m", "pytest", "-q", "corio/tests/test_caching.py"]]
|
|
184
186
|
|
|
185
187
|
[tool.tox.env.datatype]
|
|
@@ -189,7 +191,7 @@ commands = [["python", "-m", "pytest", "-q", "corio/tests/test_datatype.py"]]
|
|
|
189
191
|
|
|
190
192
|
[tool.tox.env.dns]
|
|
191
193
|
description = "Run dns tests."
|
|
192
|
-
deps = ["dnspython[doh]", "httpx", "httpx_retries", "logfire", "logfire[httpx]", "
|
|
194
|
+
deps = ["cachetools", "diskcache", "dnspython[doh]", "httpx", "httpx_retries", "logfire", "logfire[httpx]", "pytest", "pytest-cov"]
|
|
193
195
|
commands = [["python", "-m", "pytest", "-q", "corio/tests/test_dns.py"]]
|
|
194
196
|
|
|
195
197
|
[tool.tox.env.dt]
|
|
@@ -219,7 +221,7 @@ commands = [["python", "-m", "pytest", "-q", "corio/tests/test_hook.py"]]
|
|
|
219
221
|
|
|
220
222
|
[tool.tox.env.infra]
|
|
221
223
|
description = "Run infra tests."
|
|
222
|
-
deps = ["
|
|
224
|
+
deps = ["build", "deepmerge", "dotenv", "fastapi", "httpx", "httpx_retries", "logfire", "logfire[fastapi]", "logfire[httpx]", "mike", "mkdocs", "mkdocs-include-dir-to-nav", "mkdocs-material", "mkdocstrings[python]", "packaging", "pycountry", "pydantic", "pydantic-extra-types", "pydantic-settings", "pygit2", "pyrage", "pytest", "pytest-cov", "python-on-whales", "pyyaml", "semver", "setuptools", "tomlkit", "twine", "uvicorn[standard]", "yamlscript"]
|
|
223
225
|
commands = [["python", "-m", "pytest", "-q", "corio/tests/test_infra.py"]]
|
|
224
226
|
|
|
225
227
|
[tool.tox.env.iterator]
|
|
@@ -244,7 +246,7 @@ commands = [["python", "-m", "pytest", "-q", "corio/tests/test_path.py"]]
|
|
|
244
246
|
|
|
245
247
|
[tool.tox.env.patterns]
|
|
246
248
|
description = "Run patterns tests."
|
|
247
|
-
deps = ["
|
|
249
|
+
deps = ["pytest", "pytest-cov", "regex"]
|
|
248
250
|
commands = [["python", "-m", "pytest", "-q", "corio/tests/test_patterns.py"]]
|
|
249
251
|
|
|
250
252
|
[tool.tox.env.rand]
|
|
@@ -259,7 +261,7 @@ commands = [["python", "-m", "pytest", "-q", "corio/tests/test_strings.py"]]
|
|
|
259
261
|
|
|
260
262
|
[tool.tox.env.toml]
|
|
261
263
|
description = "Run toml tests."
|
|
262
|
-
deps = ["
|
|
264
|
+
deps = ["pytest", "pytest-cov", "tomlkit"]
|
|
263
265
|
commands = [["python", "-m", "pytest", "-q", "corio/tests/test_toml.py"]]
|
|
264
266
|
|
|
265
267
|
[tool.tox.env.tools]
|
|
@@ -267,11 +269,6 @@ description = "Run tools tests."
|
|
|
267
269
|
deps = ["pytest", "pytest-cov"]
|
|
268
270
|
commands = [["python", "-m", "pytest", "-q", "corio/tests/test_tools.py"]]
|
|
269
271
|
|
|
270
|
-
[tool.tox.env.yaml]
|
|
271
|
-
description = "Run yaml tests."
|
|
272
|
-
deps = ["yamlscript", "pyyaml", "pytest", "pytest-cov"]
|
|
273
|
-
commands = [["python", "-m", "pytest", "-q", "corio/tests/test_yaml.py"]]
|
|
274
|
-
|
|
275
272
|
[build-system]
|
|
276
273
|
requires = ["setuptools>=82", "wheel"]
|
|
277
274
|
build-backend = "setuptools.build_meta"
|
|
@@ -2,7 +2,7 @@ from types import SimpleNamespace
|
|
|
2
2
|
|
|
3
3
|
from packaging.requirements import Requirement
|
|
4
4
|
|
|
5
|
-
from corio.infra.incrementor_pyproject import IncrementorPyproject
|
|
5
|
+
from corio.infra.incrementor_pyproject import IncrementorPyproject, GeneratorTestEnvs
|
|
6
6
|
from corio.infra.releaser import Tester as ReleaserTester
|
|
7
7
|
from corio.path import Path
|
|
8
8
|
|
|
@@ -18,6 +18,8 @@ def _write_editable_repo(path_repo: Path, name: str, version: str) -> None:
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
def _make_incrementor(path_repo: Path, is_pre: bool = False, test_envs: bool = True) -> IncrementorPyproject:
|
|
21
|
+
path_package = path_repo / "corio"
|
|
22
|
+
path_package.mkdir(parents=True, exist_ok=True)
|
|
21
23
|
path_tests = path_repo / "corio" / "tests"
|
|
22
24
|
path_tests.mkdir(parents=True, exist_ok=True)
|
|
23
25
|
parent = SimpleNamespace(
|
|
@@ -25,6 +27,7 @@ def _make_incrementor(path_repo: Path, is_pre: bool = False, test_envs: bool = T
|
|
|
25
27
|
repo=path_repo,
|
|
26
28
|
pyproject_repo=path_repo / "pyproject.toml",
|
|
27
29
|
name_ns="corio",
|
|
30
|
+
path=path_package,
|
|
28
31
|
tests=path_tests,
|
|
29
32
|
metadata=SimpleNamespace(test_envs=test_envs),
|
|
30
33
|
),
|
|
@@ -48,7 +51,7 @@ def test_pin_editables_and_flatten_dependencies(tmp_path):
|
|
|
48
51
|
|
|
49
52
|
incrementor = _make_incrementor(path_main_repo)
|
|
50
53
|
|
|
51
|
-
assert incrementor._pin_editable("haco") == "haco
|
|
54
|
+
assert incrementor._pin_editable("haco") == "haco~=1.2.3"
|
|
52
55
|
assert incrementor._pin_editable("requests") == "requests"
|
|
53
56
|
|
|
54
57
|
install, extras = incrementor._flatten_dependencies(
|
|
@@ -76,7 +79,7 @@ def test_pin_editables_resolves_uv_source_path(tmp_path):
|
|
|
76
79
|
)
|
|
77
80
|
|
|
78
81
|
incrementor = _make_incrementor(path_main_repo)
|
|
79
|
-
assert incrementor._pin_editable("corio") == "corio
|
|
82
|
+
assert incrementor._pin_editable("corio") == "corio~=1.2.3"
|
|
80
83
|
|
|
81
84
|
|
|
82
85
|
def test_pin_editables_preserves_extras_and_skips_existing_specifiers(tmp_path):
|
|
@@ -98,9 +101,10 @@ def test_pin_editables_preserves_extras_and_skips_existing_specifiers(tmp_path):
|
|
|
98
101
|
req = Requirement(dep)
|
|
99
102
|
assert req.name == "haco"
|
|
100
103
|
assert req.extras == {"version.dev", "logging", "sets", "yaml", "debug", "caching", "api", "mqtt"}
|
|
101
|
-
assert str(req.specifier) == "
|
|
104
|
+
assert str(req.specifier) == "~=1.2.3"
|
|
102
105
|
|
|
103
|
-
assert incrementor._pin_editable("haco==1.0.0") == "haco==1.
|
|
106
|
+
assert incrementor._pin_editable("haco==1.0.0") == "haco==1.0.0"
|
|
107
|
+
assert incrementor._pin_editable("haco~=1.0.0") == "haco~=1.2.3"
|
|
104
108
|
assert incrementor._pin_editable("haco>=1.0.0") == "haco>=1.0.0"
|
|
105
109
|
|
|
106
110
|
|
|
@@ -142,7 +146,7 @@ def test_pin_editables_allows_prerelease_when_current_is_prerelease(tmp_path):
|
|
|
142
146
|
|
|
143
147
|
incrementor = _make_incrementor(path_main_repo, is_pre=True)
|
|
144
148
|
|
|
145
|
-
assert incrementor._pin_editable("haco") == "haco
|
|
149
|
+
assert incrementor._pin_editable("haco") == "haco~=1.2.3-rc.1"
|
|
146
150
|
|
|
147
151
|
|
|
148
152
|
def test_process_deps_pins_project_dependencies(tmp_path):
|
|
@@ -163,8 +167,13 @@ def test_process_deps_pins_project_dependencies(tmp_path):
|
|
|
163
167
|
dependencies = ["haco", "requests>=2"]
|
|
164
168
|
optional_dev = ["haco[logging]", "pytest"]
|
|
165
169
|
|
|
166
|
-
assert incrementor._process_deps(dependencies) == ["haco
|
|
167
|
-
assert incrementor._process_deps(optional_dev) == ["haco[logging]
|
|
170
|
+
assert incrementor._process_deps(dependencies) == ["haco~=1.2.3", "requests>=2"]
|
|
171
|
+
assert incrementor._process_deps(optional_dev) == ["haco[logging]~=1.2.3", "pytest"]
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
def _make_test_env_generator(path_repo: Path, *, test_envs: bool, dependencies: dict[str, list[str]]) -> GeneratorTestEnvs:
|
|
175
|
+
incrementor = _make_incrementor(path_repo, test_envs=test_envs)
|
|
176
|
+
return GeneratorTestEnvs(paths=incrementor.paths, optionals=dependencies)
|
|
168
177
|
|
|
169
178
|
|
|
170
179
|
def _make_tester(path_repo: Path, *, env_list: list[str] | None = None) -> ReleaserTester:
|
|
@@ -200,45 +209,40 @@ def _make_tester(path_repo: Path, *, env_list: list[str] | None = None) -> Relea
|
|
|
200
209
|
return ReleaserTester(parent)
|
|
201
210
|
|
|
202
211
|
|
|
203
|
-
def
|
|
212
|
+
def test_generator_test_envs_get_deps_merges_module_and_dotted_children(tmp_path):
|
|
204
213
|
path_repo = Path(tmp_path / "corio")
|
|
205
214
|
path_repo.mkdir(parents=True)
|
|
206
|
-
|
|
207
|
-
dependencies = {
|
|
215
|
+
generator = _make_test_env_generator(path_repo, test_envs=True, dependencies={
|
|
208
216
|
"test": ["pytest", "pytest-cov"],
|
|
209
217
|
"path": [],
|
|
210
218
|
"path.app": ["appdirs"],
|
|
211
219
|
"path.type": ["filetype"],
|
|
212
220
|
"strings": [],
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
assert
|
|
216
|
-
assert
|
|
217
|
-
assert incrementor._tox_get_extras_module("missing", dependencies) == ["test"]
|
|
221
|
+
})
|
|
222
|
+
assert generator.get_deps("path") == ["appdirs", "filetype", "pytest", "pytest-cov"]
|
|
223
|
+
assert generator.get_deps("strings") == ["pytest", "pytest-cov"]
|
|
224
|
+
assert generator.get_deps("missing") == ["pytest", "pytest-cov"]
|
|
218
225
|
|
|
219
226
|
|
|
220
|
-
def
|
|
227
|
+
def test_generator_test_envs_deps_resolves_superset(tmp_path):
|
|
221
228
|
path_repo = Path(tmp_path / "corio")
|
|
222
229
|
path_repo.mkdir(parents=True)
|
|
223
|
-
incrementor = _make_incrementor(path_repo, test_envs=True)
|
|
224
230
|
dependencies = {
|
|
225
231
|
"test": ["pytest", "pytest-cov"],
|
|
226
232
|
"path": [],
|
|
227
233
|
"path.app": ["appdirs"],
|
|
228
234
|
"path.type": ["filetype"],
|
|
229
235
|
}
|
|
236
|
+
generator = _make_test_env_generator(path_repo, test_envs=True, dependencies=dependencies)
|
|
237
|
+
(generator.paths.path / "path.py").write_text("", encoding="utf-8")
|
|
238
|
+
(generator.paths.tests / "test_path.py").write_text("", encoding="utf-8")
|
|
230
239
|
|
|
231
|
-
|
|
232
|
-
assert deps == ["appdirs", "filetype", "pytest", "pytest-cov"]
|
|
240
|
+
assert generator.get_deps("path") == ["appdirs", "filetype", "pytest", "pytest-cov"]
|
|
233
241
|
|
|
234
242
|
|
|
235
|
-
def
|
|
243
|
+
def test_generator_test_envs_use_file_module_name_with_test_envs(tmp_path):
|
|
236
244
|
path_repo = Path(tmp_path / "corio")
|
|
237
245
|
path_repo.mkdir(parents=True)
|
|
238
|
-
incrementor = _make_incrementor(path_repo, test_envs=True)
|
|
239
|
-
(incrementor.paths.tests / "test_path.py").write_text("", encoding="utf-8")
|
|
240
|
-
(incrementor.paths.tests / "test_strings.py").write_text("", encoding="utf-8")
|
|
241
|
-
|
|
242
246
|
dependencies = {
|
|
243
247
|
"test": ["pytest", "pytest-cov"],
|
|
244
248
|
"path": [],
|
|
@@ -246,38 +250,45 @@ def test_incrementor_tox_envs_use_file_module_name_with_test_envs(tmp_path):
|
|
|
246
250
|
"path.type": ["filetype"],
|
|
247
251
|
"strings": [],
|
|
248
252
|
}
|
|
249
|
-
|
|
253
|
+
generator = _make_test_env_generator(path_repo, test_envs=True, dependencies=dependencies)
|
|
254
|
+
(generator.paths.path / "path.py").write_text("", encoding="utf-8")
|
|
255
|
+
(generator.paths.path / "strings.py").write_text("", encoding="utf-8")
|
|
256
|
+
(generator.paths.tests / "test_path.py").write_text("", encoding="utf-8")
|
|
257
|
+
(generator.paths.tests / "test_strings.py").write_text("", encoding="utf-8")
|
|
258
|
+
envs = generator.envs
|
|
250
259
|
|
|
251
260
|
assert set(envs) == {"path", "strings"}
|
|
252
261
|
assert envs["path"]["deps"] == ["appdirs", "filetype", "pytest", "pytest-cov"]
|
|
253
262
|
assert envs["strings"]["deps"] == ["pytest", "pytest-cov"]
|
|
254
263
|
|
|
255
264
|
|
|
256
|
-
def
|
|
265
|
+
def test_generator_test_envs_fall_back_to_single_env_when_test_envs_disabled(tmp_path):
|
|
257
266
|
path_repo = Path(tmp_path / "corio")
|
|
258
267
|
path_repo.mkdir(parents=True)
|
|
259
|
-
|
|
260
|
-
(
|
|
261
|
-
|
|
262
|
-
envs =
|
|
268
|
+
generator = _make_test_env_generator(path_repo, test_envs=False, dependencies={"test": ["pytest", "pytest-cov"]})
|
|
269
|
+
(generator.paths.path / "path.py").write_text("", encoding="utf-8")
|
|
270
|
+
(generator.paths.tests / "test_path.py").write_text("", encoding="utf-8")
|
|
271
|
+
envs = generator.envs
|
|
263
272
|
|
|
264
273
|
assert set(envs) == {"corio"}
|
|
265
274
|
assert envs["corio"]["deps"] == ["pytest", "pytest-cov"]
|
|
266
275
|
|
|
267
276
|
|
|
268
|
-
def
|
|
277
|
+
def test_generator_test_envs_resolves_dotted_extras(tmp_path):
|
|
269
278
|
path_repo = Path(tmp_path / "corio")
|
|
270
279
|
path_repo.mkdir(parents=True)
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
envs = incrementor._tox_envs(
|
|
280
|
+
generator = _make_test_env_generator(
|
|
281
|
+
path_repo,
|
|
282
|
+
test_envs=True,
|
|
275
283
|
dependencies={
|
|
276
284
|
"test": ["pytest", "pytest-cov"],
|
|
277
285
|
"env": [],
|
|
278
286
|
"env.io": ["dotenv"],
|
|
279
|
-
}
|
|
287
|
+
},
|
|
280
288
|
)
|
|
289
|
+
(generator.paths.path / "env.py").write_text("", encoding="utf-8")
|
|
290
|
+
(generator.paths.tests / "test_env.py").write_text("", encoding="utf-8")
|
|
291
|
+
envs = generator.envs
|
|
281
292
|
|
|
282
293
|
assert envs["env"]["deps"] == ["dotenv", "pytest", "pytest-cov"]
|
|
283
294
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: corio
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.7
|
|
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
|
|
@@ -44,6 +44,9 @@ Requires-Dist: pytest-cov; extra == "dev"
|
|
|
44
44
|
Provides-Extra: test
|
|
45
45
|
Requires-Dist: pytest; extra == "test"
|
|
46
46
|
Requires-Dist: pytest-cov; extra == "test"
|
|
47
|
+
Provides-Extra: yml
|
|
48
|
+
Requires-Dist: yamlscript; extra == "yml"
|
|
49
|
+
Requires-Dist: pyyaml; extra == "yml"
|
|
47
50
|
Provides-Extra: yaml
|
|
48
51
|
Requires-Dist: yamlscript; extra == "yaml"
|
|
49
52
|
Requires-Dist: pyyaml; extra == "yaml"
|