Skip to content

vendor catch22 C sources via git submodule instead of copying - #38

Open
joshuabmoore wants to merge 9 commits into
mainfrom
josh-dev
Open

vendor catch22 C sources via git submodule instead of copying#38
joshuabmoore wants to merge 9 commits into
mainfrom
josh-dev

Conversation

@joshuabmoore

@joshuabmoore joshuabmoore commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

pycatch22 currently vendors the catch22 C source files directly, which means it can drift out of sync with upstream changes. This PR replaces that approach with a git submodule so pycatch22 stays synchronised with catch22.

To incorporate the C files from the catch22 submodule, the following changes were made:

Changes

  • Pinned catch22 as a submodule at v0.4.1 (.gitmodules added)
  • Moved the CPython wrapper (catch22_wrap.c) out of the old src/C/ into src/wrapper/, keeping it under pycatch22's own control
  • Removed src/C/, which held the old vendored C code
  • Updated setup.py to compile feature sources from src/catch22/C (excluding main) plus the wrapper, with include_dirs pointing at the submodule's C directory so bare #include "..." paths resolve
  • Updated MANIFEST.in to exclude src/catch22/.git so the submodule's gitlink file isn't packed into sdists (the existing graft already bundles the upstream C files, keeping sdists self-contained)
  • Updated .github/workflows/run_unit_tests.yaml to check out submodules recursively
  • Updated README.md to document local installation via git clone --recursive-submodules
  • Updated .github/workflows/run_unit_tests.yaml with python 3.12 and 3.13 platforms.
  • bump version number to v0.5.0

The new file structure at pycatch22/src is:

pycatch22/src/
├─ catch22 @ pinned version/ # submodule → upstream catch22
├─ pycatch22/ # contains catch22_all
├─ wrapper/ # CPython wrapper

Note that this is a structural change only; no changes to computation or output have been made. catch22_all produces identical results to before, only the C source layout and build process have changed. All existing unit tests pass under the new submodule-based structure.

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