omdev 0.0.0.dev400__py3-none-any.whl → 0.0.0.dev401__py3-none-any.whl
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.
- omdev/cli/main.py +11 -8
- omdev/manifests/building.py +7 -3
- omdev/precheck/manifests.py +2 -2
- omdev/tools/git/messages.py +3 -3
- {omdev-0.0.0.dev400.dist-info → omdev-0.0.0.dev401.dist-info}/METADATA +2 -2
- {omdev-0.0.0.dev400.dist-info → omdev-0.0.0.dev401.dist-info}/RECORD +10 -10
- {omdev-0.0.0.dev400.dist-info → omdev-0.0.0.dev401.dist-info}/WHEEL +0 -0
- {omdev-0.0.0.dev400.dist-info → omdev-0.0.0.dev401.dist-info}/entry_points.txt +0 -0
- {omdev-0.0.0.dev400.dist-info → omdev-0.0.0.dev401.dist-info}/licenses/LICENSE +0 -0
- {omdev-0.0.0.dev400.dist-info → omdev-0.0.0.dev401.dist-info}/top_level.txt +0 -0
omdev/cli/main.py
CHANGED
@@ -13,7 +13,8 @@ import typing as ta
|
|
13
13
|
|
14
14
|
from omlish import check
|
15
15
|
from omlish.lite.cached import cached_nullary
|
16
|
-
from omlish.manifests.globals import
|
16
|
+
from omlish.manifests.globals import GlobalManifestLoader
|
17
|
+
from omlish.manifests.loading import ManifestLoader
|
17
18
|
|
18
19
|
from .types import CliCmd
|
19
20
|
from .types import CliFunc
|
@@ -183,16 +184,18 @@ def _build_arg_parser() -> argparse.ArgumentParser:
|
|
183
184
|
|
184
185
|
|
185
186
|
def _build_cmd_set(args: ta.Any) -> CliCmdSet:
|
186
|
-
ldr =
|
187
|
-
|
188
|
-
|
187
|
+
ldr = ManifestLoader(
|
188
|
+
**ManifestLoader.kwargs_from_entry_point(
|
189
|
+
globals(),
|
190
|
+
**GlobalManifestLoader.default_kwargs(),
|
191
|
+
),
|
189
192
|
)
|
190
193
|
|
191
194
|
#
|
192
195
|
|
193
|
-
pkgs = ldr.
|
194
|
-
|
195
|
-
|
196
|
+
pkgs = ldr.scan_or_discover_packages(
|
197
|
+
specified_root_dirs=args.cli_pkg_root,
|
198
|
+
fallback_root_dir=os.getcwd(),
|
196
199
|
)
|
197
200
|
|
198
201
|
#
|
@@ -200,7 +203,7 @@ def _build_cmd_set(args: ta.Any) -> CliCmdSet:
|
|
200
203
|
lst: list[CliCmd] = []
|
201
204
|
|
202
205
|
for m in ldr.load(*pkgs, only=[CliModule]):
|
203
|
-
lst.append(check.isinstance(m.value, CliModule))
|
206
|
+
lst.append(check.isinstance(m.value(), CliModule))
|
204
207
|
|
205
208
|
lst.extend(_CLI_FUNCS)
|
206
209
|
|
omdev/manifests/building.py
CHANGED
@@ -9,6 +9,10 @@ TODO:
|
|
9
9
|
- is this lite? or not?
|
10
10
|
- can this run externally? or not? what does it have to import?
|
11
11
|
- has to import manifest classes, but not modules with manifest magics
|
12
|
+
- !! can make lite / amalg / embeddable with 'manifest base class markers':
|
13
|
+
- rather than issubclass(cls, ModAttrManifest), can do if cls.__omlish_manifest_class__ == 'mod_attr'
|
14
|
+
- reject unknowns
|
15
|
+
- can analyze statically
|
12
16
|
|
13
17
|
See (entry_points):
|
14
18
|
- https://github.com/pytest-dev/pluggy/blob/main/src/pluggy/_manager.py#L405
|
@@ -37,7 +41,7 @@ from omlish.lite.imports import import_attr
|
|
37
41
|
from omlish.lite.json import json_dumps_pretty
|
38
42
|
from omlish.lite.logs import log
|
39
43
|
from omlish.manifests.base import ModAttrManifest
|
40
|
-
from omlish.manifests.globals import
|
44
|
+
from omlish.manifests.globals import GlobalManifestLoader
|
41
45
|
from omlish.manifests.types import Manifest
|
42
46
|
from omlish.manifests.types import ManifestOrigin
|
43
47
|
|
@@ -427,5 +431,5 @@ def check_package_manifests(
|
|
427
431
|
[(key, value_dct)] = manifest.value.items()
|
428
432
|
if key.startswith('$.'):
|
429
433
|
key = f'${name}{key[1:]}'
|
430
|
-
cls =
|
431
|
-
value =
|
434
|
+
cls = GlobalManifestLoader.instance()._load_class(key) # noqa
|
435
|
+
value = GlobalManifestLoader.instance()._instantiate_value(cls, **value_dct) # noqa
|
omdev/precheck/manifests.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import dataclasses as dc
|
2
2
|
import typing as ta
|
3
3
|
|
4
|
-
from omlish.manifests.globals import
|
4
|
+
from omlish.manifests.globals import GlobalManifestLoader
|
5
5
|
|
6
6
|
from .base import Precheck
|
7
7
|
from .base import PrecheckContext
|
@@ -23,6 +23,6 @@ class ManifestsPrecheck(Precheck['ManifestsPrecheck.Config']):
|
|
23
23
|
async def run(self) -> ta.AsyncGenerator[Precheck.Violation]:
|
24
24
|
for src_root in sorted(self._context.src_roots):
|
25
25
|
try:
|
26
|
-
|
26
|
+
GlobalManifestLoader.load(src_root)
|
27
27
|
except Exception as e: # noqa
|
28
28
|
yield Precheck.Violation(self, f'Error loading manifest for {src_root}: {e!r}')
|
omdev/tools/git/messages.py
CHANGED
@@ -54,10 +54,10 @@ class StaticGitMessageGeneratorManifest(StaticModAttrManifest, GitMessageGenerat
|
|
54
54
|
|
55
55
|
@cached.function
|
56
56
|
def load_message_generator_manifests() -> ta.Sequence[GitMessageGeneratorManifest]:
|
57
|
-
ldr = manifest_globals.
|
58
|
-
pkgs = ldr.
|
57
|
+
ldr = manifest_globals.GlobalManifestLoader.instance()
|
58
|
+
pkgs = ldr.scan_or_discover_packages(fallback_root_dir=os.getcwd())
|
59
59
|
mfs = ldr.load(*pkgs, only=[GitMessageGeneratorManifest])
|
60
|
-
return [mf.value for mf in mfs]
|
60
|
+
return [mf.value() for mf in mfs]
|
61
61
|
|
62
62
|
|
63
63
|
@cached.function
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: omdev
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev401
|
4
4
|
Summary: omdev
|
5
5
|
Author: wrmsr
|
6
6
|
License-Expression: BSD-3-Clause
|
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
14
14
|
Requires-Python: >=3.13
|
15
15
|
Description-Content-Type: text/markdown
|
16
16
|
License-File: LICENSE
|
17
|
-
Requires-Dist: omlish==0.0.0.
|
17
|
+
Requires-Dist: omlish==0.0.0.dev401
|
18
18
|
Provides-Extra: all
|
19
19
|
Requires-Dist: black~=25.1; extra == "all"
|
20
20
|
Requires-Dist: pycparser~=2.22; extra == "all"
|
@@ -113,7 +113,7 @@ omdev/cli/__main__.py,sha256=mOJpgc07o0r5luQ1DlX4tk2PqZkgmbwPbdzJ3KmtjgQ,138
|
|
113
113
|
omdev/cli/_pathhack.py,sha256=UshIZX3oeXq0De-9X28gy2LgKMZDf_dzabdkUhZJdNA,2124
|
114
114
|
omdev/cli/clicli.py,sha256=TZnQYHyyh97B6N_pVYYduYgt03s8Yp5mrJ7wblXWSWY,6308
|
115
115
|
omdev/cli/install.py,sha256=oB34AOwu07sqEztW_z5mgorAFoP_Tw556XiTPj2WSM0,4904
|
116
|
-
omdev/cli/main.py,sha256=
|
116
|
+
omdev/cli/main.py,sha256=eUvc64Wi6ROcSG7V_yzrmhpY2CgR12cyz9eJGXE0xlI,6885
|
117
117
|
omdev/cli/managers.py,sha256=BV98_n30Jj63OJrFgRoVZRfICxMLXEZKoEn4rMj9LV4,1160
|
118
118
|
omdev/cli/types.py,sha256=SH88B81otsSYNM-PM3Ry1wgLLvyg2M6fBJkWOajWIWM,485
|
119
119
|
omdev/clipboard/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -182,7 +182,7 @@ omdev/magic/styles.py,sha256=6LAL7XR3fkkH2rh-8nwUvdCYVHBkQxCfP0oEuPuw1Bg,670
|
|
182
182
|
omdev/manifests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
183
183
|
omdev/manifests/__main__.py,sha256=JqyVDyV7_jo-NZ3wSs5clDU_xCMlxzJv-XFohoZWQ7E,174
|
184
184
|
omdev/manifests/_dumping.py,sha256=RyphKkXhTnb8zWqcWjAR-GN8vNbBM9-PrZ3fJEvF1RE,44230
|
185
|
-
omdev/manifests/building.py,sha256=
|
185
|
+
omdev/manifests/building.py,sha256=O-SBzMfqXAfLVunQJ29fzV6zCaMrrM3lVpf7iFHCxuM,13568
|
186
186
|
omdev/manifests/dumping.py,sha256=WF911eYL3LT6powrQT3w83XIM_RdExDgTSsGiNomSIo,4506
|
187
187
|
omdev/manifests/main.py,sha256=mYb8iM5bdwaO8jSd9_hIBSoYLf2h7e0iLb9aCCbgJ6c,2175
|
188
188
|
omdev/mypy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -218,7 +218,7 @@ omdev/precheck/git.py,sha256=O8rNQZ_vlHec0pOFbK6LOkbly5ZIUYT_HXRMqQX8GaI,774
|
|
218
218
|
omdev/precheck/imports.py,sha256=3loQxHMrpI0ce4-le77NCSxutLac_5vDW4UDX7KWWg8,2565
|
219
219
|
omdev/precheck/lite.py,sha256=qd6nXWEVut8aBSRD_NxnxXGRNa9ue8mu8ND8rGLisE4,4710
|
220
220
|
omdev/precheck/main.py,sha256=_1A5wiu9p2th1dn_17w1ZIFtMmCIOaTFpWyvK0jopEA,4374
|
221
|
-
omdev/precheck/manifests.py,sha256=
|
221
|
+
omdev/precheck/manifests.py,sha256=5Hlo_3BF5HbcLPxn93fhDS9yy9k6iL2vFsqFNfoU9q4,799
|
222
222
|
omdev/precheck/scripts.py,sha256=6nb_lDgyX7u9kdF_BU6ubY01q_jGk96VH9q9gpOieng,1753
|
223
223
|
omdev/precheck/unicode.py,sha256=VUNDCrlfUas_U8ugV_q0eFUXuBgKjS8YdCFm0FXREXo,2583
|
224
224
|
omdev/ptk/__init__.py,sha256=4zhIfvhebFj4TJRRN1SQkcAe-7elizcfZLsD-fIlZsI,5198
|
@@ -303,7 +303,7 @@ omdev/tools/git/__main__.py,sha256=gI87SBUgTkKUcUM-RtZWnei-UUDDqzbr5aPztb-gvbE,1
|
|
303
303
|
omdev/tools/git/cli.py,sha256=I4AiCTz4OCzK6s8J2TJF1eYw9FH2JIK_CsdjQH_9UTE,16757
|
304
304
|
omdev/tools/git/cloning.py,sha256=CNGBBMoWaTBJW4SZTf1VvhDFSm0yg7qDfNwZun_PFbU,891
|
305
305
|
omdev/tools/git/consts.py,sha256=JuXivUNDkNhM4pe97icjRVAKM8cNRbrODquHINNKqOE,40
|
306
|
-
omdev/tools/git/messages.py,sha256=
|
306
|
+
omdev/tools/git/messages.py,sha256=ZZuDMDGnMo3se-EE2mJbRDOFlaIBUBT6fMX0DRG9yD8,2459
|
307
307
|
omdev/tools/json/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
308
308
|
omdev/tools/json/__main__.py,sha256=wqpkN_NsQyNwKW4qjVj8ADJ4_C98KhrFBtE-Z1UamfU,168
|
309
309
|
omdev/tools/json/cli.py,sha256=8aXX3ijU3lvPZamkIyUOz-vlBmyIdaX7dCQq5rN7adE,10193
|
@@ -321,9 +321,9 @@ omdev/tools/jsonview/resources/jsonview.js,sha256=faDvXDOXKvEvjOuIlz4D3F2ReQXb_b
|
|
321
321
|
omdev/tools/pawk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
322
322
|
omdev/tools/pawk/__main__.py,sha256=VCqeRVnqT1RPEoIrqHFSu4PXVMg4YEgF4qCQm90-eRI,66
|
323
323
|
omdev/tools/pawk/pawk.py,sha256=ao5mdrpiSU4AZ8mBozoEaV3UVlmVTnRG9wD9XP70MZE,11429
|
324
|
-
omdev-0.0.0.
|
325
|
-
omdev-0.0.0.
|
326
|
-
omdev-0.0.0.
|
327
|
-
omdev-0.0.0.
|
328
|
-
omdev-0.0.0.
|
329
|
-
omdev-0.0.0.
|
324
|
+
omdev-0.0.0.dev401.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
325
|
+
omdev-0.0.0.dev401.dist-info/METADATA,sha256=RLScNFrnOubL8SappIzdHqIWaA3uKwZ8kK0S_5o3XrA,5094
|
326
|
+
omdev-0.0.0.dev401.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
327
|
+
omdev-0.0.0.dev401.dist-info/entry_points.txt,sha256=dHLXFmq5D9B8qUyhRtFqTGWGxlbx3t5ejedjrnXNYLU,33
|
328
|
+
omdev-0.0.0.dev401.dist-info/top_level.txt,sha256=1nr7j30fEWgLYHW3lGR9pkdHkb7knv1U1ES1XRNVQ6k,6
|
329
|
+
omdev-0.0.0.dev401.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|