codelexity 0.2.2__tar.gz → 0.2.3__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: codelexity
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: A package that measures code complexity in the age of AI slop.
5
5
  Keywords: complexity,halstead,maintainability,cyclomatic,static-analysis,metrics
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "codelexity"
3
- version = "0.2.2"
3
+ version = "0.2.3"
4
4
  description = "A package that measures code complexity in the age of AI slop."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -43,7 +43,7 @@ path = "src"
43
43
  editable = true
44
44
 
45
45
  [tool.bumpver]
46
- current_version = "0.2.2"
46
+ current_version = "0.2.3"
47
47
  version_pattern = "MAJOR.MINOR.PATCH"
48
48
  push = false
49
49
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "codelexity"
3
- version = "0.2.2"
3
+ version = "0.2.3"
4
4
  description = "A package that measures code complexity in the age of AI slop."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -48,7 +48,7 @@ dev = [
48
48
  ]
49
49
 
50
50
  [tool.bumpver]
51
- current_version = "0.2.2"
51
+ current_version = "0.2.3"
52
52
  version_pattern = "MAJOR.MINOR.PATCH"
53
53
  push = false # inspect the tag before it leaves the machine
54
54
 
@@ -96,8 +96,6 @@ def _resolve(name, search):
96
96
  try:
97
97
  found = locations and importlib.machinery.PathFinder.find_spec(".".join(parts[: i + 1]), locations)
98
98
  except KeyError:
99
- # ponytail: namespace packages need their own parent in sys.modules
100
- # to build a submodule spec; we never import, so treat as unresolved.
101
99
  found = None
102
100
  if not found:
103
101
  break
@@ -113,7 +111,7 @@ def imports(module_path, root=None):
113
111
  search = sys.path + [str(root), *(str(d) for d in root.rglob("*") if d.is_dir())]
114
112
  names = {n for n in _import_names(code) if n.split(".")[0] not in sys.builtin_module_names}
115
113
  specs = (_resolve(n, search) for n in names)
116
- return sorted({s.origin for s in specs if s and s.origin})
114
+ return sorted({Path(s.origin).as_posix() for s in specs if s and s.origin})
117
115
 
118
116
 
119
117
  def analyze_module(path, root=None):
@@ -90,4 +90,7 @@ def create_viz(package_data: dict, fpath: str):
90
90
  f"Total comprehension time (h): {package_data['analytics']['total_man_hours']}</div>"
91
91
  )
92
92
  path = Path(fpath)
93
- path.write_text(path.read_text().replace("<body>", f"<body>\n{legend}", 1))
93
+ # encoding pinned both ways: pyvis writes UTF-8, but Windows defaults to cp1252, which raises
94
+ # UnicodeDecodeError on read and produces mojibake on write.
95
+ html = path.read_text(encoding="utf-8")
96
+ path.write_text(html.replace("<body>", f"<body>\n{legend}", 1), encoding="utf-8")
File without changes
File without changes