Skip to content

Fix sdist to include the C submodule and build files#53

Merged
DanielBok merged 2 commits into
DanielBok:masterfrom
charleysaintNV:fix-sdist-manifest
Jul 16, 2026
Merged

Fix sdist to include the C submodule and build files#53
DanielBok merged 2 commits into
DanielBok:masterfrom
charleysaintNV:fix-sdist-manifest

Conversation

@charleysaintNV

Copy link
Copy Markdown
Contributor

python setup.py sdist (and thus the published PyPI sdist) is unbuildable: it ships only setup.py + metadata, with none of the nlopt C sources, extensions.py, or the top-level CMakeLists.txt. pip install <sdist> then fails at:

CMake Error: The source directory "..." does not appear to contain
CMakeLists.txt

Root cause is MANIFEST.in:

  • recursive-include extern/nlopt has no file pattern, so setuptools silently includes none of the extern/nlopt submodule.
  • extensions.py (imported by setup.py) and the root CMakeLists.txt (passed to CMake by extensions.py) are not listed, so they are excluded as well.

Add the missing * pattern and explicitly include extensions.py, CMakeLists.txt, and setup.cfg. The resulting sdist (~2 MB) builds from source with SWIG + NumPy.

`python setup.py sdist` (and thus the published PyPI sdist) is unbuildable: it
ships only setup.py + metadata, with none of the nlopt C sources, extensions.py,
or the top-level CMakeLists.txt. `pip install <sdist>` then fails at:

    CMake Error: The source directory "..." does not appear to contain
    CMakeLists.txt

Root cause is MANIFEST.in:
- `recursive-include extern/nlopt` has no file pattern, so setuptools silently
  includes none of the extern/nlopt submodule.
- extensions.py (imported by setup.py) and the root CMakeLists.txt (passed to
  CMake by extensions.py) are not listed, so they are excluded as well.

Add the missing `*` pattern and explicitly include extensions.py, CMakeLists.txt,
and setup.cfg. The resulting sdist (~2 MB) builds from source with SWIG + NumPy.
@charleysaintNV

Copy link
Copy Markdown
Contributor Author

@DanielBok Please review

@DanielBok
DanielBok merged commit 827f4d6 into DanielBok:master Jul 16, 2026
36 checks passed
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.

2 participants