-
Notifications
You must be signed in to change notification settings - Fork 251
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
Respect REUSE spec when including licenses #57
Conversation
* REUSE spec states that a LICENSES folder should exist with copies of all of the licenses used in this project. * Previously, poetry tried to include all files like LICENSE*, but this didn't respect directories, meaning that poetry would fail if a LICENSES folder existed. * Now poetry is a bit more specific about the "correct" license files to add * LICENSE or COPYING * LICENSE.* or COPYING.* * LICENSES/** * In addition, if a suggested licensing file doesn't exist, or isn't a file, poetry will simply ignore it.
As nothing more than a user who has been hit by python-poetry/poetry#2565, this looks like it would solve my issue which is currently preventing me from releasing. Also, indeed I can't see anywhere in the documentation that would need updating. |
license_files_to_add.append(self._path / base) | ||
license_files_to_add.extend(self._path.glob(base + ".*")) | ||
|
||
license_files_to_add.extend((self._path / "LICENSES").glob("**" + os.sep + "*")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license_files_to_add.extend((self._path / "LICENSES").glob("**" + os.sep + "*")) | |
license_files_to_add.extend(self._path.glob("LICENSES/**/*")) |
pathlib is smart enough to handle OS diferences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useful to know, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out that this isn't the case when using the .glob
method. I'm not sure why it isn't normalised, but you can see in this run when this change was added that the only failure was in the Windows builds.
I've reverted this change as a result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll check shortly but this might be related to https://bugs.python.org/issue31202
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it is. In this case; can you try this suggestion? This should also confirm that the issue is as identified above or if pathlib does not handle os diferences as advertised.
license_files_to_add.extend((self._path / "LICENSES").glob("**" + os.sep + "*")) | |
license_files_to_add.extend(self._path.joinpath("LICENSES").glob("**/*")) |
Co-authored-by: Arun Babu Neelicattu <[email protected]>
Co-authored-by: Arun Babu Neelicattu <[email protected]>
@abn - I worked through your suggestions, but they didn't all work out so successfully because of various weird reasons - most notably, the I replied to your comments inline - could you advise whether the new changes are sufficient, or whether I should make other changes? Thanks! |
Co-authored-by: Arun Babu Neelicattu <[email protected]>
The introduction of REUSE compatibility breaks the build of the wheel file. python-poetry/poetry-core#57 closed the issue on the poetry side, although `poetry-core` has not yet been updated. Nevertheless, I still do this change now, to have it available for future releases.
Debian Developer here, is there an option to disable this behavior? Distributions usually handle the location of the licensing information themselves, so it would be nice if this could be changed with an environment variable |
Resolves: python-poetry/poetry#2565
This is a copy of python-poetry/poetry#2573, which I will now close given that the relevant code has been moved to poetry-core.