omlish 0.0.0.dev26__py3-none-any.whl → 0.0.0.dev27__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.
- omlish/__about__.py +4 -5
- omlish/lang/resources.py +29 -10
- omlish/lite/check.py +6 -0
- {omlish-0.0.0.dev26.dist-info → omlish-0.0.0.dev27.dist-info}/METADATA +1 -1
- {omlish-0.0.0.dev26.dist-info → omlish-0.0.0.dev27.dist-info}/RECORD +9 -9
- /omlish/{_manifests.json → .manifests.json} +0 -0
- {omlish-0.0.0.dev26.dist-info → omlish-0.0.0.dev27.dist-info}/LICENSE +0 -0
- {omlish-0.0.0.dev26.dist-info → omlish-0.0.0.dev27.dist-info}/WHEEL +0 -0
- {omlish-0.0.0.dev26.dist-info → omlish-0.0.0.dev27.dist-info}/top_level.txt +0 -0
omlish/__about__.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
__version__ = '0.0.0.
|
2
|
-
__revision__ = '
|
1
|
+
__version__ = '0.0.0.dev27'
|
2
|
+
__revision__ = 'c62e03dc2f032aa532d2c2b9f0d71ff96158cdec'
|
3
3
|
|
4
4
|
|
5
5
|
#
|
@@ -126,11 +126,10 @@ class SetuptoolsBase:
|
|
126
126
|
'*': [
|
127
127
|
'*.c',
|
128
128
|
'*.cc',
|
129
|
+
'*.cu',
|
129
130
|
'*.h',
|
130
131
|
|
131
|
-
'
|
132
|
-
|
133
|
-
'*.sql',
|
132
|
+
'.manifests.json',
|
134
133
|
|
135
134
|
'LICENSE',
|
136
135
|
],
|
omlish/lang/resources.py
CHANGED
@@ -11,7 +11,7 @@ class RelativeResource(ta.NamedTuple):
|
|
11
11
|
|
12
12
|
|
13
13
|
def get_relative_resources(
|
14
|
-
|
14
|
+
path: str = '',
|
15
15
|
*,
|
16
16
|
globals: ta.Mapping[str, ta.Any] | None = None, # noqa
|
17
17
|
package: str | None = None,
|
@@ -23,13 +23,29 @@ def get_relative_resources(
|
|
23
23
|
if not file:
|
24
24
|
file = globals.get('__file__')
|
25
25
|
|
26
|
+
#
|
27
|
+
|
28
|
+
if os.sep in path:
|
29
|
+
raise ValueError(path) # noqa
|
30
|
+
if not path.startswith('.'):
|
31
|
+
path = '.' + path
|
32
|
+
if set(path) - {'.'}:
|
33
|
+
dot_pos = next(i for i in range(len(path)) if path[i] != '.')
|
34
|
+
num_up = dot_pos - 1
|
35
|
+
path_parts = path[dot_pos:].split('.')
|
36
|
+
else:
|
37
|
+
num_up = len(path) - 1
|
38
|
+
path_parts = []
|
39
|
+
|
40
|
+
#
|
41
|
+
|
26
42
|
lst: list[RelativeResource] = []
|
27
43
|
|
28
44
|
if package:
|
29
|
-
|
30
|
-
if
|
31
|
-
|
32
|
-
|
45
|
+
pkg_parts = package.split('.')
|
46
|
+
if num_up:
|
47
|
+
pkg_parts = pkg_parts[:-num_up]
|
48
|
+
anchor = '.'.join([*pkg_parts, *path_parts])
|
33
49
|
for pf in importlib.resources.files(anchor).iterdir():
|
34
50
|
lst.append(RelativeResource(
|
35
51
|
name=pf.name,
|
@@ -38,16 +54,19 @@ def get_relative_resources(
|
|
38
54
|
))
|
39
55
|
|
40
56
|
elif file:
|
41
|
-
|
42
|
-
|
43
|
-
|
57
|
+
base_dir = os.path.dirname(file)
|
58
|
+
dst_dir = os.path.join(
|
59
|
+
base_dir,
|
60
|
+
*(['..'] * num_up),
|
61
|
+
*path_parts,
|
62
|
+
)
|
44
63
|
|
45
64
|
def _read_file(fp: str) -> bytes:
|
46
65
|
with open(fp, 'rb') as f:
|
47
66
|
return f.read()
|
48
67
|
|
49
|
-
for ff in os.listdir(
|
50
|
-
ff = os.path.join(
|
68
|
+
for ff in os.listdir(dst_dir):
|
69
|
+
ff = os.path.join(dst_dir, ff)
|
51
70
|
lst.append(RelativeResource(
|
52
71
|
name=os.path.basename(ff),
|
53
72
|
is_file=os.path.isfile(ff),
|
omlish/lite/check.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
omlish
|
1
|
+
omlish/.manifests.json,sha256=N1F-Xz3GaBn2H1p7uKzhkhKCQV8QVR0t76XD6wmFtXA,3
|
2
|
+
omlish/__about__.py,sha256=zjwXesy8pai60AJpe7FV4t72dwRlRVraIytt0d1XmnE,2721
|
2
3
|
omlish/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
|
-
omlish/_manifests.json,sha256=N1F-Xz3GaBn2H1p7uKzhkhKCQV8QVR0t76XD6wmFtXA,3
|
4
4
|
omlish/argparse.py,sha256=QRQmX9G0-L_nATkFtGHvpd4qrpYzKATdjuFLbBqzJPM,6224
|
5
5
|
omlish/c3.py,sha256=W5EwYx9Por3rWYLkKUitJ6OoRMLLgVTfLTyroOz41Y0,8047
|
6
6
|
omlish/cached.py,sha256=UAizxlH4eMWHPzQtmItmyE6FEpFEUFzIkxaO2BHWZ5s,196
|
@@ -178,7 +178,7 @@ omlish/lang/iterables.py,sha256=_q6rHbdFfW3VBqez0IV3rUABoNxsA_oBv_sykm5zsbQ,2243
|
|
178
178
|
omlish/lang/maybes.py,sha256=NYHZDjqDtwPMheDrj2VtUVujxRPf8Qpgk4ZlZCTvBZc,3492
|
179
179
|
omlish/lang/objects.py,sha256=1dY8dX5voIZf5FBYUiN0BRsWg2JCdsgRbDl9fLG7OtY,4310
|
180
180
|
omlish/lang/resolving.py,sha256=OuN2mDTPNyBUbcrswtvFKtj4xgH4H4WglgqSKv3MTy0,1606
|
181
|
-
omlish/lang/resources.py,sha256=
|
181
|
+
omlish/lang/resources.py,sha256=BD3EaLvTUPpUHfccfiSnnjuvlRhFwv_bcVOzwPPh1rw,2134
|
182
182
|
omlish/lang/strings.py,sha256=ykeoou4JK7CEZXzrUJfqVOalEDvE--j0uhHt_SrsrUs,2834
|
183
183
|
omlish/lang/sys.py,sha256=UoZz_PJYVKLQAKqYxxn-LHz1okK_38I__maZgnXMcxU,406
|
184
184
|
omlish/lang/timeouts.py,sha256=vECdWYhc_IZgcal1Ng1Y42wf2FV3KAx-i8As-MgGHIQ,1186
|
@@ -198,7 +198,7 @@ omlish/lifecycles/states.py,sha256=zqMOU2ZU-MDNnWuwauM3_anIAiXM8LoBDElDEraptFg,1
|
|
198
198
|
omlish/lifecycles/transitions.py,sha256=qQtFby-h4VzbvgaUqT2NnbNumlcOx9FVVADP9t83xj4,1939
|
199
199
|
omlish/lite/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
|
200
200
|
omlish/lite/cached.py,sha256=dUm647FbIsoxWT23XUFM51F7i-C2Buxr5b5zzgbCtQI,546
|
201
|
-
omlish/lite/check.py,sha256=
|
201
|
+
omlish/lite/check.py,sha256=DYxkYkxpnQpjGpDwW_8M8YBXbswvnBUCr0UBPU7aNKo,642
|
202
202
|
omlish/lite/contextmanagers.py,sha256=HnQJiyrOmSvTL22XRJrFl5CLpCyHD9fsntEUAr9G-60,427
|
203
203
|
omlish/lite/json.py,sha256=7-02Ny4fq-6YAu5ynvqoijhuYXWpLmfCI19GUeZnb1c,740
|
204
204
|
omlish/lite/logs.py,sha256=PeJZUJWd1K-UFErVs0wtD0zRMFW5-olUNFVVZAj_ScY,5549
|
@@ -310,8 +310,8 @@ omlish/text/delimit.py,sha256=ubPXcXQmtbOVrUsNh5gH1mDq5H-n1y2R4cPL5_DQf68,4928
|
|
310
310
|
omlish/text/glyphsplit.py,sha256=Ug-dPRO7x-OrNNr8g1y6DotSZ2KH0S-VcOmUobwa4B0,3296
|
311
311
|
omlish/text/indent.py,sha256=6Jj6TFY9unaPa4xPzrnZemJ-fHsV53IamP93XGjSUHs,1274
|
312
312
|
omlish/text/parts.py,sha256=KGgo0wHOIMVMZtDso-rhSWKAcAkYAH2IGpg9tULabu8,6505
|
313
|
-
omlish-0.0.0.
|
314
|
-
omlish-0.0.0.
|
315
|
-
omlish-0.0.0.
|
316
|
-
omlish-0.0.0.
|
317
|
-
omlish-0.0.0.
|
313
|
+
omlish-0.0.0.dev27.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
314
|
+
omlish-0.0.0.dev27.dist-info/METADATA,sha256=y3f_PoZpAVj2Mpn51ruURaZtqJ0Tm8YWmtFacYsa0ck,3666
|
315
|
+
omlish-0.0.0.dev27.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
316
|
+
omlish-0.0.0.dev27.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
|
317
|
+
omlish-0.0.0.dev27.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|