Ship C sources and version.mk in the python sdist - #255
Merged
Conversation
The sdist built from src/pymod only contained pacparser_py.c and pacparser/__init__.py, so building it from source failed: pacparser.h was missing for compilation, and pacparser.o/libquickjs.a for linking. The sdist command now copies pacparser.h, pacparser.c, pac_utils.h and the quickjs sources into the archive and writes a version.mk pinning the version (there is no git metadata in an sdist). When no prebuilt objects are present, setup.py compiles them from the shipped sources. This also fixes the version falling back to 1.0.0 when building the sdist, which produced mismatched wheel metadata.
make clean removes pacparser.o before running setup.py clean --all, which made the missing-objects check try to compile the sdist sources that do not exist in the source tree. Require the copied pacparser.c to be present before building the objects from source.
Only compile the C objects from source for commands that build the extension (build, build_ext, bdist, bdist_wheel, install), so that plain sdist/egg_info runs in the copied-sources layout do not require a C toolchain. clean --all now also removes pacparser.o and skips the copied-source removal under --dry-run.
|
This was referenced Aug 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fixes #254
The sdist built from src/pymod only contained pacparser_py.c and pacparser/init.py, so building it from source always failed:
Changes:
Verified: