maketool 0.8.15__py3-none-any.whl → 0.8.16__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.
maketool/refscan.py CHANGED
@@ -7,6 +7,7 @@ Usage:
7
7
 
8
8
  Reports:
9
9
  1) UNUSED files: filename/path tokens not found in scanned text sources
10
+ - Printed grouped by extension (same extensions together)
10
11
  2) MISSING imports: imports used by entry (and local-resolved siblings) but not installed
11
12
  """
12
13
 
@@ -23,6 +24,7 @@ try:
23
24
  except Exception:
24
25
  packages_distributions = None # type: ignore
25
26
 
27
+
26
28
  # ----------------------------
27
29
  # Refscan settings
28
30
  # ----------------------------
@@ -80,6 +82,7 @@ def safe_read_text(p: Path) -> Optional[str]:
80
82
  except Exception:
81
83
  return None
82
84
 
85
+
83
86
  def norm(s: str) -> str:
84
87
  return s.replace("\\", "/").lower()
85
88
 
@@ -113,22 +116,6 @@ def print_group(title: str, rows: list[tuple[str, list[str]]]) -> None:
113
116
  print(title)
114
117
  print("-" * len(title))
115
118
  for rel, refs in rows:
116
- is_py = rel.lower().endswith(".py")
117
- name = f"[PY] {rel}" if is_py else rel
118
-
119
- if refs:
120
- preview = ", ".join(refs[:3]) + (" ..." if len(refs) > 3 else "")
121
- print(f"{name} <-- {preview}")
122
- else:
123
- print(name)
124
- print()
125
-
126
-
127
- def print_group(title: str, rows: list[tuple[str, list[str]]]) -> None:
128
- print(title)
129
- print("-" * len(title))
130
- for rel, refs in rows:
131
- # no markers; print plain filename/path
132
119
  if refs:
133
120
  preview = ", ".join(refs[:3]) + (" ..." if len(refs) > 3 else "")
134
121
  print(f"{rel} <-- {preview}")
@@ -138,7 +125,7 @@ def print_group(title: str, rows: list[tuple[str, list[str]]]) -> None:
138
125
 
139
126
 
140
127
  # ----------------------------
141
- # Missing-import report (merged from report.py)
128
+ # Missing-import report
142
129
  # ----------------------------
143
130
 
144
131
  def stdlib_names() -> Set[str]:
@@ -222,7 +209,6 @@ def _index_local_modules_under(root: Path) -> Set[str]:
222
209
  def index_local_modules(project_root: Path) -> Set[str]:
223
210
  roots: List[Path] = [project_root]
224
211
 
225
- # common extra roots (optional)
226
212
  for name in ["src", "lib", "app", "python", "package", "packages"]:
227
213
  p = project_root / name
228
214
  if p.exists() and p.is_dir():
@@ -278,14 +264,6 @@ def compute_missing_used_imports(
278
264
  missing.add(name)
279
265
  return missing
280
266
 
281
- def print_unused_grouped_by_ext(unused_rels: list[str]) -> None:
282
- # Sort by: extension (lower), then full path (lower)
283
- def key(rel: str):
284
- ext = Path(rel).suffix.lower()
285
- return (ext, rel.lower())
286
-
287
- for rel in sorted(unused_rels, key=key):
288
- print(rel)
289
267
 
290
268
  def run_missing_imports_report(entry: Path, project_root: Path) -> None:
291
269
  print("MISSING (used but not installed):")
@@ -308,7 +286,8 @@ def run_missing_imports_report(entry: Path, project_root: Path) -> None:
308
286
  project_root=project_root,
309
287
  )
310
288
 
311
- if not missing: return
289
+ if not missing:
290
+ return
312
291
 
313
292
  for m in sorted(missing):
314
293
  print(m)
@@ -355,13 +334,14 @@ def main() -> int:
355
334
 
356
335
  unused_rows: list[tuple[str, List[str]]] = []
357
336
  for c in candidates:
358
- refs = references[c.rel]
359
- if not refs:
360
- unused_rows.append((c.rel, refs))
337
+ if not references[c.rel]:
338
+ unused_rows.append((c.rel, references[c.rel]))
339
+
340
+ # Group-by-extension presentation: sort by extension, then by name
341
+ unused_rows.sort(key=lambda item: (Path(item[0]).suffix.lower(), item[0].lower()))
361
342
 
362
343
  print_group("UNUSED files (no filename/path tokens found)", unused_rows)
363
344
 
364
- # Second report: missing imports (based on entry .py)
365
345
  if entry.suffix.lower() == ".py":
366
346
  run_missing_imports_report(entry=entry, project_root=root)
367
347
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maketool
3
- Version: 0.8.15
3
+ Version: 0.8.16
4
4
  Summary: Python Automation tool for building PySide6 UI and PyInstaller EXE.
5
5
  Author-email: Alan Lilly <panofish@gmail.com>
6
6
  Requires-Python: >=3.7
@@ -2,11 +2,11 @@ maketool/__init__.py,sha256=in3uaJRClTGaMIQ6sg725m8so86U7gBr1QfCErxuLAk,172
2
2
  maketool/build.py,sha256=-x45Nq-FZyemyAmh1gZlZ0c_JcSUePsbViLCeZezb4o,3921
3
3
  maketool/clean.py,sha256=pJYb-kt23_HaOrckv8Kft09HKl9m4_Lt1Tf15HQCmvE,3245
4
4
  maketool/compile.py,sha256=n1mzoyU5hlOjHVn2ytCsZVEvN6hta8-VHyR25UGc1CQ,14496
5
- maketool/refscan.py,sha256=gym_Cdatvz63KOAvOLm6V1ksC42cnuFKsRSqXv5JoJI,10470
5
+ maketool/refscan.py,sha256=OC8Ov0tcczLfI-4dcpz4GBr9GYV7bK-5BZjxQA1tieQ,9818
6
6
  maketool/run.py,sha256=UO6O7IaSl8XBqPEsC0CaTt65Or0m3_wQFvWZUnY4J00,2399
7
7
  maketool/sublime.py,sha256=Ah_Y3tT7ifpUh_pGugY7hqM4SQ0UE-OPLam2hZZtar0,9116
8
- maketool-0.8.15.dist-info/METADATA,sha256=CkSjPtk7JBS4jQhy1ZQX-alAznM4sOmDIZwcK-A4z90,4845
9
- maketool-0.8.15.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
10
- maketool-0.8.15.dist-info/entry_points.txt,sha256=hYswW0t7b9YacCLg0-4zAI1CKKjeOH1LJfi34Z8lAPc,248
11
- maketool-0.8.15.dist-info/top_level.txt,sha256=e7JbT3AdVc2AJstJ1xW1hcwhwfFQ6U8QRdFzaFQe6sQ,9
12
- maketool-0.8.15.dist-info/RECORD,,
8
+ maketool-0.8.16.dist-info/METADATA,sha256=VRDa_g4mivI5hP-JXcdL_2z-E46Vj_Tj9yP3I9MIu7k,4845
9
+ maketool-0.8.16.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
10
+ maketool-0.8.16.dist-info/entry_points.txt,sha256=hYswW0t7b9YacCLg0-4zAI1CKKjeOH1LJfi34Z8lAPc,248
11
+ maketool-0.8.16.dist-info/top_level.txt,sha256=e7JbT3AdVc2AJstJ1xW1hcwhwfFQ6U8QRdFzaFQe6sQ,9
12
+ maketool-0.8.16.dist-info/RECORD,,