Skip to content

Don't overwrite identical wrappers#82

Merged
kwabenantim merged 6 commits into
developfrom
74-incremental
Jun 25, 2026
Merged

Don't overwrite identical wrappers#82
kwabenantim merged 6 commits into
developfrom
74-incremental

Conversation

@kwabenantim

Copy link
Copy Markdown
Member

Supports #74

@kwabenantim kwabenantim linked an issue Jun 25, 2026 that may be closed by this pull request
@kwabenantim kwabenantim requested a review from Copilot June 25, 2026 18:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Implements incremental wrapper generation by avoiding rewrites when regenerated wrapper content is identical, reducing downstream rebuilds, and adds a CLI escape hatch to force rewrites when needed (supports #74). The PR also modernizes packaging/CI by moving project metadata into pyproject.toml, adding unit-test CI, and adjusting declared Python support.

Changes:

  • Add write_file_if_changed() and thread an overwrite flag through generator/writers; expose it via --overwrite.
  • Update wrapper writers to skip writing unchanged wrapper files by default (preserving mtimes).
  • Migrate packaging metadata from setup.cfg/setup.py to pyproject.toml, add unit tests + unit-test workflow, and update docs/CI configuration accordingly.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/test_utils.py Adds unit tests for “write only if changed” behavior and overwrite forcing.
setup.py Removes legacy setuptools entrypoint (packaging migrated to pyproject.toml).
setup.cfg Removes legacy package metadata/config (packaging migrated to pyproject.toml).
README.md Documents the new --overwrite behavior and incremental rewrite default.
pyproject.toml Adds PEP 621 project metadata / extras, updates build backend, and changes declared Python requirement.
examples/cells/pyproject.toml Updates example package’s declared Python requirement.
examples/cells/conda/variants/python3.9.yaml Removes Python 3.9 conda variant.
examples/cells/conda/variants/python3.8.yaml Removes Python 3.8 conda variant.
cppwg/writers/package_writer.py Threads overwrite setting from package writer into module writers.
cppwg/writers/module_writer.py Uses write_file_if_changed() for module wrapper output and propagates overwrite into class writer.
cppwg/writers/header_collection_writer.py Uses write_file_if_changed() for header collection output.
cppwg/writers/class_writer.py Uses write_file_if_changed() for per-class .hpp/.cpp outputs.
cppwg/utils/utils.py Introduces write_file_if_changed() helper used by writers.
cppwg/generators.py Adds overwrite option to generator and passes it through to writers.
cppwg/__main__.py Adds --overwrite CLI flag and forwards it to the generator.
.github/workflows/test-unit.yml Adds a unit-test workflow running pytest.
.github/workflows/test-style.yml Expands workflow triggers to run on develop pushes.
.github/workflows/test-shapes-pip.yml Expands workflow triggers to run on develop pushes.
.github/workflows/test-cells-ubuntu.yml Expands workflow triggers to run on develop pushes.
.github/workflows/test-cells-conda.yml Expands workflow triggers to run on develop pushes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_utils.py Outdated
Comment thread tests/test_utils.py Outdated
Comment thread pyproject.toml
@kwabenantim kwabenantim merged commit 944167e into develop Jun 25, 2026
13 checks passed
@kwabenantim kwabenantim deleted the 74-incremental branch June 25, 2026 18:37
@kwabenantim kwabenantim self-assigned this Jun 25, 2026
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.

Generate wrapper subset

3 participants