[codex] Prepare pymini for ongoing maintenance#3
Conversation
e492e9c to
41ac0de
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e492e9cdf7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| (output / f"{module}.py").write_text(source, encoding="utf-8") | ||
|
|
||
|
|
||
| def main(argv: Sequence[str] | None = None) -> int: |
There was a problem hiding this comment.
Replace 3.10-only union syntax in CLI signature
The new signature main(argv: Sequence[str] | None = None) uses PEP 604 union syntax, which is a syntax error on Python 3.9, but this change also declares/supports Python 3.9 (requires-python = ">=3.9" and CI includes 3.9). On 3.9, importing pymini.cli fails before runtime, so the CLI and console entrypoint cannot start at all.
Useful? React with 👍 / 👎.
| modules.append(Path(path).stem) | ||
| for path in paths: | ||
| sources.append(path.read_text(encoding="utf-8")) | ||
| modules.append(path.stem) |
There was a problem hiding this comment.
Preserve unique module paths when deriving module names
Using path.stem as the module identifier collapses files that share a basename (for example multiple __init__.py files in different packages), which causes silent data loss: later files overwrite earlier ones in write_outputs, and minification/remapping can also drop modules due duplicate names. This is now reachable because directory recursion was added, so nested package layouts are mishandled.
Useful? React with 👍 / 👎.
41ac0de to
8fb25c3
Compare
Summary
pyminihas a stable public API, CLI entrypoint, and clearer metadataWhy
The repository had working minifier logic, but it still looked like a prototype: the main regression test was not asserting the real return shape, the CLI contract did not match its behavior, docs still referenced old naming, and package metadata did not reflect the actual Python/runtime requirements.
Validation
.venv/bin/python -m pytest.venv/bin/python -m build