omdev 0.0.0.dev26__py3-none-any.whl → 0.0.0.dev28__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/cache/__init__.py +0 -0
- omdev/cache/comp/__init__.py +0 -0
- omdev/cache/comp/cache.py +137 -0
- omdev/cache/comp/contexts.py +136 -0
- omdev/cache/comp/fns.py +115 -0
- omdev/cache/comp/resolvers.py +23 -0
- omdev/cache/comp/types.py +92 -0
- omdev/{datacache → cache/data}/__init__.py +1 -1
- omdev/cache/data/actions.py +42 -0
- omdev/{datacache → cache/data}/cache.py +23 -9
- omdev/cache/data/consts.py +1 -0
- omdev/cache/data/defaults.py +18 -0
- omdev/{datacache → cache/data}/manifests.py +5 -5
- omdev/{datacache → cache/data}/specs.py +3 -3
- omdev/git.py +41 -3
- omdev/manifests.py +2 -2
- omdev/pyproject/pkg.py +76 -4
- omdev/revisions.py +3 -26
- omdev/scripts/interp.py +6 -0
- omdev/scripts/pyproject.py +182 -29
- {omdev-0.0.0.dev26.dist-info → omdev-0.0.0.dev28.dist-info}/METADATA +2 -2
- {omdev-0.0.0.dev26.dist-info → omdev-0.0.0.dev28.dist-info}/RECORD +26 -18
- omdev/datacache/consts.py +0 -1
- omdev/datacache/default.py +0 -51
- /omdev/{_manifests.json → .manifests.json} +0 -0
- {omdev-0.0.0.dev26.dist-info → omdev-0.0.0.dev28.dist-info}/LICENSE +0 -0
- {omdev-0.0.0.dev26.dist-info → omdev-0.0.0.dev28.dist-info}/WHEEL +0 -0
- {omdev-0.0.0.dev26.dist-info → omdev-0.0.0.dev28.dist-info}/top_level.txt +0 -0
omdev/git.py
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
# ruff: noqa: UP007
|
|
2
|
+
# @omlish-lite
|
|
1
3
|
import os.path
|
|
2
4
|
import subprocess
|
|
3
5
|
import typing as ta
|
|
4
6
|
|
|
5
7
|
|
|
6
|
-
def
|
|
8
|
+
def git_clone_subtree(
|
|
7
9
|
*,
|
|
8
10
|
base_dir: str,
|
|
9
11
|
repo_url: str,
|
|
10
12
|
repo_dir: str,
|
|
11
|
-
branch: str
|
|
12
|
-
rev: str
|
|
13
|
+
branch: ta.Optional[str] = None,
|
|
14
|
+
rev: ta.Optional[str] = None,
|
|
13
15
|
repo_subtrees: ta.Sequence[str],
|
|
14
16
|
) -> None:
|
|
15
17
|
if not bool(branch) ^ bool(rev):
|
|
@@ -60,3 +62,39 @@ def clone_subtree(
|
|
|
60
62
|
],
|
|
61
63
|
cwd=rd,
|
|
62
64
|
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def get_git_revision(
|
|
68
|
+
*,
|
|
69
|
+
cwd: ta.Optional[str] = None,
|
|
70
|
+
) -> ta.Optional[str]:
|
|
71
|
+
subprocess.check_output(['git', '--version'])
|
|
72
|
+
|
|
73
|
+
if cwd is None:
|
|
74
|
+
cwd = os.getcwd()
|
|
75
|
+
|
|
76
|
+
if subprocess.run([ # noqa
|
|
77
|
+
'git',
|
|
78
|
+
'rev-parse',
|
|
79
|
+
'--is-inside-work-tree',
|
|
80
|
+
], stderr=subprocess.PIPE).returncode:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
has_untracked = bool(subprocess.check_output([
|
|
84
|
+
'git',
|
|
85
|
+
'ls-files',
|
|
86
|
+
'.',
|
|
87
|
+
'--exclude-standard',
|
|
88
|
+
'--others',
|
|
89
|
+
], cwd=cwd).decode().strip())
|
|
90
|
+
|
|
91
|
+
dirty_rev = subprocess.check_output([
|
|
92
|
+
'git',
|
|
93
|
+
'describe',
|
|
94
|
+
'--match=NeVeRmAtCh',
|
|
95
|
+
'--always',
|
|
96
|
+
'--abbrev=40',
|
|
97
|
+
'--dirty',
|
|
98
|
+
], cwd=cwd).decode().strip()
|
|
99
|
+
|
|
100
|
+
return dirty_rev + ('-untracked' if has_untracked else '')
|
omdev/manifests.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
!!! manifests! get-manifest,
|
|
2
|
+
!!! manifests! get-manifest, .manifest.json
|
|
3
3
|
- dumb dicts, root keys are 'types'
|
|
4
4
|
- get put in _manifest.py, root level dict or smth
|
|
5
5
|
- IMPORT files w comment
|
|
@@ -195,7 +195,7 @@ def build_package_manifests(
|
|
|
195
195
|
manifests.extend(build_module_manifests(os.path.relpath(file, base), base))
|
|
196
196
|
|
|
197
197
|
if write:
|
|
198
|
-
with open(os.path.join(pkg_dir, '
|
|
198
|
+
with open(os.path.join(pkg_dir, '.manifests.json'), 'w') as f:
|
|
199
199
|
f.write(json_dumps_pretty([dc.asdict(m) for m in manifests]))
|
|
200
200
|
f.write('\n')
|
|
201
201
|
|
omdev/pyproject/pkg.py
CHANGED
|
@@ -139,6 +139,35 @@ class BasePyprojectPackageGenerator(abc.ABC):
|
|
|
139
139
|
|
|
140
140
|
#
|
|
141
141
|
|
|
142
|
+
class _PkgData(ta.NamedTuple):
|
|
143
|
+
inc: ta.List[str]
|
|
144
|
+
exc: ta.List[str]
|
|
145
|
+
|
|
146
|
+
@cached_nullary
|
|
147
|
+
def _collect_pkg_data(self) -> _PkgData:
|
|
148
|
+
inc: ta.List[str] = []
|
|
149
|
+
exc: ta.List[str] = []
|
|
150
|
+
|
|
151
|
+
for p, ds, fs in os.walk(self._dir_name): # noqa
|
|
152
|
+
for f in fs:
|
|
153
|
+
if f != '.pkgdata':
|
|
154
|
+
continue
|
|
155
|
+
rp = os.path.relpath(p, self._dir_name)
|
|
156
|
+
log.info('Found pkgdata %s for pkg %s', rp, self._dir_name)
|
|
157
|
+
with open(os.path.join(p, f)) as fo:
|
|
158
|
+
src = fo.read()
|
|
159
|
+
for l in src.splitlines():
|
|
160
|
+
if not (l := l.strip()):
|
|
161
|
+
continue
|
|
162
|
+
if l.startswith('!'):
|
|
163
|
+
exc.append(os.path.join(rp, l[1:]))
|
|
164
|
+
else:
|
|
165
|
+
inc.append(os.path.join(rp, l))
|
|
166
|
+
|
|
167
|
+
return self._PkgData(inc, exc)
|
|
168
|
+
|
|
169
|
+
#
|
|
170
|
+
|
|
142
171
|
@abc.abstractmethod
|
|
143
172
|
def _write_file_contents(self) -> None:
|
|
144
173
|
raise NotImplementedError
|
|
@@ -268,13 +297,56 @@ class PyprojectPackageGenerator(BasePyprojectPackageGenerator):
|
|
|
268
297
|
|
|
269
298
|
#
|
|
270
299
|
|
|
271
|
-
st = specs.setuptools
|
|
300
|
+
st = dict(specs.setuptools)
|
|
272
301
|
pyp_dct['tool.setuptools'] = st
|
|
273
302
|
|
|
274
303
|
st.pop('cexts', None)
|
|
275
304
|
|
|
276
|
-
|
|
277
|
-
|
|
305
|
+
#
|
|
306
|
+
|
|
307
|
+
# TODO: default
|
|
308
|
+
# find_packages = {
|
|
309
|
+
# 'include': [Project.name, f'{Project.name}.*'],
|
|
310
|
+
# 'exclude': [*SetuptoolsBase.find_packages['exclude']],
|
|
311
|
+
# }
|
|
312
|
+
|
|
313
|
+
fp = dict(st.pop('find_packages', {}))
|
|
314
|
+
|
|
315
|
+
pyp_dct['tool.setuptools.packages.find'] = fp
|
|
316
|
+
|
|
317
|
+
#
|
|
318
|
+
|
|
319
|
+
# TODO: default
|
|
320
|
+
# package_data = {
|
|
321
|
+
# '*': [
|
|
322
|
+
# '*.c',
|
|
323
|
+
# '*.cc',
|
|
324
|
+
# '*.h',
|
|
325
|
+
# '.manifests.json',
|
|
326
|
+
# 'LICENSE',
|
|
327
|
+
# ],
|
|
328
|
+
# }
|
|
329
|
+
|
|
330
|
+
pd = dict(st.pop('package_data', {}))
|
|
331
|
+
epd = dict(st.pop('exclude_package_data', {}))
|
|
332
|
+
|
|
333
|
+
cpd = self._collect_pkg_data()
|
|
334
|
+
if cpd.inc:
|
|
335
|
+
pd['*'] = [*pd.get('*', []), *sorted(set(cpd.inc))]
|
|
336
|
+
if cpd.exc:
|
|
337
|
+
epd['*'] = [*epd.get('*', []), *sorted(set(cpd.exc))]
|
|
338
|
+
|
|
339
|
+
if pd:
|
|
340
|
+
pyp_dct['tool.setuptools.package-data'] = pd
|
|
341
|
+
if epd:
|
|
342
|
+
pyp_dct['tool.setuptools.exclude-package-data'] = epd
|
|
343
|
+
|
|
344
|
+
#
|
|
345
|
+
|
|
346
|
+
# TODO: default
|
|
347
|
+
# manifest_in = [
|
|
348
|
+
# 'global-exclude **/conftest.py',
|
|
349
|
+
# ]
|
|
278
350
|
|
|
279
351
|
mani_in = st.pop('manifest_in', None)
|
|
280
352
|
|
|
@@ -354,7 +426,7 @@ class _PyprojectCextPackageGenerator(BasePyprojectPackageGenerator):
|
|
|
354
426
|
|
|
355
427
|
#
|
|
356
428
|
|
|
357
|
-
st = specs.setuptools
|
|
429
|
+
st = dict(specs.setuptools)
|
|
358
430
|
pyp_dct['tool.setuptools'] = st
|
|
359
431
|
|
|
360
432
|
for k in [
|
omdev/revisions.py
CHANGED
|
@@ -9,45 +9,22 @@ TODO:
|
|
|
9
9
|
import argparse
|
|
10
10
|
import io
|
|
11
11
|
import os.path
|
|
12
|
-
import subprocess
|
|
13
12
|
import tarfile
|
|
14
13
|
import typing as ta
|
|
15
14
|
import zipfile
|
|
16
15
|
|
|
17
16
|
from omlish.lite.cached import cached_nullary
|
|
17
|
+
from omlish.lite.check import check_non_empty_str
|
|
18
18
|
from omlish.lite.logs import configure_standard_logging
|
|
19
19
|
from omlish.lite.logs import log
|
|
20
20
|
|
|
21
|
+
from .git import get_git_revision
|
|
21
22
|
from .wheelfile import WheelFile
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
##
|
|
25
26
|
|
|
26
27
|
|
|
27
|
-
def get_git_revision() -> str:
|
|
28
|
-
has_untracked = bool(subprocess.check_output([
|
|
29
|
-
'git',
|
|
30
|
-
'ls-files',
|
|
31
|
-
'.',
|
|
32
|
-
'--exclude-standard',
|
|
33
|
-
'--others',
|
|
34
|
-
]).decode().strip())
|
|
35
|
-
|
|
36
|
-
dirty_rev = subprocess.check_output([
|
|
37
|
-
'git',
|
|
38
|
-
'describe',
|
|
39
|
-
'--match=NeVeRmAtCh',
|
|
40
|
-
'--always',
|
|
41
|
-
'--abbrev=40',
|
|
42
|
-
'--dirty',
|
|
43
|
-
]).decode().strip()
|
|
44
|
-
|
|
45
|
-
return dirty_rev + ('-untracked' if has_untracked else '')
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
##
|
|
49
|
-
|
|
50
|
-
|
|
51
28
|
class GitRevisionAdder:
|
|
52
29
|
def __init__(
|
|
53
30
|
self,
|
|
@@ -62,7 +39,7 @@ class GitRevisionAdder:
|
|
|
62
39
|
def revision(self) -> str:
|
|
63
40
|
if self._given_revision is not None:
|
|
64
41
|
return self._given_revision
|
|
65
|
-
return get_git_revision()
|
|
42
|
+
return check_non_empty_str(get_git_revision())
|
|
66
43
|
|
|
67
44
|
REVISION_ATTR = '__revision__'
|
|
68
45
|
|
omdev/scripts/interp.py
CHANGED
|
@@ -515,6 +515,12 @@ def check_not(v: ta.Any) -> None:
|
|
|
515
515
|
return v
|
|
516
516
|
|
|
517
517
|
|
|
518
|
+
def check_non_empty_str(v: ta.Optional[str]) -> str:
|
|
519
|
+
if not v:
|
|
520
|
+
raise ValueError
|
|
521
|
+
return v
|
|
522
|
+
|
|
523
|
+
|
|
518
524
|
########################################
|
|
519
525
|
# ../../../omlish/lite/json.py
|
|
520
526
|
|
omdev/scripts/pyproject.py
CHANGED
|
@@ -170,6 +170,105 @@ def find_magic(
|
|
|
170
170
|
yield out
|
|
171
171
|
|
|
172
172
|
|
|
173
|
+
########################################
|
|
174
|
+
# ../../git.py
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def git_clone_subtree(
|
|
178
|
+
*,
|
|
179
|
+
base_dir: str,
|
|
180
|
+
repo_url: str,
|
|
181
|
+
repo_dir: str,
|
|
182
|
+
branch: ta.Optional[str] = None,
|
|
183
|
+
rev: ta.Optional[str] = None,
|
|
184
|
+
repo_subtrees: ta.Sequence[str],
|
|
185
|
+
) -> None:
|
|
186
|
+
if not bool(branch) ^ bool(rev):
|
|
187
|
+
raise ValueError('must set branch or rev')
|
|
188
|
+
|
|
189
|
+
if isinstance(repo_subtrees, str):
|
|
190
|
+
raise TypeError(repo_subtrees)
|
|
191
|
+
|
|
192
|
+
git_opts = [
|
|
193
|
+
'-c', 'advice.detachedHead=false',
|
|
194
|
+
]
|
|
195
|
+
|
|
196
|
+
subprocess.check_call(
|
|
197
|
+
[
|
|
198
|
+
'git',
|
|
199
|
+
*git_opts,
|
|
200
|
+
'clone',
|
|
201
|
+
'-n',
|
|
202
|
+
'--depth=1',
|
|
203
|
+
'--filter=tree:0',
|
|
204
|
+
*(['-b', branch] if branch else []),
|
|
205
|
+
'--single-branch',
|
|
206
|
+
repo_url,
|
|
207
|
+
repo_dir,
|
|
208
|
+
],
|
|
209
|
+
cwd=base_dir,
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
rd = os.path.join(base_dir, repo_dir)
|
|
213
|
+
subprocess.check_call(
|
|
214
|
+
[
|
|
215
|
+
'git',
|
|
216
|
+
*git_opts,
|
|
217
|
+
'sparse-checkout',
|
|
218
|
+
'set',
|
|
219
|
+
'--no-cone',
|
|
220
|
+
*repo_subtrees,
|
|
221
|
+
],
|
|
222
|
+
cwd=rd,
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
subprocess.check_call(
|
|
226
|
+
[
|
|
227
|
+
'git',
|
|
228
|
+
*git_opts,
|
|
229
|
+
'checkout',
|
|
230
|
+
*([rev] if rev else []),
|
|
231
|
+
],
|
|
232
|
+
cwd=rd,
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
def get_git_revision(
|
|
237
|
+
*,
|
|
238
|
+
cwd: ta.Optional[str] = None,
|
|
239
|
+
) -> ta.Optional[str]:
|
|
240
|
+
subprocess.check_output(['git', '--version'])
|
|
241
|
+
|
|
242
|
+
if cwd is None:
|
|
243
|
+
cwd = os.getcwd()
|
|
244
|
+
|
|
245
|
+
if subprocess.run([ # noqa
|
|
246
|
+
'git',
|
|
247
|
+
'rev-parse',
|
|
248
|
+
'--is-inside-work-tree',
|
|
249
|
+
], stderr=subprocess.PIPE).returncode:
|
|
250
|
+
return None
|
|
251
|
+
|
|
252
|
+
has_untracked = bool(subprocess.check_output([
|
|
253
|
+
'git',
|
|
254
|
+
'ls-files',
|
|
255
|
+
'.',
|
|
256
|
+
'--exclude-standard',
|
|
257
|
+
'--others',
|
|
258
|
+
], cwd=cwd).decode().strip())
|
|
259
|
+
|
|
260
|
+
dirty_rev = subprocess.check_output([
|
|
261
|
+
'git',
|
|
262
|
+
'describe',
|
|
263
|
+
'--match=NeVeRmAtCh',
|
|
264
|
+
'--always',
|
|
265
|
+
'--abbrev=40',
|
|
266
|
+
'--dirty',
|
|
267
|
+
], cwd=cwd).decode().strip()
|
|
268
|
+
|
|
269
|
+
return dirty_rev + ('-untracked' if has_untracked else '')
|
|
270
|
+
|
|
271
|
+
|
|
173
272
|
########################################
|
|
174
273
|
# ../../toml/parser.py
|
|
175
274
|
# SPDX-License-Identifier: MIT
|
|
@@ -1788,6 +1887,12 @@ def check_not(v: ta.Any) -> None:
|
|
|
1788
1887
|
return v
|
|
1789
1888
|
|
|
1790
1889
|
|
|
1890
|
+
def check_non_empty_str(v: ta.Optional[str]) -> str:
|
|
1891
|
+
if not v:
|
|
1892
|
+
raise ValueError
|
|
1893
|
+
return v
|
|
1894
|
+
|
|
1895
|
+
|
|
1791
1896
|
########################################
|
|
1792
1897
|
# ../../../omlish/lite/json.py
|
|
1793
1898
|
|
|
@@ -3268,30 +3373,6 @@ TODO:
|
|
|
3268
3373
|
##
|
|
3269
3374
|
|
|
3270
3375
|
|
|
3271
|
-
def get_git_revision() -> str:
|
|
3272
|
-
has_untracked = bool(subprocess.check_output([
|
|
3273
|
-
'git',
|
|
3274
|
-
'ls-files',
|
|
3275
|
-
'.',
|
|
3276
|
-
'--exclude-standard',
|
|
3277
|
-
'--others',
|
|
3278
|
-
]).decode().strip())
|
|
3279
|
-
|
|
3280
|
-
dirty_rev = subprocess.check_output([
|
|
3281
|
-
'git',
|
|
3282
|
-
'describe',
|
|
3283
|
-
'--match=NeVeRmAtCh',
|
|
3284
|
-
'--always',
|
|
3285
|
-
'--abbrev=40',
|
|
3286
|
-
'--dirty',
|
|
3287
|
-
]).decode().strip()
|
|
3288
|
-
|
|
3289
|
-
return dirty_rev + ('-untracked' if has_untracked else '')
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
##
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
3376
|
class GitRevisionAdder:
|
|
3296
3377
|
def __init__(
|
|
3297
3378
|
self,
|
|
@@ -3306,7 +3387,7 @@ class GitRevisionAdder:
|
|
|
3306
3387
|
def revision(self) -> str:
|
|
3307
3388
|
if self._given_revision is not None:
|
|
3308
3389
|
return self._given_revision
|
|
3309
|
-
return get_git_revision()
|
|
3390
|
+
return check_non_empty_str(get_git_revision())
|
|
3310
3391
|
|
|
3311
3392
|
REVISION_ATTR = '__revision__'
|
|
3312
3393
|
|
|
@@ -3726,6 +3807,35 @@ class BasePyprojectPackageGenerator(abc.ABC):
|
|
|
3726
3807
|
|
|
3727
3808
|
#
|
|
3728
3809
|
|
|
3810
|
+
class _PkgData(ta.NamedTuple):
|
|
3811
|
+
inc: ta.List[str]
|
|
3812
|
+
exc: ta.List[str]
|
|
3813
|
+
|
|
3814
|
+
@cached_nullary
|
|
3815
|
+
def _collect_pkg_data(self) -> _PkgData:
|
|
3816
|
+
inc: ta.List[str] = []
|
|
3817
|
+
exc: ta.List[str] = []
|
|
3818
|
+
|
|
3819
|
+
for p, ds, fs in os.walk(self._dir_name): # noqa
|
|
3820
|
+
for f in fs:
|
|
3821
|
+
if f != '.pkgdata':
|
|
3822
|
+
continue
|
|
3823
|
+
rp = os.path.relpath(p, self._dir_name)
|
|
3824
|
+
log.info('Found pkgdata %s for pkg %s', rp, self._dir_name)
|
|
3825
|
+
with open(os.path.join(p, f)) as fo:
|
|
3826
|
+
src = fo.read()
|
|
3827
|
+
for l in src.splitlines():
|
|
3828
|
+
if not (l := l.strip()):
|
|
3829
|
+
continue
|
|
3830
|
+
if l.startswith('!'):
|
|
3831
|
+
exc.append(os.path.join(rp, l[1:]))
|
|
3832
|
+
else:
|
|
3833
|
+
inc.append(os.path.join(rp, l))
|
|
3834
|
+
|
|
3835
|
+
return self._PkgData(inc, exc)
|
|
3836
|
+
|
|
3837
|
+
#
|
|
3838
|
+
|
|
3729
3839
|
@abc.abstractmethod
|
|
3730
3840
|
def _write_file_contents(self) -> None:
|
|
3731
3841
|
raise NotImplementedError
|
|
@@ -3855,13 +3965,56 @@ class PyprojectPackageGenerator(BasePyprojectPackageGenerator):
|
|
|
3855
3965
|
|
|
3856
3966
|
#
|
|
3857
3967
|
|
|
3858
|
-
st = specs.setuptools
|
|
3968
|
+
st = dict(specs.setuptools)
|
|
3859
3969
|
pyp_dct['tool.setuptools'] = st
|
|
3860
3970
|
|
|
3861
3971
|
st.pop('cexts', None)
|
|
3862
3972
|
|
|
3863
|
-
|
|
3864
|
-
|
|
3973
|
+
#
|
|
3974
|
+
|
|
3975
|
+
# TODO: default
|
|
3976
|
+
# find_packages = {
|
|
3977
|
+
# 'include': [Project.name, f'{Project.name}.*'],
|
|
3978
|
+
# 'exclude': [*SetuptoolsBase.find_packages['exclude']],
|
|
3979
|
+
# }
|
|
3980
|
+
|
|
3981
|
+
fp = dict(st.pop('find_packages', {}))
|
|
3982
|
+
|
|
3983
|
+
pyp_dct['tool.setuptools.packages.find'] = fp
|
|
3984
|
+
|
|
3985
|
+
#
|
|
3986
|
+
|
|
3987
|
+
# TODO: default
|
|
3988
|
+
# package_data = {
|
|
3989
|
+
# '*': [
|
|
3990
|
+
# '*.c',
|
|
3991
|
+
# '*.cc',
|
|
3992
|
+
# '*.h',
|
|
3993
|
+
# '.manifests.json',
|
|
3994
|
+
# 'LICENSE',
|
|
3995
|
+
# ],
|
|
3996
|
+
# }
|
|
3997
|
+
|
|
3998
|
+
pd = dict(st.pop('package_data', {}))
|
|
3999
|
+
epd = dict(st.pop('exclude_package_data', {}))
|
|
4000
|
+
|
|
4001
|
+
cpd = self._collect_pkg_data()
|
|
4002
|
+
if cpd.inc:
|
|
4003
|
+
pd['*'] = [*pd.get('*', []), *sorted(set(cpd.inc))]
|
|
4004
|
+
if cpd.exc:
|
|
4005
|
+
epd['*'] = [*epd.get('*', []), *sorted(set(cpd.exc))]
|
|
4006
|
+
|
|
4007
|
+
if pd:
|
|
4008
|
+
pyp_dct['tool.setuptools.package-data'] = pd
|
|
4009
|
+
if epd:
|
|
4010
|
+
pyp_dct['tool.setuptools.exclude-package-data'] = epd
|
|
4011
|
+
|
|
4012
|
+
#
|
|
4013
|
+
|
|
4014
|
+
# TODO: default
|
|
4015
|
+
# manifest_in = [
|
|
4016
|
+
# 'global-exclude **/conftest.py',
|
|
4017
|
+
# ]
|
|
3865
4018
|
|
|
3866
4019
|
mani_in = st.pop('manifest_in', None)
|
|
3867
4020
|
|
|
@@ -3941,7 +4094,7 @@ class _PyprojectCextPackageGenerator(BasePyprojectPackageGenerator):
|
|
|
3941
4094
|
|
|
3942
4095
|
#
|
|
3943
4096
|
|
|
3944
|
-
st = specs.setuptools
|
|
4097
|
+
st = dict(specs.setuptools)
|
|
3945
4098
|
pyp_dct['tool.setuptools'] = st
|
|
3946
4099
|
|
|
3947
4100
|
for k in [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: omdev
|
|
3
|
-
Version: 0.0.0.
|
|
3
|
+
Version: 0.0.0.dev28
|
|
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.dev28
|
|
16
16
|
Provides-Extra: all
|
|
17
17
|
Requires-Dist: pycparser ~=2.22 ; extra == 'all'
|
|
18
18
|
Requires-Dist: cffi ~=1.17 ; extra == 'all'
|
|
@@ -1,19 +1,33 @@
|
|
|
1
|
+
omdev/.manifests.json,sha256=N1F-Xz3GaBn2H1p7uKzhkhKCQV8QVR0t76XD6wmFtXA,3
|
|
1
2
|
omdev/__about__.py,sha256=788lo_UuOSYF74y1RBiNlWkDdPnRFcmBAV5qYkaFJzE,868
|
|
2
3
|
omdev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
omdev/_manifests.json,sha256=N1F-Xz3GaBn2H1p7uKzhkhKCQV8QVR0t76XD6wmFtXA,3
|
|
4
4
|
omdev/bracepy.py,sha256=HwBK5XmlOsF_juTel25fRLJK9vHSJCWXuCc-OZlevRQ,2619
|
|
5
5
|
omdev/classdot.py,sha256=urN5Pzd2ooAwnfkH0z-muQxdO90IMo-sX2WB-A37lVU,1533
|
|
6
6
|
omdev/cmake.py,sha256=Diy2ry65806dQP125DAstD3w46z_wszMH7PwC2-6iik,4578
|
|
7
7
|
omdev/findimports.py,sha256=P8v4I1tm6g-PEWJiNwAKxErvWwL-Nop83vAuwq1kR5A,2246
|
|
8
8
|
omdev/findmagic.py,sha256=DhBYHHP_dzwM5pIh21xnQPnkZ2YmAXCjithsr7X0ScU,2357
|
|
9
|
-
omdev/git.py,sha256=
|
|
10
|
-
omdev/manifests.py,sha256=
|
|
11
|
-
omdev/revisions.py,sha256=
|
|
9
|
+
omdev/git.py,sha256=OzP4xHVboaa7GhS-mg4F3lYWf3HLa5aMm6V6PtIw_3U,2137
|
|
10
|
+
omdev/manifests.py,sha256=8Wf_pOn9cUaeb6thFqanpuhbqfvrDs5kH-H1BBOb4n4,6622
|
|
11
|
+
omdev/revisions.py,sha256=U657hf4zeEN32y3g4CzqCAodx_HlfkHj2cIIKALNFDo,5009
|
|
12
12
|
omdev/tokens.py,sha256=GusxQ1Cd_eiScuR8XTTtc9QFhOgYviYGBZmFnn3Hj7s,756
|
|
13
13
|
omdev/wheelfile.py,sha256=yfupGcGkbFlmzGzKU64k_vmOKpaKnUlDWxeGn2KdekU,10005
|
|
14
14
|
omdev/amalg/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
omdev/amalg/__main__.py,sha256=OE1udULO1g4McUbeg1CoHbSm4hbQ2kcE3ffEGxlnPh4,69
|
|
16
16
|
omdev/amalg/amalg.py,sha256=g7wwcPE2G9qmzh8M9eZAscOYWKo3ldI8bNxEXFnmzLE,14064
|
|
17
|
+
omdev/cache/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
+
omdev/cache/comp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
|
+
omdev/cache/comp/cache.py,sha256=0VDub_za4GlR5gIynqK4CnhhZFs-cdtlf_lwMhgtFa4,3387
|
|
20
|
+
omdev/cache/comp/contexts.py,sha256=LHCzt9x3s35Xc1jW5U7GWkhi-z-Z0_KA47IcfqgmNvU,3085
|
|
21
|
+
omdev/cache/comp/fns.py,sha256=72yQ1e7NH8GxZ-ppcik1JLMEJGzrBvHgI5PSp4HcXVM,2943
|
|
22
|
+
omdev/cache/comp/resolvers.py,sha256=Do7_PKy-09hyptgKel1vKQnHcpc3wjCP-1St3unTspc,614
|
|
23
|
+
omdev/cache/comp/types.py,sha256=vFrcB8WftWDHQnrHG0lRXMBStWCm2M_Q4Xft-Rz7xnc,1907
|
|
24
|
+
omdev/cache/data/__init__.py,sha256=Jn_QRQn8L3-L0P-w9s5sBBku2tnFTOS3oc_U2PF8SSk,298
|
|
25
|
+
omdev/cache/data/actions.py,sha256=OrCjo0INKeG8iEvXnQ9LI8PD8WF4d1vxrBwQzuA2ASw,829
|
|
26
|
+
omdev/cache/data/cache.py,sha256=HfxoXRmzVeqMDUKyqY3PSJShuqtcYjkuA14T2kz3uzE,4772
|
|
27
|
+
omdev/cache/data/consts.py,sha256=d6W_aeMqgah6PmPYi9RA8Be54oQ4BcNCy8kDQ7FlB_Q,26
|
|
28
|
+
omdev/cache/data/defaults.py,sha256=eRwkBRVaPSgYsfejgo-3SJGx2vyX_H4azhJ_un6-f74,289
|
|
29
|
+
omdev/cache/data/manifests.py,sha256=6SqUiAlzkuDwIApEjzh5P6VimRVGk3iMwXjEPH2zvrc,1006
|
|
30
|
+
omdev/cache/data/specs.py,sha256=ggvbp4nSEnXJImt_stVh4OsOYNzPIVGXAWplr17yEyg,2290
|
|
17
31
|
omdev/cexts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
32
|
omdev/cexts/_boilerplate.cc,sha256=aOWF_5C2pqnIrkT1ykEaL7N2pIpamW6pdXriRbd3lvs,1725
|
|
19
33
|
omdev/cexts/build.py,sha256=F3z1-CjDlEM-Gzi5IunKUBO52qdH_pMsFylobTdGJnI,2654
|
|
@@ -37,12 +51,6 @@ omdev/cexts/_distutils/compilers/__init__.py,sha256=amL_zrFlba0lHIvpqDne9uhqhLem
|
|
|
37
51
|
omdev/cexts/_distutils/compilers/ccompiler.py,sha256=cTs88qrvj0hBVXHfemSDE_du_nEA4_qo3Qst5TpQkVI,43606
|
|
38
52
|
omdev/cexts/_distutils/compilers/options.py,sha256=H7r5IcLvga5Fs3jjXWIT-6ap3JBduXRKgtpDmSGCZxs,3818
|
|
39
53
|
omdev/cexts/_distutils/compilers/unixccompiler.py,sha256=o1h8QuyupLntv4F21_XjzAZmCiwwxJuTmOirvBSL-Qw,15419
|
|
40
|
-
omdev/datacache/__init__.py,sha256=OUHQqJgp8q1xnQYJfV21EcXDzjn1k69QCFoT9KThl9s,297
|
|
41
|
-
omdev/datacache/cache.py,sha256=EBugj3D5pDV4YkDHhE0ZJ54S7eug2kgv2yiQZcfvNT0,4238
|
|
42
|
-
omdev/datacache/consts.py,sha256=hv1M8MOHgivZuFLUm6UVHQWcv7Daksr3mED6EyyoiEg,20
|
|
43
|
-
omdev/datacache/default.py,sha256=93gc6cFb3Av5HNE-RKmkCrcXRtxX02p1RlNzFqraKtI,1157
|
|
44
|
-
omdev/datacache/manifests.py,sha256=mGW7g9h8KMDO8ihvdGKrqe8XyFW9Cv9VM6etXZlZQ-4,975
|
|
45
|
-
omdev/datacache/specs.py,sha256=4wRFwgtHxjNOIPKZduv9xMcCtizawxr53CsSQt7r__s,2256
|
|
46
54
|
omdev/interp/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
|
|
47
55
|
omdev/interp/__main__.py,sha256=gFhR9DikwDZk0LqgdR3qq_aXQHThUOPllDmHDOfnFAU,67
|
|
48
56
|
omdev/interp/cli.py,sha256=8T3qLXTC2mni5FXDHkHN3mZG9_BnjkDMXYy6EYbAYR8,1679
|
|
@@ -63,13 +71,13 @@ omdev/pyproject/__main__.py,sha256=gFhR9DikwDZk0LqgdR3qq_aXQHThUOPllDmHDOfnFAU,6
|
|
|
63
71
|
omdev/pyproject/cexts.py,sha256=x13piOOnNrYbA17qZLDVuR0p1sqhgEwpk4FtImX-klM,4281
|
|
64
72
|
omdev/pyproject/cli.py,sha256=qBVsQDcNSCC3i78X9jFlPZ3ahDSY-0OD0UN1mbqLgYE,10649
|
|
65
73
|
omdev/pyproject/configs.py,sha256=K9H5cGwVLgHi8wKwtYvlXHZ9ThtmnI4jo8JAb-t1-70,2859
|
|
66
|
-
omdev/pyproject/pkg.py,sha256=
|
|
74
|
+
omdev/pyproject/pkg.py,sha256=GlZvDcLbo7HmiV2SgQnJdgAswr9IoJpy5gOeTRXG2RM,12576
|
|
67
75
|
omdev/pyproject/reqs.py,sha256=coq21cdWQIPs06-iuRnwc6F2Sf-IxpqoT6DEMhol2kA,2298
|
|
68
76
|
omdev/scripts/__init__.py,sha256=MKCvUAEQwsIvwLixwtPlpBqmkMXLCnjjXyAXvVpDwVk,91
|
|
69
77
|
omdev/scripts/bumpversion.py,sha256=Kn7fo73Hs8uJh3Hi3EIyLOlzLPWAC6dwuD_lZ3cIzuY,1064
|
|
70
78
|
omdev/scripts/execrss.py,sha256=HzDNmwXOO8fMwIRXw9q8CUnVfLFCQASyU2tfY_y2Vf8,324
|
|
71
|
-
omdev/scripts/interp.py,sha256=
|
|
72
|
-
omdev/scripts/pyproject.py,sha256=
|
|
79
|
+
omdev/scripts/interp.py,sha256=_WbXArFouTOZ4-95Kc7kCC1GbFmp-Ftyhz_1jLxTvQw,68796
|
|
80
|
+
omdev/scripts/pyproject.py,sha256=REWHjV1sCP0t6QEv9Yv7N4okJKIElTCs8xQ-pvDqFDU,152647
|
|
73
81
|
omdev/toml/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
|
|
74
82
|
omdev/toml/parser.py,sha256=84bn09uhYHwQGyfww6Rw6y1RxPAE_HDltODOSakcqDM,29186
|
|
75
83
|
omdev/toml/writer.py,sha256=dwz_Qw8z5Z_nmWpXqch63W6S_j6n256erb7AGFTVzB4,2872
|
|
@@ -83,8 +91,8 @@ omdev/tools/sqlrepl.py,sha256=v9uVQ4nvquSXcQVYIFq34ikumSILvKqzD6lUKLcncCE,5646
|
|
|
83
91
|
omdev/versioning/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
|
|
84
92
|
omdev/versioning/specifiers.py,sha256=6Odf9e6farwlPRsD_YqwTfYKG-BXn_dIcKtqfkhfodI,17432
|
|
85
93
|
omdev/versioning/versions.py,sha256=ei2eopEsJq3zSMJmezK1nzZgikgCdxFtnF3f69nCRZQ,12246
|
|
86
|
-
omdev-0.0.0.
|
|
87
|
-
omdev-0.0.0.
|
|
88
|
-
omdev-0.0.0.
|
|
89
|
-
omdev-0.0.0.
|
|
90
|
-
omdev-0.0.0.
|
|
94
|
+
omdev-0.0.0.dev28.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
|
95
|
+
omdev-0.0.0.dev28.dist-info/METADATA,sha256=QoShpM9YgegstZpXpp-S85RypV0WYAwkbIHwJ8ZIfsI,1252
|
|
96
|
+
omdev-0.0.0.dev28.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
97
|
+
omdev-0.0.0.dev28.dist-info/top_level.txt,sha256=1nr7j30fEWgLYHW3lGR9pkdHkb7knv1U1ES1XRNVQ6k,6
|
|
98
|
+
omdev-0.0.0.dev28.dist-info/RECORD,,
|
omdev/datacache/consts.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
MARSHAL_VERSION = 0
|
omdev/datacache/default.py
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import os.path
|
|
2
|
-
|
|
3
|
-
from omlish import lang
|
|
4
|
-
|
|
5
|
-
from .cache import DataCache
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
##
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@lang.cached_function(lock=True)
|
|
12
|
-
def default_dir() -> str:
|
|
13
|
-
return os.path.expanduser('~/.cache/omlish/data')
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@lang.cached_function(lock=True)
|
|
17
|
-
def default() -> DataCache:
|
|
18
|
-
return DataCache(default_dir())
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def _main() -> None:
|
|
22
|
-
from omlish import logs
|
|
23
|
-
|
|
24
|
-
logs.configure_standard_logging('INFO')
|
|
25
|
-
|
|
26
|
-
#
|
|
27
|
-
|
|
28
|
-
from .specs import GitCacheDataSpec
|
|
29
|
-
from .specs import GithubContentCacheDataSpec
|
|
30
|
-
from .specs import HttpCacheDataSpec
|
|
31
|
-
|
|
32
|
-
for spec in [
|
|
33
|
-
GitCacheDataSpec(
|
|
34
|
-
'https://github.com/wrmsr/deep_learning_cookbook',
|
|
35
|
-
rev='138a99b09ffa3a728d261e461440f029e512ac93',
|
|
36
|
-
subtrees=['data/wp_movies_10k.ndjson'],
|
|
37
|
-
),
|
|
38
|
-
GithubContentCacheDataSpec(
|
|
39
|
-
'karpathy/char-rnn',
|
|
40
|
-
'master',
|
|
41
|
-
['data/tinyshakespeare/input.txt'],
|
|
42
|
-
),
|
|
43
|
-
HttpCacheDataSpec('https://github.com/VanushVaswani/keras_mnistm/releases/download/1.0/keras_mnistm.pkl.gz'),
|
|
44
|
-
]:
|
|
45
|
-
print(spec)
|
|
46
|
-
for _ in range(2):
|
|
47
|
-
print(default().get(spec))
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if __name__ == '__main__':
|
|
51
|
-
_main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|