-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot exclude file in bdist #511
Comments
This is still the case for bdist and bdist_wheel. The files can be excluded from sdist by using MANIFEST.in, but they're packaged in the wheel anyway. |
I'm not sure it's the same functionality, but replacing |
I'm using prune, but it doesn't seem to work. Package in question is phply (https://github.com/viraptor/phply) |
Have you tried deleting the build directory? For me the changes to |
Even with |
I'm encountering the same problem, so it probably still exists. Maybe my explanation will ring a bell to somebody, or maybe we are doing something completely wrong which is not clearly documented. It seems like the problem is related with building the project, and limited to I created an example repo to demonstrate the problem here: https://github.com/maerteijn/manifestexample It has a I've tested this with python 2.7 and 3.6 with: Running
When running
The
Running
|
Being able to exclude |
@maerteijn I think it excludes the .txt because it not added per default anyways, see this. Pyhton modules, on the other hand, are always added per default. |
I've reclassed this issue as an enhancement, as it appears to be working as designed, although the design could be improved. I welcome continued work on the associated pull request or another. |
According to pypa/packaging.python.org#306 the MANIFEST.in is not used at all with |
To clarify, the It may be unwise to expect MANIFEST (and its template) to affect the build/install commands; perhaps these commands should instead have their own mechanism to determine specific file exclusion or inclusion. Or, thinking about it from a different perspective, perhaps a build operation should only ever operate on a source distribution, such that if a file was excluded from the sources, it would also be excluded from the build. It's not obvious to me what the best solution is here. |
In a first thought that would feel pretty logic, but it isn't as sometimes you probably want other files to be included when you distribute a source or binary distribution. And it would drastically change the current behavior which is not really desirable I suppose. I think the core of the problem is that there is not one, clear way of specifying what should be included or excluded in source / binary distributions. For source distributions we have a For binary distributions we have a (hacky) way in the form of https://setuptools.readthedocs.io/en/latest/setuptools.html#using-find-packages And it does does not support excluding single files or non-python files at all. Which is something desired sometimes as why this issue exists. And to make the confusion complete, the build command is using the manifest file somehow, but it's hardcoded to ignore We can override the distutils method of selecting the package files (see for an example https://stackoverflow.com/questions/5974982/setup-py-exclude-some-python-files-from-bdist), but writing specific python code to package your python modules feels strange for something that should be supported by the build tools we already have. Related to this: I've seen this PR which at least gives us a way of excluding files as well, but then we are using the exclude patterns for packages also for single files, which would be a "band aid solution" and not really well thought of. Adding an option to specify a manifest file to the build command (and bdist / bidst_wheels commands) would be a simple solution for this I guess, so we all can use one mechanism for the inclusion and exclusion of files. |
Unfortunately, no reasonable way to remove them from wheels: pypa/setuptools#511
Unfortunately, no reasonable way to remove them from wheels: pypa/setuptools#511
Originally reported by: tomi77 (Bitbucket: tomi77, GitHub: tomi77)
MANIFEST.in
python setup.py sdist
excludes these files.python setup.py bdist
does not.More info: https://bitbucket.org/pypa/wheel/issues/99/cannot-exclude-directory#comment-25155235
The text was updated successfully, but these errors were encountered: