Skip to content

[codex] Prepare pymini for ongoing maintenance#3

Merged
alvinwan merged 1 commit intomainfrom
dev/alvin/prepare-package-for-maintenance
Apr 4, 2026
Merged

[codex] Prepare pymini for ongoing maintenance#3
alvinwan merged 1 commit intomainfrom
dev/alvin/prepare-package-for-maintenance

Conversation

@alvinwan
Copy link
Copy Markdown
Owner

@alvinwan alvinwan commented Apr 4, 2026

Summary

  • clean up the package surface so pymini has a stable public API, CLI entrypoint, and clearer metadata
  • fix and expand the test suite so it validates real behavior, CLI flows, doctests, and packaging expectations
  • add CI and update docs to match the maintained package workflow

Why

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

@alvinwan alvinwan force-pushed the dev/alvin/prepare-package-for-maintenance branch from e492e9c to 41ac0de Compare April 4, 2026 08:16
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread pymini/cli.py Outdated
(output / f"{module}.py").write_text(source, encoding="utf-8")


def main(argv: Sequence[str] | None = None) -> int:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread pymini/cli.py Outdated
modules.append(Path(path).stem)
for path in paths:
sources.append(path.read_text(encoding="utf-8"))
modules.append(path.stem)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@alvinwan alvinwan force-pushed the dev/alvin/prepare-package-for-maintenance branch from 41ac0de to 8fb25c3 Compare April 4, 2026 08:22
@alvinwan alvinwan merged commit 15098e0 into main Apr 4, 2026
10 checks passed
@alvinwan alvinwan deleted the dev/alvin/prepare-package-for-maintenance branch April 4, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant