-
Notifications
You must be signed in to change notification settings - Fork 146
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
Include more than one license file or other arbitrary files in metadata #138
Comments
Original comment by Daniel Holth (Bitbucket: dholth, GitHub: dholth): Appending them into a single file is not an option? The main concern here is that an arbitrary file in .dist-info should not share the same filename as any of the machine readable metadata. If you decided to call your arbitrary file 'METADATA' then the resulting wheel would either overwrite your file or it would not work. |
Original comment by pombredanne NA (Bitbucket: pombredanne, GitHub: pombredanne): See schematics/schematics#420 (comment) on why appending them in a single file is not an (easy) option: for instance a license and authors file. |
Original comment by pombredanne NA (Bitbucket: pombredanne, GitHub: pombredanne): @dholth you wrote:
Could the workaround be simply to add these files after all .dist-info files have been generated and raise an exception if you tried to add a file that already exist in there with a clear error message? |
Original comment by pombredanne NA (Bitbucket: pombredanne, GitHub: pombredanne): @dholth Can you elaborate a bit by what you mean exactly by categories of files? |
Original comment by pombredanne NA (Bitbucket: pombredanne, GitHub: pombredanne): do you see these as sections in the |
Original comment by Daniel Holth (Bitbucket: dholth, GitHub: dholth): So the model of installation in wheel is that you have categories of files package-1.0.data/scripts/ and so on, with either purelib or platlib going in the root of the wheel If you added more categories like package-1.0.data/docs/ then that folder in the wheel archive would be copied onto a configurable In review, the archive contains a set of directory trees each containing a (We also have data_files which is copied to different places depending on Questions remain. Which paths? How do you configure them? How does a Tried to work this out in a PEP last year but it got stalled. |
Original comment by pombredanne NA (Bitbucket: pombredanne, GitHub: pombredanne): Daniel you wrote:
I am game. Do you have the start of some draft? |
Original comment by Daniel Holth (Bitbucket: dholth, GitHub: dholth): This section but removing any mention of "a new version of wheel" from the pep, rename pep to "fine grained installation of Python packages". https://www.python.org/dev/peps/pep-0491/#install-paths |
Original comment by Daniel Holth (Bitbucket: dholth, GitHub: dholth): @pombredanne please take a look at https://bitbucket.org/dholth/python-install-paths/src/tip/pep-0491.txt We have a pull request with most of an implementation of the same for wheel, and probably in /dholth/wheel I have an alternative implementation of a very similar proposal. |
The current plan would seem to be to concatenate all the license related files to .dist-info/LICENSE.txt. With upcoming packaging standards a better solution might emerge. Any objections? |
@agronholm Thank you for keeping this alive! |
It's been misused + doesn't support multiple files (pypa/wheel#138)
It's been misused + doesn't support multiple files (pypa/wheel#138)
Another case where multiple license files would be useful is for packages with multiple licenses :-). For example, pyca/cryptography and trio are like this. Also any package that includes other vendored packages, like pip or requests. I understand the concern about cluttering up the .dist-info directory with random files, but... filesystems are hierarchical, and namespaces are one honking great idea :-). Could we let users specify arbitrary files and then put them all in .dist-info/license/? |
@njsmith I am all for this. In the end wheels are today in a weird spot where they do not make it easy to create things that comply with licensing even though a corresponding sdist may be fine. |
The question is, how to implement this? I'd rather not allow users to clutter the |
I'm leaning towards including |
Here are some more thoughts:
|
|
...and people do still occasionally use the UK spelling ( |
So it sounds like |
I don't think explicit glob support is necessary – if people want to use a glob and a non-default naming scheme, they can write
Since such an overwhelming proportion of wheels are currently violating licenses by not having this configured correctly, I think it would be good if the default were fairly inclusive. Maybe: any files matching any of the globs ["LICENSE*", "LICENCE*", "COPYING*", "NOTICE*"]? (Of course you'd default would be ignored if an explicit (Is there anything missing from my list there? E.g. do any popular licenses mandate including AUTHORS to achieve compliance?) |
Sounds good. Of course the reason why I'm talking about explicitly supporting globbing is because these days I enter all my metadata in I will also deprecate |
I guess supporting globs for setup.cfg is harmless enough if that's something you care about. But I don't see the point myself. |
You may be interested to chime in on this license-related PEP draft discussion https://discuss.python.org/t/improving-license-clarity-with-better-package-metadata |
Originally reported by: pombredanne NA (Bitbucket: pombredanne, GitHub: pombredanne)
With #47 it is now possible to get a SINGLE license file included in a built wheel by using setup.cfg
This is however a severe limitation: this works for very simple licenses... but even for common license such as the Apache-2.0, you cannot include both the license file and the NOTICE file.
Beyond this, there could be other metafiles you want to include in a built wheel.
If they are not package-data, you could use data_files, but they will be installed in some generally unpleasant location.
We should generalize the notion of license-file to include more than one and include arbitrary files defined in a setup.cfg as metafiles.
The text was updated successfully, but these errors were encountered: