omdev 0.0.0.dev447__py3-none-any.whl → 0.0.0.dev449__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/.omlish-manifests.json +1 -1
- omdev/precheck/blanklines.py +66 -0
- omdev/precheck/main.py +2 -0
- omdev/tools/pip.py +8 -0
- {omdev-0.0.0.dev447.dist-info → omdev-0.0.0.dev449.dist-info}/METADATA +2 -2
- {omdev-0.0.0.dev447.dist-info → omdev-0.0.0.dev449.dist-info}/RECORD +10 -9
- {omdev-0.0.0.dev447.dist-info → omdev-0.0.0.dev449.dist-info}/WHEEL +0 -0
- {omdev-0.0.0.dev447.dist-info → omdev-0.0.0.dev449.dist-info}/entry_points.txt +0 -0
- {omdev-0.0.0.dev447.dist-info → omdev-0.0.0.dev449.dist-info}/licenses/LICENSE +0 -0
- {omdev-0.0.0.dev447.dist-info → omdev-0.0.0.dev449.dist-info}/top_level.txt +0 -0
omdev/.omlish-manifests.json
CHANGED
@@ -0,0 +1,66 @@
|
|
1
|
+
import dataclasses as dc
|
2
|
+
import os
|
3
|
+
import typing as ta
|
4
|
+
|
5
|
+
from omlish.text.filecache import TextFileCache
|
6
|
+
|
7
|
+
from .base import Precheck
|
8
|
+
from .base import PrecheckContext
|
9
|
+
from .caches import DirWalkCache
|
10
|
+
from .caches import HeadersCache
|
11
|
+
|
12
|
+
|
13
|
+
##
|
14
|
+
|
15
|
+
|
16
|
+
class BlankLinesPrecheck(Precheck['BlankLinesPrecheck.Config']):
|
17
|
+
@dc.dataclass(frozen=True)
|
18
|
+
class Config(Precheck.Config):
|
19
|
+
DEFAULT_FILE_EXTENSIONS: ta.ClassVar[ta.AbstractSet[str]] = frozenset([
|
20
|
+
'py',
|
21
|
+
|
22
|
+
'c',
|
23
|
+
'cc',
|
24
|
+
'cu',
|
25
|
+
'h',
|
26
|
+
'hh',
|
27
|
+
])
|
28
|
+
|
29
|
+
file_extensions: ta.AbstractSet[str] = DEFAULT_FILE_EXTENSIONS
|
30
|
+
|
31
|
+
def __init__(
|
32
|
+
self,
|
33
|
+
context: PrecheckContext,
|
34
|
+
config: Config = Config(),
|
35
|
+
*,
|
36
|
+
dir_walk_cache: DirWalkCache,
|
37
|
+
text_file_cache: TextFileCache,
|
38
|
+
headers_cache: HeadersCache,
|
39
|
+
) -> None:
|
40
|
+
super().__init__(config)
|
41
|
+
|
42
|
+
self._context = context
|
43
|
+
|
44
|
+
self._dir_walk_cache = dir_walk_cache
|
45
|
+
self._text_file_cache = text_file_cache
|
46
|
+
self._headers_cache = headers_cache
|
47
|
+
|
48
|
+
async def _run_file(self, file: str) -> ta.AsyncGenerator[Precheck.Violation]:
|
49
|
+
src = self._text_file_cache.get_entry(file).text()
|
50
|
+
|
51
|
+
if src and not src.splitlines()[0]:
|
52
|
+
yield Precheck.Violation(self, f'source file {file} starts with blank line')
|
53
|
+
|
54
|
+
async def run(self) -> ta.AsyncGenerator[Precheck.Violation]:
|
55
|
+
files = [
|
56
|
+
os.path.join(e.root, f)
|
57
|
+
for src_root in self._context.src_roots
|
58
|
+
for e in self._dir_walk_cache.list_dir(src_root)
|
59
|
+
for f in e.files
|
60
|
+
if '.' in f
|
61
|
+
and any(f.endswith('.' + ext) for ext in self._config.file_extensions)
|
62
|
+
]
|
63
|
+
|
64
|
+
for file in sorted(files):
|
65
|
+
async for v in self._run_file(file):
|
66
|
+
yield v
|
omdev/precheck/main.py
CHANGED
@@ -29,6 +29,7 @@ from omlish.logs import all as logs
|
|
29
29
|
|
30
30
|
from .base import Precheck
|
31
31
|
from .base import PrecheckContext
|
32
|
+
from .blanklines import BlankLinesPrecheck
|
32
33
|
from .caches import AstCache
|
33
34
|
from .caches import DirWalkCache
|
34
35
|
from .caches import HeadersCache
|
@@ -87,6 +88,7 @@ def _check_cmd(args) -> None:
|
|
87
88
|
)
|
88
89
|
|
89
90
|
pc_cfgs: list[Precheck.Config] = [
|
91
|
+
BlankLinesPrecheck.Config(),
|
90
92
|
GitBlacklistPrecheck.Config(),
|
91
93
|
LitePython8Precheck.Config(),
|
92
94
|
ManifestsPrecheck.Config(),
|
omdev/tools/pip.py
CHANGED
@@ -22,6 +22,11 @@ from ..pip import lookup_latest_package_version
|
|
22
22
|
##
|
23
23
|
|
24
24
|
|
25
|
+
DEV_DEP_NAMES: ta.AbstractSet[str] = frozenset([
|
26
|
+
'pydevd-pycharm',
|
27
|
+
])
|
28
|
+
|
29
|
+
|
25
30
|
class Cli(ap.Cli):
|
26
31
|
@ap.cmd(
|
27
32
|
ap.arg('package'),
|
@@ -49,6 +54,9 @@ class Cli(ap.Cli):
|
|
49
54
|
for l in src.splitlines(keepends=True):
|
50
55
|
if l.startswith('-e'):
|
51
56
|
continue
|
57
|
+
pr = parse_requirement(l)
|
58
|
+
if pr.name in DEV_DEP_NAMES:
|
59
|
+
continue
|
52
60
|
out.append(l)
|
53
61
|
|
54
62
|
new_src = ''.join(out)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: omdev
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev449
|
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.dev449
|
18
18
|
Provides-Extra: all
|
19
19
|
Requires-Dist: black~=25.1; extra == "all"
|
20
20
|
Requires-Dist: pycparser~=2.23; extra == "all"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
omdev/.omlish-manifests.json,sha256=
|
1
|
+
omdev/.omlish-manifests.json,sha256=ex2KVBEIjVkqBI_gpH-HcSDohNuDC3rhaY6eFCPzM_8,11909
|
2
2
|
omdev/__about__.py,sha256=jGBKcjGKlquwFQNwnAR0Yoglh8h8UZ0Nh7h46HIXTTQ,1202
|
3
3
|
omdev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
omdev/cmake.py,sha256=gu49t10_syXh_TUJs4POsxeFs8we8Y3XTOOPgIXmGvg,4608
|
@@ -216,11 +216,12 @@ omdev/packaging/wheelfile.py,sha256=xv-VpLwhgj1UKounbawAOtkJENRvkJJaHSjD4_zZz_o,
|
|
216
216
|
omdev/precheck/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
217
217
|
omdev/precheck/__main__.py,sha256=UEuS4z5-heIrwTtB-ONe1KeXJdqj8tYXMqWMpuO10so,165
|
218
218
|
omdev/precheck/base.py,sha256=fKdrfakq2u1UU1_JZFnl-non9bIAZMsSkVY1SMYn8xQ,662
|
219
|
+
omdev/precheck/blanklines.py,sha256=VG06NTcFoJjUBn46OXlx4qf5u3vx5l02XiNANBeuQBY,1882
|
219
220
|
omdev/precheck/caches.py,sha256=OZKP20DIj6OpUzdNwrjCufv1GzndEbsc7tLD-qHNv9g,1736
|
220
221
|
omdev/precheck/git.py,sha256=O8rNQZ_vlHec0pOFbK6LOkbly5ZIUYT_HXRMqQX8GaI,774
|
221
222
|
omdev/precheck/imports.py,sha256=3loQxHMrpI0ce4-le77NCSxutLac_5vDW4UDX7KWWg8,2565
|
222
223
|
omdev/precheck/lite.py,sha256=sseaKHMZgMhIEuifZvPJm0-wuRqRUrnyySJfHBMItOM,4737
|
223
|
-
omdev/precheck/main.py,sha256=
|
224
|
+
omdev/precheck/main.py,sha256=hbCouy3Lh1hFmQxktQz-_-LhlT3fnXXFoJhzT_rKX9M,4445
|
224
225
|
omdev/precheck/manifests.py,sha256=dxl7GSJHKjQrR6mbwvj6j92XDGHOpxxEEQ6smJkBEe4,810
|
225
226
|
omdev/precheck/scripts.py,sha256=6nb_lDgyX7u9kdF_BU6ubY01q_jGk96VH9q9gpOieng,1753
|
226
227
|
omdev/precheck/unicode.py,sha256=vMxGb4Kqg1NhFlw1kbgsPtXOnswjREH0ZPZExrrTwCU,3260
|
@@ -294,7 +295,7 @@ omdev/tools/docker.py,sha256=Ipia1OKIf7EQyS4HnTYjTzfeOKodLMAQRVYsEAWDHwk,7793
|
|
294
295
|
omdev/tools/linehisto.py,sha256=0ZNm34EuiZBE9Q2YC6KNLNNydNT8QPSOwvYzXiU9S2Q,8881
|
295
296
|
omdev/tools/mkenv.py,sha256=nqUcQgVznF0UKYd5toXCb0WIGVBkduh5Cd31q1zou3o,2289
|
296
297
|
omdev/tools/notebook.py,sha256=MGi2JEwyIPR1n7gakaaYZL1HHbSVmDKGQROqH56ppgU,3499
|
297
|
-
omdev/tools/pip.py,sha256=
|
298
|
+
omdev/tools/pip.py,sha256=zVIIo0CWSHrDP5_FcBK6OEGbZxdTYcoMDBjHdo5Vn5s,3644
|
298
299
|
omdev/tools/prof.py,sha256=-nei6BgAQpaSfVi5cqeRXPc9zIAW-DgMJxnKoD520Zg,3560
|
299
300
|
omdev/tools/qr.py,sha256=1p4tMJmImDa4YTQQNPwQPkM8FnhGRYj6J79BJR-MNHo,1742
|
300
301
|
omdev/tools/shadow.py,sha256=4E2ilxa16liIvQxvgU37ITkOMrP6ufShRQfeW7wwtRc,1697
|
@@ -323,9 +324,9 @@ omdev/tools/jsonview/resources/jsonview.js,sha256=faDvXDOXKvEvjOuIlz4D3F2ReQXb_b
|
|
323
324
|
omdev/tools/pawk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
324
325
|
omdev/tools/pawk/__main__.py,sha256=VCqeRVnqT1RPEoIrqHFSu4PXVMg4YEgF4qCQm90-eRI,66
|
325
326
|
omdev/tools/pawk/pawk.py,sha256=ao5mdrpiSU4AZ8mBozoEaV3UVlmVTnRG9wD9XP70MZE,11429
|
326
|
-
omdev-0.0.0.
|
327
|
-
omdev-0.0.0.
|
328
|
-
omdev-0.0.0.
|
329
|
-
omdev-0.0.0.
|
330
|
-
omdev-0.0.0.
|
331
|
-
omdev-0.0.0.
|
327
|
+
omdev-0.0.0.dev449.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
328
|
+
omdev-0.0.0.dev449.dist-info/METADATA,sha256=koVTyTiNxFLfZN6i9TIRTte7S6hY11pgXcak3tk8mC4,5100
|
329
|
+
omdev-0.0.0.dev449.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
330
|
+
omdev-0.0.0.dev449.dist-info/entry_points.txt,sha256=dHLXFmq5D9B8qUyhRtFqTGWGxlbx3t5ejedjrnXNYLU,33
|
331
|
+
omdev-0.0.0.dev449.dist-info/top_level.txt,sha256=1nr7j30fEWgLYHW3lGR9pkdHkb7knv1U1ES1XRNVQ6k,6
|
332
|
+
omdev-0.0.0.dev449.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|