Store license-files in licenses subfolder#4728
Store license-files in licenses subfolder#4728abravalheri merged 3 commits intopypa:feature/pep639from
Conversation
b35bf9e to
939f374
Compare
0bb22ba to
c47ade2
Compare
c47ade2 to
75b3169
Compare
setuptools/dist.py
Outdated
| self.metadata.license_files = list( | ||
| unique_everseen(self._expand_patterns(patterns)) | ||
| map( | ||
| lambda path: path.replace("\\", "/"), |
There was a problem hiding this comment.
Should we use os.sep here instead of \\ (e.g. if somehow \\ ends showing up on a linux build, we want the build to crash right, because it would mean incorrect input from the user)?
There was a problem hiding this comment.
I don't believe that's necessary here. path isn't a user input but rather the glob matched license path from self._expand_patterns. The idea with this line is just to normalize the separator since the core metadata field only allows forward /.
There was a problem hiding this comment.
How about valid paths in linux containing \? (e.g. mkdir 'hello\world' && touch 'hello\world/LICENSE.txt')... It is a bit of a problematic choice if the user decides to do that, but os.sep would be less error prone in that case, right?
There was a problem hiding this comment.
Not sure I've ever seen that in the wild but you're right it's a possibility. Pushed 3e9b9c7 to use os.sep instead.
1c02ce4 to
fe63c2f
Compare
|
Thank you! |
Summary of changes
The initial draft of PEP 639 specified that license files should be written directly to the
.dist-infofolder. This was changed in later iterations. The files should now be written to.dist-info/licensesand the root folder structure should be recreated to avoid name conflicts.Additional changes to be spec compliant:
license_filesspecifier, e.g.**/LICENSE.License-Filepath delimiter.Closes #3596
Refs #4629