Only package the main source for PyPI #62
Merged
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.
This PR changes MANIFEST.in to exclude everything other than the main source of py-esp32-ulp, such as documentation and tests.
The approach used here is to exclude all files from the root (since the main source lives in esp32_ulp/) and also exclude all other directories by name. (i.e. include all, and then remove most things)
Semantically, I would have wanted to express the opposite: "exclude all, and only include esp32_ulp/". However, this also ended up excluding metadata files that setuptools put in the archive. I could include them again explicitly, but I think this could cause unexpected (hard-to-debug) behaviour in the future, if for example a future version of setuptools added more metadata files, or changed the name of this metadata file. It feels like something that could easily go by unnoticed.
In contrast, if a future change in py-esp32-ulp added a new directory of file, it would be quite noticeable (and understandable) if those files ended up in the package, because MAINFEST.in was not updated to specifically exclude them.
This is why I chose the approach I did.
Footnote
With the opposite approach, MANIFEST.in would have looked like this:
(notice having the specifically also include the PKG-INFO file)
Maybe there are other / cleaner ways of achieving the "only package esp32_ulp/*.py" intention?