omdev 0.0.0.dev10__tar.gz → 0.0.0.dev11__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.
- {omdev-0.0.0.dev10/omdev.egg-info → omdev-0.0.0.dev11}/PKG-INFO +2 -2
- omdev-0.0.0.dev11/README.rst +5 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/exts/cmake.py +18 -5
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/interp/pyenv.py +5 -1
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/pyproject/cli.py +7 -5
- omdev-0.0.0.dev11/omdev/scripts/bracepy.py +105 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/scripts/interp.py +5 -1
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/scripts/pyproject.py +12 -6
- omdev-0.0.0.dev11/omdev/tools/gittools.py +22 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11/omdev.egg-info}/PKG-INFO +2 -2
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev.egg-info/SOURCES.txt +2 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev.egg-info/requires.txt +1 -1
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/pyproject.toml +2 -2
- omdev-0.0.0.dev10/README.rst +0 -1
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/LICENSE +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/MANIFEST.in +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/__about__.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/__init__.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/amalg/__init__.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/amalg/__main__.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/amalg/amalg.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/classdot.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/cmake.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/exts/__init__.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/exts/_distutils/__init__.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/exts/_distutils/build_ext.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/exts/_distutils/compilers/__init__.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/exts/_distutils/compilers/ccompiler.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/exts/_distutils/compilers/options.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/exts/_distutils/compilers/unixccompiler.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/exts/_distutils/dir_util.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/exts/_distutils/errors.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/exts/_distutils/extension.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/exts/_distutils/file_util.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/exts/_distutils/modified.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/exts/_distutils/spawn.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/exts/_distutils/sysconfig.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/exts/_distutils/util.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/exts/_distutils/version.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/exts/build.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/exts/importhook.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/exts/scan.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/interp/__init__.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/interp/__main__.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/interp/cli.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/interp/inspect.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/interp/providers.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/interp/resolvers.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/interp/standalone.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/interp/system.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/interp/types.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/mypy/__init__.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/mypy/debug.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/pyproject/__init__.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/pyproject/__main__.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/pyproject/configs.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/pyproject/ext.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/pyproject/pkg.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/scripts/__init__.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/scripts/execrss.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/scripts/findimports.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/scripts/findmagic.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/scripts/traceimport.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/tokens.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/toml/__init__.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/toml/parser.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/toml/writer.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/tools/__init__.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/tools/dockertools.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/tools/sqlrepl.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/versioning/__init__.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/versioning/specifiers.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev/versioning/versions.py +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev.egg-info/dependency_links.txt +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/omdev.egg-info/top_level.txt +0 -0
- {omdev-0.0.0.dev10 → omdev-0.0.0.dev11}/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.dev11
|
|
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.dev11
|
|
16
16
|
Provides-Extra: all
|
|
17
17
|
Requires-Dist: pycparser>=2.22; extra == "all"
|
|
18
18
|
Requires-Dist: cffi>=1.17; extra == "all"
|
|
@@ -18,18 +18,23 @@ Done:
|
|
|
18
18
|
|
|
19
19
|
""" # noqa
|
|
20
20
|
import io
|
|
21
|
+
import logging
|
|
21
22
|
import os.path
|
|
22
23
|
import shutil
|
|
23
24
|
import sys
|
|
24
25
|
import sysconfig
|
|
25
26
|
|
|
26
27
|
from omlish import check
|
|
28
|
+
from omlish import logs
|
|
27
29
|
|
|
28
30
|
from .. import cmake
|
|
29
31
|
|
|
30
32
|
|
|
33
|
+
log = logging.getLogger(__name__)
|
|
34
|
+
|
|
35
|
+
|
|
31
36
|
def _main() -> None:
|
|
32
|
-
|
|
37
|
+
logs.configure_standard_logging('INFO')
|
|
33
38
|
|
|
34
39
|
prj_root = os.path.abspath(os.getcwd())
|
|
35
40
|
if not os.path.isfile(os.path.join(prj_root, 'pyproject.toml')):
|
|
@@ -51,9 +56,13 @@ def _main() -> None:
|
|
|
51
56
|
with open(os.path.join(cmake_dir, '.gitignore'), 'w') as f:
|
|
52
57
|
f.write('\n'.join(sorted(['/cmake-*', '/build'])))
|
|
53
58
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
59
|
+
# idea_dir = os.path.join(cmake_dir, '.idea')
|
|
60
|
+
# if not os.path.isdir(idea_dir):
|
|
61
|
+
# os.mkdir(idea_dir)
|
|
62
|
+
# idea_name_file = os.path.join(idea_dir, '.name')
|
|
63
|
+
# if not os.path.isfile(idea_name_file):
|
|
64
|
+
# with open(idea_name_file, 'w') as f:
|
|
65
|
+
# f.write('omlish')
|
|
57
66
|
|
|
58
67
|
venv_exe = sys.executable
|
|
59
68
|
venv_root = os.path.abspath(os.path.join(os.path.dirname(venv_exe), '..'))
|
|
@@ -138,8 +147,12 @@ def _main() -> None:
|
|
|
138
147
|
'omdev/exts/_boilerplate.cc',
|
|
139
148
|
'x/dev/c/junk.cc',
|
|
140
149
|
'x/dev/c/_uuid.cc',
|
|
150
|
+
'x/dev/c/csv/_csvloader.cc',
|
|
141
151
|
]:
|
|
142
152
|
ext_name = ext_src.rpartition('.')[0].replace('/', '__')
|
|
153
|
+
|
|
154
|
+
log.info('Adding cmake c extension: %s -> %s', ext_src, ext_name)
|
|
155
|
+
|
|
143
156
|
so_name = ''.join([
|
|
144
157
|
os.path.basename(ext_src).split('.')[0],
|
|
145
158
|
'.',
|
|
@@ -186,7 +199,7 @@ def _main() -> None:
|
|
|
186
199
|
],
|
|
187
200
|
))
|
|
188
201
|
|
|
189
|
-
print(out.getvalue())
|
|
202
|
+
# print(out.getvalue())
|
|
190
203
|
with open(os.path.join(cmake_dir, 'CMakeLists.txt'), 'w') as f:
|
|
191
204
|
f.write(out.getvalue())
|
|
192
205
|
|
|
@@ -67,8 +67,10 @@ class Pyenv:
|
|
|
67
67
|
return os.path.join(check_not_none(self.root()), 'bin', 'pyenv')
|
|
68
68
|
|
|
69
69
|
def version_exes(self) -> ta.List[ta.Tuple[str, str]]:
|
|
70
|
+
if (root := self.root()) is None:
|
|
71
|
+
return []
|
|
70
72
|
ret = []
|
|
71
|
-
vp = os.path.join(
|
|
73
|
+
vp = os.path.join(root, 'versions')
|
|
72
74
|
for dn in os.listdir(vp):
|
|
73
75
|
ep = os.path.join(vp, dn, 'bin', 'python')
|
|
74
76
|
if not os.path.isfile(ep):
|
|
@@ -77,6 +79,8 @@ class Pyenv:
|
|
|
77
79
|
return ret
|
|
78
80
|
|
|
79
81
|
def installable_versions(self) -> ta.List[str]:
|
|
82
|
+
if self.root() is None:
|
|
83
|
+
return []
|
|
80
84
|
ret = []
|
|
81
85
|
s = subprocess_check_output_str(self.exe(), 'install', '--list')
|
|
82
86
|
for l in s.splitlines():
|
|
@@ -26,6 +26,7 @@ import dataclasses as dc
|
|
|
26
26
|
import functools
|
|
27
27
|
import glob
|
|
28
28
|
import itertools
|
|
29
|
+
import multiprocessing as mp
|
|
29
30
|
import os.path
|
|
30
31
|
import shlex
|
|
31
32
|
import shutil
|
|
@@ -247,13 +248,12 @@ def _venv_cmd(args) -> None:
|
|
|
247
248
|
)
|
|
248
249
|
return
|
|
249
250
|
|
|
250
|
-
venv.create()
|
|
251
|
-
|
|
252
251
|
cmd = args.cmd
|
|
253
252
|
if not cmd:
|
|
254
|
-
|
|
253
|
+
venv.create()
|
|
255
254
|
|
|
256
255
|
elif cmd == 'python':
|
|
256
|
+
venv.create()
|
|
257
257
|
os.execl(
|
|
258
258
|
(exe := venv.exe()),
|
|
259
259
|
exe,
|
|
@@ -261,10 +261,12 @@ def _venv_cmd(args) -> None:
|
|
|
261
261
|
)
|
|
262
262
|
|
|
263
263
|
elif cmd == 'exe':
|
|
264
|
+
venv.create()
|
|
264
265
|
check_not(args.args)
|
|
265
266
|
print(venv.exe())
|
|
266
267
|
|
|
267
268
|
elif cmd == 'run':
|
|
269
|
+
venv.create()
|
|
268
270
|
sh = check_not_none(shutil.which('bash'))
|
|
269
271
|
script = ' '.join(args.args)
|
|
270
272
|
if not script:
|
|
@@ -281,6 +283,7 @@ def _venv_cmd(args) -> None:
|
|
|
281
283
|
print('\n'.join(venv.srcs()))
|
|
282
284
|
|
|
283
285
|
elif cmd == 'test':
|
|
286
|
+
venv.create()
|
|
284
287
|
subprocess_check_call(venv.exe(), '-m', 'pytest', *(args.args or []), *venv.srcs())
|
|
285
288
|
|
|
286
289
|
else:
|
|
@@ -306,11 +309,10 @@ def _pkg_cmd(args) -> None:
|
|
|
306
309
|
build_output_dir = 'dist'
|
|
307
310
|
run_build = bool(args.build)
|
|
308
311
|
|
|
309
|
-
num_threads = 8
|
|
310
|
-
|
|
311
312
|
if run_build:
|
|
312
313
|
os.makedirs(build_output_dir, exist_ok=True)
|
|
313
314
|
|
|
315
|
+
num_threads = max(mp.cpu_count() // 2, 1)
|
|
314
316
|
with cf.ThreadPoolExecutor(num_threads) as ex:
|
|
315
317
|
futs = [
|
|
316
318
|
ex.submit(functools.partial(
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# !/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
https://github.com/umlet/pwk/blob/dc23b3400108a71947a695f1fa1df0f514b42528/pwk
|
|
4
|
+
"""
|
|
5
|
+
import io
|
|
6
|
+
import tokenize
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def translate_brace_python(
|
|
10
|
+
s: str,
|
|
11
|
+
*,
|
|
12
|
+
indent_width: int = 4,
|
|
13
|
+
) -> str:
|
|
14
|
+
lt = tokenize.tokenize(io.BytesIO(s.encode('utf-8')).readline)
|
|
15
|
+
|
|
16
|
+
ret = io.StringIO()
|
|
17
|
+
|
|
18
|
+
indent = 0
|
|
19
|
+
open_braces = 0
|
|
20
|
+
|
|
21
|
+
newline = False
|
|
22
|
+
indent_up = False
|
|
23
|
+
indent_down = False
|
|
24
|
+
skip = False
|
|
25
|
+
|
|
26
|
+
while True:
|
|
27
|
+
try:
|
|
28
|
+
t = next(lt)
|
|
29
|
+
|
|
30
|
+
if t.type == tokenize.ENCODING:
|
|
31
|
+
last_t = t
|
|
32
|
+
continue
|
|
33
|
+
|
|
34
|
+
if t.type == tokenize.OP and t.string == ';':
|
|
35
|
+
newline = True
|
|
36
|
+
|
|
37
|
+
elif t.type == tokenize.OP and t.string == ':':
|
|
38
|
+
if open_braces == 0:
|
|
39
|
+
newline = True
|
|
40
|
+
indent_up = True
|
|
41
|
+
|
|
42
|
+
elif t.type == tokenize.OP and t.string == '{':
|
|
43
|
+
if last_t.type == tokenize.OP and last_t.string == ':': # noqa
|
|
44
|
+
skip = True
|
|
45
|
+
else:
|
|
46
|
+
open_braces += 1
|
|
47
|
+
|
|
48
|
+
elif t.type == tokenize.OP and t.string == '}':
|
|
49
|
+
if open_braces > 0:
|
|
50
|
+
open_braces -= 1
|
|
51
|
+
elif open_braces == 0:
|
|
52
|
+
if indent > 0:
|
|
53
|
+
newline = True
|
|
54
|
+
indent_down = True
|
|
55
|
+
skip = True
|
|
56
|
+
else:
|
|
57
|
+
raise Exception('Too many closing braces')
|
|
58
|
+
|
|
59
|
+
if indent_up:
|
|
60
|
+
indent += indent_width
|
|
61
|
+
elif indent_down:
|
|
62
|
+
indent -= indent_width
|
|
63
|
+
|
|
64
|
+
if newline and indent_up:
|
|
65
|
+
ret.write(':\n' + ' ' * indent)
|
|
66
|
+
elif newline:
|
|
67
|
+
ret.write('\n' + ' ' * indent)
|
|
68
|
+
elif not skip:
|
|
69
|
+
ret.write(t.string)
|
|
70
|
+
ret.write(' ')
|
|
71
|
+
|
|
72
|
+
newline = False
|
|
73
|
+
indent_up = False
|
|
74
|
+
indent_down = False
|
|
75
|
+
skip = False
|
|
76
|
+
last_t = t
|
|
77
|
+
|
|
78
|
+
except StopIteration:
|
|
79
|
+
break
|
|
80
|
+
except tokenize.TokenError:
|
|
81
|
+
continue
|
|
82
|
+
|
|
83
|
+
ret.write('\n')
|
|
84
|
+
return ret.getvalue()
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def _main(argv=None) -> None:
|
|
88
|
+
import argparse
|
|
89
|
+
|
|
90
|
+
parser = argparse.ArgumentParser()
|
|
91
|
+
parser.add_argument('-x', '--exec', action='store_true')
|
|
92
|
+
parser.add_argument('cmd')
|
|
93
|
+
|
|
94
|
+
args = parser.parse_args(argv)
|
|
95
|
+
|
|
96
|
+
src = translate_brace_python(args.cmd)
|
|
97
|
+
|
|
98
|
+
if args.exec:
|
|
99
|
+
exec(src)
|
|
100
|
+
else:
|
|
101
|
+
print(src)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
if __name__ == '__main__':
|
|
105
|
+
_main()
|
|
@@ -1669,8 +1669,10 @@ class Pyenv:
|
|
|
1669
1669
|
return os.path.join(check_not_none(self.root()), 'bin', 'pyenv')
|
|
1670
1670
|
|
|
1671
1671
|
def version_exes(self) -> ta.List[ta.Tuple[str, str]]:
|
|
1672
|
+
if (root := self.root()) is None:
|
|
1673
|
+
return []
|
|
1672
1674
|
ret = []
|
|
1673
|
-
vp = os.path.join(
|
|
1675
|
+
vp = os.path.join(root, 'versions')
|
|
1674
1676
|
for dn in os.listdir(vp):
|
|
1675
1677
|
ep = os.path.join(vp, dn, 'bin', 'python')
|
|
1676
1678
|
if not os.path.isfile(ep):
|
|
@@ -1679,6 +1681,8 @@ class Pyenv:
|
|
|
1679
1681
|
return ret
|
|
1680
1682
|
|
|
1681
1683
|
def installable_versions(self) -> ta.List[str]:
|
|
1684
|
+
if self.root() is None:
|
|
1685
|
+
return []
|
|
1682
1686
|
ret = []
|
|
1683
1687
|
s = subprocess_check_output_str(self.exe(), 'install', '--list')
|
|
1684
1688
|
for l in s.splitlines():
|
|
@@ -39,6 +39,7 @@ import inspect
|
|
|
39
39
|
import itertools
|
|
40
40
|
import json
|
|
41
41
|
import logging
|
|
42
|
+
import multiprocessing as mp
|
|
42
43
|
import os
|
|
43
44
|
import os.path
|
|
44
45
|
import re
|
|
@@ -3225,8 +3226,10 @@ class Pyenv:
|
|
|
3225
3226
|
return os.path.join(check_not_none(self.root()), 'bin', 'pyenv')
|
|
3226
3227
|
|
|
3227
3228
|
def version_exes(self) -> ta.List[ta.Tuple[str, str]]:
|
|
3229
|
+
if (root := self.root()) is None:
|
|
3230
|
+
return []
|
|
3228
3231
|
ret = []
|
|
3229
|
-
vp = os.path.join(
|
|
3232
|
+
vp = os.path.join(root, 'versions')
|
|
3230
3233
|
for dn in os.listdir(vp):
|
|
3231
3234
|
ep = os.path.join(vp, dn, 'bin', 'python')
|
|
3232
3235
|
if not os.path.isfile(ep):
|
|
@@ -3235,6 +3238,8 @@ class Pyenv:
|
|
|
3235
3238
|
return ret
|
|
3236
3239
|
|
|
3237
3240
|
def installable_versions(self) -> ta.List[str]:
|
|
3241
|
+
if self.root() is None:
|
|
3242
|
+
return []
|
|
3238
3243
|
ret = []
|
|
3239
3244
|
s = subprocess_check_output_str(self.exe(), 'install', '--list')
|
|
3240
3245
|
for l in s.splitlines():
|
|
@@ -3895,13 +3900,12 @@ def _venv_cmd(args) -> None:
|
|
|
3895
3900
|
)
|
|
3896
3901
|
return
|
|
3897
3902
|
|
|
3898
|
-
venv.create()
|
|
3899
|
-
|
|
3900
3903
|
cmd = args.cmd
|
|
3901
3904
|
if not cmd:
|
|
3902
|
-
|
|
3905
|
+
venv.create()
|
|
3903
3906
|
|
|
3904
3907
|
elif cmd == 'python':
|
|
3908
|
+
venv.create()
|
|
3905
3909
|
os.execl(
|
|
3906
3910
|
(exe := venv.exe()),
|
|
3907
3911
|
exe,
|
|
@@ -3909,10 +3913,12 @@ def _venv_cmd(args) -> None:
|
|
|
3909
3913
|
)
|
|
3910
3914
|
|
|
3911
3915
|
elif cmd == 'exe':
|
|
3916
|
+
venv.create()
|
|
3912
3917
|
check_not(args.args)
|
|
3913
3918
|
print(venv.exe())
|
|
3914
3919
|
|
|
3915
3920
|
elif cmd == 'run':
|
|
3921
|
+
venv.create()
|
|
3916
3922
|
sh = check_not_none(shutil.which('bash'))
|
|
3917
3923
|
script = ' '.join(args.args)
|
|
3918
3924
|
if not script:
|
|
@@ -3929,6 +3935,7 @@ def _venv_cmd(args) -> None:
|
|
|
3929
3935
|
print('\n'.join(venv.srcs()))
|
|
3930
3936
|
|
|
3931
3937
|
elif cmd == 'test':
|
|
3938
|
+
venv.create()
|
|
3932
3939
|
subprocess_check_call(venv.exe(), '-m', 'pytest', *(args.args or []), *venv.srcs())
|
|
3933
3940
|
|
|
3934
3941
|
else:
|
|
@@ -3954,11 +3961,10 @@ def _pkg_cmd(args) -> None:
|
|
|
3954
3961
|
build_output_dir = 'dist'
|
|
3955
3962
|
run_build = bool(args.build)
|
|
3956
3963
|
|
|
3957
|
-
num_threads = 8
|
|
3958
|
-
|
|
3959
3964
|
if run_build:
|
|
3960
3965
|
os.makedirs(build_output_dir, exist_ok=True)
|
|
3961
3966
|
|
|
3967
|
+
num_threads = max(mp.cpu_count() // 2, 1)
|
|
3962
3968
|
with cf.ThreadPoolExecutor(num_threads) as ex:
|
|
3963
3969
|
futs = [
|
|
3964
3970
|
ex.submit(functools.partial(
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import subprocess
|
|
2
|
+
|
|
3
|
+
from omlish import argparse as ap
|
|
4
|
+
from omlish import logs
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Cli(ap.Cli):
|
|
8
|
+
@ap.command()
|
|
9
|
+
def blob_sizes(self) -> None:
|
|
10
|
+
# https://stackoverflow.com/a/42544963
|
|
11
|
+
subprocess.check_call( # noqa
|
|
12
|
+
"git rev-list --objects --all | "
|
|
13
|
+
"git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | "
|
|
14
|
+
"sed -n 's/^blob //p' | "
|
|
15
|
+
"sort --numeric-sort --key=2",
|
|
16
|
+
shell=True,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
if __name__ == '__main__':
|
|
21
|
+
logs.configure_standard_logging('INFO')
|
|
22
|
+
Cli()()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: omdev
|
|
3
|
-
Version: 0.0.0.
|
|
3
|
+
Version: 0.0.0.dev11
|
|
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.dev11
|
|
16
16
|
Provides-Extra: all
|
|
17
17
|
Requires-Dist: pycparser>=2.22; extra == "all"
|
|
18
18
|
Requires-Dist: cffi>=1.17; extra == "all"
|
|
@@ -54,6 +54,7 @@ omdev/pyproject/configs.py
|
|
|
54
54
|
omdev/pyproject/ext.py
|
|
55
55
|
omdev/pyproject/pkg.py
|
|
56
56
|
omdev/scripts/__init__.py
|
|
57
|
+
omdev/scripts/bracepy.py
|
|
57
58
|
omdev/scripts/execrss.py
|
|
58
59
|
omdev/scripts/findimports.py
|
|
59
60
|
omdev/scripts/findmagic.py
|
|
@@ -65,6 +66,7 @@ omdev/toml/parser.py
|
|
|
65
66
|
omdev/toml/writer.py
|
|
66
67
|
omdev/tools/__init__.py
|
|
67
68
|
omdev/tools/dockertools.py
|
|
69
|
+
omdev/tools/gittools.py
|
|
68
70
|
omdev/tools/sqlrepl.py
|
|
69
71
|
omdev/versioning/__init__.py
|
|
70
72
|
omdev/versioning/specifiers.py
|
|
@@ -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.dev11'
|
|
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.dev11',
|
|
26
26
|
]
|
|
27
27
|
|
|
28
28
|
[project.optional-dependencies]
|
omdev-0.0.0.dev10/README.rst
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
*omlish*
|
|
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
|