-
Notifications
You must be signed in to change notification settings - Fork 30
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
How do include LICENSE files? #114
Conversation
This partially reverts commit edab033.
Codecov Report
@@ Coverage Diff @@
## master #114 +/- ##
=======================================
Coverage 95.77% 95.77%
=======================================
Files 9 9
Lines 686 686
=======================================
Hits 657 657
Misses 29 29 Continue to review full report at Codecov.
|
Yeah, I just packaged up crossbar yesterday for Gentoo. I had to sed that data_files= line out of setup.py in order to properly install the code. It caused file collisions which halted the install process. We have packaging tools to take care of those files correctly. So they only need be included in the tarball, not attempt to install them into the main file system. |
so how do you suggest to distribute the LICENSE file? |
Usually just a MANIFEST.in entry suffices. That way it is included in the tarball produced by setup.py sdist. echo "include LICENSE" > MANIFEST.in Plus any other miscellaneous files such as README, CHANGELOG,... that you wish to distribute with your tarball. |
@dol-sen is correct that a MANIFEST.in entry is what you want. Since that already exists, this patch simple removes the data_files entry. |
right. so the LICENSE won't get into wheels or bdists. how do I make it that the LICENSE is also bundled in these distribution formats? |
A quick google search found me at this explanation which seems to fit best. quote: Neither package_data or data_files should be part of any "regular" project. They are ridiculously hard to get right. data_files behaves inconsistently across tools. I consider those anti-patterns in packaging [1]. Having a correct MANIFEST.in and include_package_data=True is most always the right choice./quote |
yeah, sucks. as the primary distribution channel of this project is pypi, not linux distros, we adjust to the quirks this comes with. until someone comes up with a better solution that also makes LICENSE part of wheels and bdists. |
looking through our different projects, this is indeed handled differently:
my main issue, as said, how do we preserve the inclusion of LICENSE (as similar) files also when publishing wheels and bdists inside those? how do we distribute the LICENSE text together with the software to the user when using the former package formats. I am willing to adjust all projects to "the right way" .. given there is one. @meejah what's your take? |
So from what I can see, It would also be nice to include the documentation -- as, e.g., the The only mention of licensing information in a bdist or wheel comes in the metadata which just says the kind of license (e.g. p.s. |
Okay so it turns out there's a workaround/undocumented feature specifically for license files. This can be included in
...and then the text of the license will be in the dist-info (and, it seems, the actual package as well). There's no way to do this for "other" files (e.g. README, docs etc) that I can find .. those can only go into source dists. |
...in any case, it seems that |
@meejah the setup.cfg trick via license_file sounds perfect! I guess that achieves both goals: ship the LICENSE file, and don't pollute the install target tree. awesome. =)
|
merged via #115 |
Thanks to @agronholm for pointing me to this in |
This partially reverts commit edab033.
Using data_files causes LICENSE to be installed in prefix which could clobber another file. Using only MANIFEST will include it in the tarball without this risk.