maketool 0.8.16__tar.gz → 0.8.17__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maketool
3
- Version: 0.8.16
3
+ Version: 0.8.17
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
@@ -7,7 +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
+ - Grouped by extension, with .py printed last and a blank line before the .py group
11
11
  2) MISSING imports: imports used by entry (and local-resolved siblings) but not installed
12
12
  """
13
13
 
@@ -112,15 +112,28 @@ def is_text_source(p: Path) -> bool:
112
112
  return ext in DEFAULT_SCAN_EXTS
113
113
 
114
114
 
115
- def print_group(title: str, rows: list[tuple[str, list[str]]]) -> None:
116
- print(title)
117
- print("-" * len(title))
118
- for rel, refs in rows:
119
- if refs:
120
- preview = ", ".join(refs[:3]) + (" ..." if len(refs) > 3 else "")
121
- print(f"{rel} <-- {preview}")
122
- else:
123
- print(rel)
115
+ def print_unused_grouped(unused_rels: list[str]) -> None:
116
+ """
117
+ Print unused files grouped by extension, with .py printed last and a blank
118
+ line inserted before the .py group.
119
+ """
120
+ def sort_key(rel: str):
121
+ ext = Path(rel).suffix.lower()
122
+ is_py = (ext == ".py")
123
+ return (is_py, ext, rel.lower())
124
+
125
+ unused_sorted = sorted(unused_rels, key=sort_key)
126
+
127
+ print("UNUSED files (no filename/path tokens found)")
128
+ print("--------------------------------------------")
129
+
130
+ printed_py_gap = False
131
+ for rel in unused_sorted:
132
+ if Path(rel).suffix.lower() == ".py" and not printed_py_gap:
133
+ print() # blank line before first .py file
134
+ printed_py_gap = True
135
+ print(rel)
136
+
124
137
  print()
125
138
 
126
139
 
@@ -332,15 +345,8 @@ def main() -> int:
332
345
  if any(tok in hay for tok in c.tokens):
333
346
  references[c.rel].append(src_rel)
334
347
 
335
- unused_rows: list[tuple[str, List[str]]] = []
336
- for c in candidates:
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()))
342
-
343
- print_group("UNUSED files (no filename/path tokens found)", unused_rows)
348
+ unused_rels = [c.rel for c in candidates if not references[c.rel]]
349
+ print_unused_grouped(unused_rels)
344
350
 
345
351
  if entry.suffix.lower() == ".py":
346
352
  run_missing_imports_report(entry=entry, project_root=root)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maketool
3
- Version: 0.8.16
3
+ Version: 0.8.17
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "maketool"
3
- version = "0.8.16"
3
+ version = "0.8.17"
4
4
  description = "Python Automation tool for building PySide6 UI and PyInstaller EXE."
5
5
  authors = [{ name = "Alan Lilly", email = "panofish@gmail.com" }]
6
6
  readme = "README.md"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes