omdev 0.0.0.dev437__py3-none-any.whl → 0.0.0.dev439__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/__about__.py CHANGED
@@ -31,7 +31,7 @@ class Project(ProjectBase):
31
31
  ],
32
32
 
33
33
  'mypy': [
34
- 'mypy ~= 1.17',
34
+ 'mypy ~= 1.18',
35
35
  ],
36
36
 
37
37
  'prof': [
@@ -40,6 +40,17 @@ class SrcFile:
40
40
  has_binary_resources: bool = False
41
41
 
42
42
 
43
+ def drop_amalg_comment_lines(lines: ta.Iterable[tks.Tokens]) -> list[tks.Tokens]:
44
+ out: list[tks.Tokens] = []
45
+ for l in lines:
46
+ cl = list(tks.ignore_ws(l, drop_nl=True, keep=['COMMENT']))
47
+ if len(cl) == 1 and (t := cl[0]).name == 'COMMENT':
48
+ if t.src.split()[1:2] == ['@omlish-amalg']:
49
+ continue
50
+ out.append(l)
51
+ return out
52
+
53
+
43
54
  def make_src_file(
44
55
  path: str,
45
56
  *,
@@ -51,6 +62,8 @@ def make_src_file(
51
62
  tokens = tks.src_to_tokens(src)
52
63
  lines = tks.split_lines(tokens)
53
64
 
65
+ lines = drop_amalg_comment_lines(lines)
66
+
54
67
  header_lines, cls = split_header_lines(lines)
55
68
 
56
69
  header_lines = strip_header_lines(header_lines)