Convert error for ../ in license paths into deprecation warning#4896
Convert error for ../ in license paths into deprecation warning#4896abravalheri wants to merge 0 commit intopypa:mainfrom
../ in license paths into deprecation warning#4896Conversation
|
Docs error |
cdce8p
left a comment
There was a problem hiding this comment.
The PR looks good! I was a bit concerned initially since the "old" code only worked because we just copied every license file into .dist-info. That's not really in the spirit of PEP 639 so I think this can only be a stop-gap measure.
From the issue it became clear that at least in the setuptools world it's more common than one would think to reverence files outside the project directory. Maybe setuptools should provide an option to map this to locations inside the project dir? That would also help with the sdist / wheel issue.
| files_found = set(wf.namelist()) | ||
| expected_files = { | ||
| "test_proj-42.dist-info/licenses/LICENSE.txt", | ||
| "test_proj-42.dist-info/licenses/NOTICE.txt", | ||
| } | ||
| assert expected_files <= files_found |
There was a problem hiding this comment.
Didn't know about the <= comparison for sets. Quite a neat trick 👍🏻
|
Thank you for the review!
That does not sound very trivial, so I will defer that to a later discussion 😅. |
|
Merged manually via git CLI. |
Summary of changes
I did some experiments, I think it manages to allow the inclusion of the files without breaking the
License-File:metadata for other tools (🤞)./cc @cdce8p @tiran
Closes #4892
Pull Request Checklist
newsfragments/.(See documentation for details)