omdev 0.0.0.dev41__tar.gz → 0.0.0.dev42__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.
Potentially problematic release.
This version of omdev might be problematic. Click here for more details.
- {omdev-0.0.0.dev41/omdev.egg-info → omdev-0.0.0.dev42}/PKG-INFO +2 -2
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/.manifests.json +12 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cache/data/cache.py +74 -4
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cache/data/specs.py +5 -0
- omdev-0.0.0.dev42/omdev/cli/clicmds.py +81 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cli/main.py +2 -13
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42/omdev.egg-info}/PKG-INFO +2 -2
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev.egg-info/SOURCES.txt +1 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev.egg-info/requires.txt +1 -1
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/pyproject.toml +2 -2
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/LICENSE +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/MANIFEST.in +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/README.rst +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/__about__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/__init__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/amalg/__init__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/amalg/__main__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/amalg/amalg.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/bracepy.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cache/__init__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cache/compute/__init__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cache/compute/cache.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cache/compute/contexts.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cache/compute/currents.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cache/compute/fns.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cache/compute/resolvers.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cache/compute/storage.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cache/compute/types.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cache/data/__init__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cache/data/actions.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cache/data/consts.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cache/data/defaults.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cache/data/manifests.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/__init__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/_boilerplate.cc +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/_distutils/LICENSE +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/_distutils/__init__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/_distutils/build_ext.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/_distutils/compilers/__init__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/_distutils/compilers/ccompiler.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/_distutils/compilers/options.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/_distutils/compilers/unixccompiler.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/_distutils/dir_util.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/_distutils/errors.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/_distutils/extension.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/_distutils/file_util.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/_distutils/modified.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/_distutils/spawn.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/_distutils/sysconfig.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/_distutils/util.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/_distutils/version.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/build.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/cmake.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/importhook.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/magic.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cexts/scan.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/classdot.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cli/__init__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cli/__main__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cli/install.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cli/types.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/cmake.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/findimports.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/findmagic.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/git.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/interp/__init__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/interp/__main__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/interp/cli.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/interp/inspect.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/interp/providers.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/interp/pyenv.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/interp/resolvers.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/interp/standalone.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/interp/system.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/interp/types.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/manifests/__init__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/manifests/build.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/manifests/load.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/manifests/types.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/mypy/__init__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/mypy/debug.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/packaging/__init__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/packaging/names.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/packaging/requires.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/packaging/specifiers.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/packaging/versions.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/precheck/__init__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/precheck/__main__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/precheck/base.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/precheck/git.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/precheck/lite.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/precheck/precheck.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/precheck/scripts.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/pyproject/__init__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/pyproject/__main__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/pyproject/cexts.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/pyproject/cli.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/pyproject/configs.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/pyproject/pkg.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/pyproject/reqs.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/revisions.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/scripts/__init__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/scripts/bumpversion.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/scripts/execrss.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/scripts/exectime.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/scripts/importtrace.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/scripts/interp.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/scripts/pyproject.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/secrets.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/tokens.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/toml/__init__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/toml/parser.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/toml/writer.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/tools/__init__.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/tools/dockertools.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/tools/gittools.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/tools/importscan.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/tools/piptools.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/tools/proftools.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/tools/rst.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/tools/sqlrepl.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev/wheelfile.py +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev.egg-info/dependency_links.txt +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev.egg-info/entry_points.txt +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/omdev.egg-info/top_level.txt +0 -0
- {omdev-0.0.0.dev41 → omdev-0.0.0.dev42}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: omdev
|
|
3
|
-
Version: 0.0.0.
|
|
3
|
+
Version: 0.0.0.dev42
|
|
4
4
|
Summary: omdev
|
|
5
5
|
Author: wrmsr
|
|
6
6
|
License: BSD-3-Clause
|
|
@@ -12,7 +12,7 @@ Classifier: Operating System :: OS Independent
|
|
|
12
12
|
Classifier: Operating System :: POSIX
|
|
13
13
|
Requires-Python: ~=3.12
|
|
14
14
|
License-File: LICENSE
|
|
15
|
-
Requires-Dist: omlish==0.0.0.
|
|
15
|
+
Requires-Dist: omlish==0.0.0.dev42
|
|
16
16
|
Provides-Extra: all
|
|
17
17
|
Requires-Dist: pycparser~=2.22; extra == "all"
|
|
18
18
|
Requires-Dist: cffi~=1.17; extra == "all"
|
|
@@ -35,6 +35,18 @@
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
+
{
|
|
39
|
+
"module": ".cli.clicmds",
|
|
40
|
+
"attr": "_CLI_MODULE",
|
|
41
|
+
"file": "omdev/cli/clicmds.py",
|
|
42
|
+
"line": 55,
|
|
43
|
+
"value": {
|
|
44
|
+
"$.cli.types.CliModule": {
|
|
45
|
+
"cmd_name": "cli",
|
|
46
|
+
"mod_name": "omdev.cli.clicmds"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
38
50
|
{
|
|
39
51
|
"module": ".interp.__main__",
|
|
40
52
|
"attr": "_CLI_MODULE",
|
|
@@ -10,11 +10,14 @@ TODO:
|
|
|
10
10
|
- chaining? or is this compcache..
|
|
11
11
|
- download resume ala hf_hub
|
|
12
12
|
"""
|
|
13
|
+
import contextlib
|
|
13
14
|
import logging
|
|
14
15
|
import os.path
|
|
15
16
|
import shutil
|
|
16
17
|
import subprocess
|
|
17
18
|
import tempfile
|
|
19
|
+
import typing as ta
|
|
20
|
+
import urllib.error
|
|
18
21
|
import urllib.parse
|
|
19
22
|
import urllib.request
|
|
20
23
|
|
|
@@ -40,6 +43,57 @@ log = logging.getLogger(__name__)
|
|
|
40
43
|
##
|
|
41
44
|
|
|
42
45
|
|
|
46
|
+
def _url_retrieve(
|
|
47
|
+
req: urllib.request.Request,
|
|
48
|
+
out_file: str | None = None,
|
|
49
|
+
) -> tuple[str, ta.Any]:
|
|
50
|
+
p = urllib.parse.urlparse(req.full_url)
|
|
51
|
+
|
|
52
|
+
with contextlib.ExitStack() as es:
|
|
53
|
+
fp = es.enter_context(contextlib.closing(urllib.request.urlopen(req))) # noqa
|
|
54
|
+
|
|
55
|
+
headers = fp.info()
|
|
56
|
+
|
|
57
|
+
# Just return the local path and the "headers" for file:// URLs. No sense in performing a copy unless requested.
|
|
58
|
+
if p.scheme == 'file' and not out_file:
|
|
59
|
+
return os.path.normpath(p.path), headers
|
|
60
|
+
|
|
61
|
+
success = False
|
|
62
|
+
|
|
63
|
+
tfp: ta.Any
|
|
64
|
+
if out_file:
|
|
65
|
+
tfp = es.enter_context(open(out_file, 'wb'))
|
|
66
|
+
|
|
67
|
+
else:
|
|
68
|
+
tfp = es.enter_context(tempfile.NamedTemporaryFile(delete=False))
|
|
69
|
+
out_file = tfp.name
|
|
70
|
+
|
|
71
|
+
def _cleanup():
|
|
72
|
+
if not success and out_file:
|
|
73
|
+
os.unlink(out_file)
|
|
74
|
+
|
|
75
|
+
es.enter_context(lang.defer(_cleanup)) # noqa
|
|
76
|
+
|
|
77
|
+
result = out_file, headers
|
|
78
|
+
size = -1
|
|
79
|
+
read = 0
|
|
80
|
+
if 'content-length' in headers:
|
|
81
|
+
size = int(headers['Content-Length'])
|
|
82
|
+
|
|
83
|
+
while block := fp.read(1024 * 8):
|
|
84
|
+
read += len(block)
|
|
85
|
+
tfp.write(block)
|
|
86
|
+
|
|
87
|
+
if size >= 0 and read < size:
|
|
88
|
+
raise urllib.error.ContentTooShortError(
|
|
89
|
+
f'retrieval incomplete: got only {read} out of {size} bytes',
|
|
90
|
+
result, # type: ignore
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
success = True
|
|
94
|
+
return result # type: ignore
|
|
95
|
+
|
|
96
|
+
|
|
43
97
|
class Cache:
|
|
44
98
|
def __init__(self, base_dir: str) -> None:
|
|
45
99
|
super().__init__()
|
|
@@ -49,16 +103,32 @@ class Cache:
|
|
|
49
103
|
|
|
50
104
|
#
|
|
51
105
|
|
|
52
|
-
def _fetch_url(
|
|
106
|
+
def _fetch_url(
|
|
107
|
+
self,
|
|
108
|
+
url: str,
|
|
109
|
+
out_file: str,
|
|
110
|
+
*,
|
|
111
|
+
headers: ta.Mapping[str, str] | None = None,
|
|
112
|
+
) -> None:
|
|
53
113
|
log.info('Fetching url: %s -> %s', url, out_file)
|
|
54
114
|
|
|
55
|
-
|
|
115
|
+
_url_retrieve(
|
|
116
|
+
urllib.request.Request( # noqa
|
|
117
|
+
url,
|
|
118
|
+
**(dict(headers=headers) if headers is not None else {}), # type: ignore
|
|
119
|
+
),
|
|
120
|
+
out_file,
|
|
121
|
+
)
|
|
56
122
|
|
|
57
123
|
def _fetch_into(self, spec: Spec, data_dir: str) -> None:
|
|
58
124
|
log.info('Fetching spec: %s %r -> %s', spec.digest, spec, data_dir)
|
|
59
125
|
|
|
60
126
|
if isinstance(spec, UrlSpec):
|
|
61
|
-
self._fetch_url(
|
|
127
|
+
self._fetch_url(
|
|
128
|
+
spec.url,
|
|
129
|
+
os.path.join(data_dir, spec.file_name_or_default),
|
|
130
|
+
headers=spec.headers,
|
|
131
|
+
)
|
|
62
132
|
|
|
63
133
|
elif isinstance(spec, GithubContentSpec):
|
|
64
134
|
for repo_file in spec.files:
|
|
@@ -104,7 +174,7 @@ class Cache:
|
|
|
104
174
|
|
|
105
175
|
def _perform_action(self, action: Action, data_dir: str) -> None:
|
|
106
176
|
if isinstance(action, ExtractAction):
|
|
107
|
-
for f in action.files:
|
|
177
|
+
for f in [action.files] if isinstance(action.files, str) else action.files:
|
|
108
178
|
file = os.path.join(data_dir, f)
|
|
109
179
|
if not os.path.isfile(file):
|
|
110
180
|
raise Exception(f'Not file: {file}')
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import hashlib
|
|
2
|
+
import operator
|
|
2
3
|
import typing as ta
|
|
3
4
|
import urllib.parse
|
|
4
5
|
import urllib.request
|
|
@@ -59,6 +60,10 @@ class UrlSpec(Spec):
|
|
|
59
60
|
url: str = dc.xfield(validate=lambda u: bool(urllib.parse.urlparse(u)))
|
|
60
61
|
file_name: str | None = None
|
|
61
62
|
|
|
63
|
+
_: dc.KW_ONLY
|
|
64
|
+
|
|
65
|
+
headers: ta.Mapping[str, str] | None = dc.field(default=None) | msh.update_field_metadata(omit_if=operator.not_)
|
|
66
|
+
|
|
62
67
|
@cached.property
|
|
63
68
|
def file_name_or_default(self) -> str:
|
|
64
69
|
if self.file_name is not None:
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import inspect
|
|
3
|
+
import os
|
|
4
|
+
import subprocess
|
|
5
|
+
import sys
|
|
6
|
+
|
|
7
|
+
from omlish import __about__
|
|
8
|
+
|
|
9
|
+
from . import install
|
|
10
|
+
from .types import CliModule
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _print_version(args) -> None:
|
|
14
|
+
print(__about__.__version__)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _print_revision(args) -> None:
|
|
18
|
+
print(__about__.__revision__)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _reinstall(args) -> None:
|
|
22
|
+
mod_name = globals()['__spec__'].name
|
|
23
|
+
tool_name = '.'.join([mod_name.partition('.')[0], 'tools', 'piptools'])
|
|
24
|
+
|
|
25
|
+
out = subprocess.check_output([
|
|
26
|
+
sys.executable,
|
|
27
|
+
'-m',
|
|
28
|
+
tool_name,
|
|
29
|
+
'list-root-dists',
|
|
30
|
+
]).decode()
|
|
31
|
+
|
|
32
|
+
deps = sorted(
|
|
33
|
+
({s for l in out.splitlines() if (s := l.strip())} | set(args.extra_deps or []))
|
|
34
|
+
- {install.DEFAULT_CLI_PKG} # noqa
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
if deps:
|
|
38
|
+
print('Reinstalling with following additional dependencies:')
|
|
39
|
+
print('\n'.join(' ' + d for d in deps))
|
|
40
|
+
else:
|
|
41
|
+
print('No additional dependencies detected.')
|
|
42
|
+
print()
|
|
43
|
+
print('Continue with reinstall? (ctrl-c to cancel)')
|
|
44
|
+
input()
|
|
45
|
+
|
|
46
|
+
install_src = inspect.getsource(install)
|
|
47
|
+
|
|
48
|
+
os.execl(
|
|
49
|
+
sys.executable,
|
|
50
|
+
'-c',
|
|
51
|
+
install_src,
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
# @omlish-manifest
|
|
56
|
+
_CLI_MODULE = CliModule('cli', __name__)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def _main(argv=None) -> None:
|
|
60
|
+
parser = argparse.ArgumentParser()
|
|
61
|
+
subparsers = parser.add_subparsers()
|
|
62
|
+
|
|
63
|
+
parser_version = subparsers.add_parser('version')
|
|
64
|
+
parser_version.set_defaults(func=_print_version)
|
|
65
|
+
|
|
66
|
+
parser_revision = subparsers.add_parser('revision')
|
|
67
|
+
parser_revision.set_defaults(func=_print_revision)
|
|
68
|
+
|
|
69
|
+
parser_reinstall = subparsers.add_parser('reinstall')
|
|
70
|
+
parser_reinstall.add_argument('extra_deps', nargs='*')
|
|
71
|
+
parser_reinstall.set_defaults(func=_reinstall)
|
|
72
|
+
|
|
73
|
+
args = parser.parse_args(argv)
|
|
74
|
+
if not getattr(args, 'func', None):
|
|
75
|
+
parser.print_help()
|
|
76
|
+
else:
|
|
77
|
+
args.func(args)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
if __name__ == '__main__':
|
|
81
|
+
_main()
|
|
@@ -10,8 +10,8 @@ import argparse
|
|
|
10
10
|
import os
|
|
11
11
|
import runpy
|
|
12
12
|
import sys
|
|
13
|
+
import typing as ta
|
|
13
14
|
|
|
14
|
-
from omlish import __about__
|
|
15
15
|
from omlish import check
|
|
16
16
|
|
|
17
17
|
from ..manifests.load import ManifestLoader
|
|
@@ -23,18 +23,7 @@ from .types import CliModule
|
|
|
23
23
|
##
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
print(__about__.__version__)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def _print_revision() -> None:
|
|
31
|
-
print(__about__.__revision__)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
_CLI_FUNCS = [
|
|
35
|
-
CliFunc('version', _print_version),
|
|
36
|
-
CliFunc('revision', _print_revision),
|
|
37
|
-
]
|
|
26
|
+
_CLI_FUNCS: ta.Sequence[CliFunc] = []
|
|
38
27
|
|
|
39
28
|
|
|
40
29
|
##
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: omdev
|
|
3
|
-
Version: 0.0.0.
|
|
3
|
+
Version: 0.0.0.dev42
|
|
4
4
|
Summary: omdev
|
|
5
5
|
Author: wrmsr
|
|
6
6
|
License: BSD-3-Clause
|
|
@@ -12,7 +12,7 @@ Classifier: Operating System :: OS Independent
|
|
|
12
12
|
Classifier: Operating System :: POSIX
|
|
13
13
|
Requires-Python: ~=3.12
|
|
14
14
|
License-File: LICENSE
|
|
15
|
-
Requires-Dist: omlish==0.0.0.
|
|
15
|
+
Requires-Dist: omlish==0.0.0.dev42
|
|
16
16
|
Provides-Extra: all
|
|
17
17
|
Requires-Dist: pycparser~=2.22; extra == "all"
|
|
18
18
|
Requires-Dist: cffi~=1.17; extra == "all"
|
|
@@ -12,7 +12,7 @@ authors = [
|
|
|
12
12
|
urls = {source = 'https://github.com/wrmsr/omlish'}
|
|
13
13
|
license = {text = 'BSD-3-Clause'}
|
|
14
14
|
requires-python = '~=3.12'
|
|
15
|
-
version = '0.0.0.
|
|
15
|
+
version = '0.0.0.dev42'
|
|
16
16
|
classifiers = [
|
|
17
17
|
'License :: OSI Approved :: BSD License',
|
|
18
18
|
'Development Status :: 2 - Pre-Alpha',
|
|
@@ -22,7 +22,7 @@ classifiers = [
|
|
|
22
22
|
]
|
|
23
23
|
description = 'omdev'
|
|
24
24
|
dependencies = [
|
|
25
|
-
'omlish == 0.0.0.
|
|
25
|
+
'omlish == 0.0.0.dev42',
|
|
26
26
|
]
|
|
27
27
|
|
|
28
28
|
[project.optional-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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|