codecrate 0.1.0__py3-none-any.whl → 0.1.1__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.

Potentially problematic release.


This version of codecrate might be problematic. Click here for more details.

codecrate/_version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.1.0'
32
- __version_tuple__ = version_tuple = (0, 1, 0)
31
+ __version__ = version = '0.1.1'
32
+ __version_tuple__ = version_tuple = (0, 1, 1)
33
33
 
34
34
  __commit_id__ = commit_id = None
codecrate/cli.py CHANGED
@@ -175,11 +175,12 @@ def main(argv: list[str] | None = None) -> None:
175
175
  if args.layout is not None
176
176
  else str(getattr(cfg, "layout", "auto")).strip().lower()
177
177
  )
178
- out_path = (
179
- args.output
180
- if args.output is not None
181
- else Path(getattr(cfg, "output", "context.md"))
182
- )
178
+ if args.output is not None:
179
+ out_path = args.output
180
+ else:
181
+ out_path = Path(getattr(cfg, "output", "context.md"))
182
+ if not out_path.is_absolute():
183
+ out_path = root / out_path
183
184
  disc = discover_files(
184
185
  root=root,
185
186
  include=include,
codecrate/config.py CHANGED
@@ -61,10 +61,19 @@ def load_config(root: Path) -> Config:
61
61
  return Config()
62
62
 
63
63
  data = tomllib.loads(cfg_path.read_text(encoding="utf-8"))
64
- section: dict[str, Any] = (
65
- data.get("codecrate", {}) if isinstance(data, dict) else {}
66
- )
67
-
64
+ section: dict[str, Any] = {}
65
+ if isinstance(data, dict):
66
+ # Preferred: [codecrate]
67
+ cc = data.get("codecrate")
68
+ if isinstance(cc, dict):
69
+ section = cc
70
+ else:
71
+ # Also accept: [tool.codecrate] (common convention from pyproject.toml)
72
+ tool = data.get("tool")
73
+ if isinstance(tool, dict):
74
+ cc2 = tool.get("codecrate")
75
+ if isinstance(cc2, dict):
76
+ section = cc2
68
77
  cfg = Config()
69
78
  out = section.get("output", cfg.output)
70
79
  if isinstance(out, str) and out.strip():
codecrate/parse.py CHANGED
@@ -127,7 +127,9 @@ class _Visitor(ast.NodeVisitor):
127
127
  def parse_symbols(
128
128
  path: Path, root: Path, text: str
129
129
  ) -> tuple[list[ClassRef], list[DefRef]]:
130
- tree = ast.parse(text)
130
+ # Pass filename so SyntaxWarnings (e.g. invalid escape sequences) point to
131
+ # the real file instead of "<unknown>".
132
+ tree = ast.parse(text, filename=path.as_posix())
131
133
  v = _Visitor(path=path, root=root)
132
134
  v.visit(tree)
133
135
  return v.classes, v.defs
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codecrate
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Pack Python codebases into Markdown optimized for LLM context delivery (pack/unpack/patch/apply)
5
5
  Author-email: Holger Nahrstaedt <nahrstaedt@gmail.com>
6
6
  License: MIT License
@@ -1,7 +1,7 @@
1
1
  codecrate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- codecrate/_version.py,sha256=5jwwVncvCiTnhOedfkzzxmxsggwmTBORdFL_4wq0ZeY,704
3
- codecrate/cli.py,sha256=4dH2IYVTXQ33GHpomnViKbrlVGdcJUK_3h263nCWOtc,8294
4
- codecrate/config.py,sha256=EuOMR0rSq2T5ZuorjfIYrhsX3j1taAsZ_3AsYPGakYQ,3147
2
+ codecrate/_version.py,sha256=m8HxkqoKGw_wAJtc4ZokpJKNLXqp4zwnNhbnfDtro7w,704
3
+ codecrate/cli.py,sha256=0QCw4y4NJsiEM_dKOdF6qmJXPXeEoRBYC6cAH5rMKqg,8377
4
+ codecrate/config.py,sha256=8VOmpjHC3am6LRFnyHUY3376947XTvSFGp3fUxSZgOk,3523
5
5
  codecrate/diffgen.py,sha256=xMH-wJeMox_xoMLrGck2o7RP5mjlCJjndSHPHql9CJg,3432
6
6
  codecrate/discover.py,sha256=eWebPPbPHy5WrtbCX-RA1hKiPyQau6buUm5OcjpVi9U,2847
7
7
  codecrate/ids.py,sha256=fO_PAaskT7hLXgvJN7Hv4HD27zPIFnSziB0k2AUpONo,517
@@ -10,15 +10,15 @@ codecrate/markdown.py,sha256=2ruEmsCF9v-aPpiKEOGusi4T13wEzugNn7JSN6T7KGg,16670
10
10
  codecrate/mdparse.py,sha256=Lu9aN3rMP5qetwLapVrRvVRohPXv8L0hmjG0GUG7jys,4746
11
11
  codecrate/model.py,sha256=Px9xL4odcvlDgEnSiwd5SMi9_k1Xck4R8DOlahN9Z-4,897
12
12
  codecrate/packer.py,sha256=an-E1ZilIOY2hdjF4Gt3J5APOCTRRpiinmvfBiw29Ds,3398
13
- codecrate/parse.py,sha256=Huu2PjHPBE1cCYI_GsYhgOqXoifP076asg5Tlsfpf8E,4437
13
+ codecrate/parse.py,sha256=7baMIxRQoZGNAgFsydalC6cYZGRqDF4KWz8qhpzLDRw,4586
14
14
  codecrate/stubber.py,sha256=9WxpQs6FTCT0OUX4Si8GdD63VyUJQnNqRcwTm_IPuKc,2857
15
15
  codecrate/token_budget.py,sha256=0vG9h7l5yNn909QQEItrYQJIjMT2h5LcM9iZf4zu-3c,12937
16
16
  codecrate/udiff.py,sha256=bMvwhgqXZw2pIW5VcRRATUoDspM2XGQU3nInD_A7WWo,6249
17
17
  codecrate/unpacker.py,sha256=soh6qwRE6sxoBAbr3UbXk1O5aiwdnfUhkqfFdSvU0_I,5063
18
18
  codecrate/validate.py,sha256=-KVU7RQ8zJG-YJoD8kLCYgE0OWWdy-yYzl0gyp-3mWo,4250
19
- codecrate-0.1.0.dist-info/licenses/LICENSE,sha256=O6yVC2oL8vUoAA3oPEvLSbvxzmwtOOPiY7dOZzgrxi0,1074
20
- codecrate-0.1.0.dist-info/METADATA,sha256=fwuc8JDMxUx1h9JRTr5vd0JgJ34uZxk7CkEfZqEAR-M,9394
21
- codecrate-0.1.0.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
22
- codecrate-0.1.0.dist-info/entry_points.txt,sha256=DcY9tib-PzdLebck4B2RYJ0CGH6cqAJMCHPU3MdA0Dk,49
23
- codecrate-0.1.0.dist-info/top_level.txt,sha256=-jD2a_aH1iQN4atRhGw7ZhEYnOWe88nfmkz6sPZ6WEg,10
24
- codecrate-0.1.0.dist-info/RECORD,,
19
+ codecrate-0.1.1.dist-info/licenses/LICENSE,sha256=O6yVC2oL8vUoAA3oPEvLSbvxzmwtOOPiY7dOZzgrxi0,1074
20
+ codecrate-0.1.1.dist-info/METADATA,sha256=xFktVoakgBrUyCAMZpcecQMjAyXMYOYt3fv80n0H9MI,9394
21
+ codecrate-0.1.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
22
+ codecrate-0.1.1.dist-info/entry_points.txt,sha256=DcY9tib-PzdLebck4B2RYJ0CGH6cqAJMCHPU3MdA0Dk,49
23
+ codecrate-0.1.1.dist-info/top_level.txt,sha256=-jD2a_aH1iQN4atRhGw7ZhEYnOWe88nfmkz6sPZ6WEg,10
24
+ codecrate-0.1.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.10.1)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5