-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add support to allow or deny specific licenses of dependencies #3480
Comments
I like this idea, is there another tool which does this on top of poetry in the meantime? |
I would also like this feature a lot! GitHub has it's own implementation to check for licenses. One can extract the packages by running pip freeze. See here for further information. |
Protection against undesired licenses is a good idea, but I would still love to see Something like |
What would be the preferred way to implement this feature? As a plugin or as part of the core? Possible CLI extensions: |
bumping this as it would greatly benefit our use cases. listing licenses is a hard requirement for many customer projects these days, and it would be most helpful to have |
Coincidentally enough I also am hitting this: license listing is essential for OSS projects and it would be fantastic if the |
It's important with OSS as well as with businesses. I was thinking that maybe if you use AGPL you could be safe, but then there are also open source licenses (maybe not as popular) that are incompatible. I guess one might care less about licenses for some hobbyist project. |
Coming back to my request after almost three years. :) I would still personally like this functionality included to Poetry, and I see that there's some desire for this from the community. However, in Poetry's current era, I believe license reporting and auditing functionality might be a concern for a minority of poetry developers, so this functionality is probably best implemented as a Poetry plugin. According to the Poetry documentation, plugins should not modify core poetry commands in any way. Therefore I believe that such a plugin could work by placing its functionality within the Some possible commands for such a plugin are below, keeping with the option pattern that exists in current poetry commands:
|
@Erik-vdg I think that's a great summary. What does "in a hierarchical manner" mean in this instance? And what's the difference between "with" and "only"? |
Absolutely, I completely agree with this idea. As the adoption of open-source development continues to grow, ensuring compliance with licensing requirements becomes increasingly important. While this feature may cater to few devs initially, I believe its relevance will only expand over time as more organizations embrace open-source software. Looking forward to seeing how this evolves! |
@Erik-vdg , any plans to start developing it? Or any tools that can be used in the meantime? |
Actually, it turns out that python-license-check can be used with
Output:
|
Awesome, thanks for the find @lukasz-eond! I'll mark this request as closed then. |
Unfortunately, liccheck appears to be broken on Poetry dependency groups: https://python-poetry.org/docs/managing-dependencies/ It appears liccheck only looks for the old notation for extra dependencies: https://github.com/dhatim/python-license-check/blob/8b0cb0a4d4ab62180f82ed2f007930480fa6cf99/liccheck/command_line.py#L478 Would it be possible to re-open this issue in light of this lack of support? I feel like adding a --licenses option into "poetry show" is the cleanest solution to keeping the tooling aligned. Thanks! EDIT: I have added an issue to liccheck to mirror this request for Poetry: dhatim/python-license-check#118 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature Request
At my work, there exist strict requirements on what Licenses our projects can use (a common example is software with a GPL license). I would really like it if Poetry could help me follow these requirements.
I know that there are existing tools that can assist with this, such as python-license-check, and we can set that up in our CI environment to enforce our requirements. However as a more developer-friendly approach, I would like it if Poetry checked License requirements for me when adding a new package, so that I get very early feedback if a package would not be allowed.
I would like to define my license rules in pyproject.toml. Here is an example of potential configuration options to communicate the intent:
With this configuration, I would like it if when I ran the command
poetry add package-with-gpl-license
to not install the dependency and return a helpful error message.Similarly, I would like it if my pyproject.toml did have
package-with-gpl-license
listed as a dependency, that thepoetry check
command would return an error with a helpful message.I recognize that this may be a niche use case for many Poetry users, so if this is more appropriate as a plugin in the future as mentioned in #1237 please let me know! Thanks in advance 😄
The text was updated successfully, but these errors were encountered: