Skip to content
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

Support poetry.lock #70

Open
mattyclarkson opened this issue Apr 14, 2021 · 6 comments
Open

Support poetry.lock #70

mattyclarkson opened this issue Apr 14, 2021 · 6 comments

Comments

@mattyclarkson
Copy link

poetry is a Python package manager that is gaining momentum as an alternative to pip.

It provides a concrete poetry.lock describing the resolved dependencies of a project.

Would it make sense to add a poetry.lock parsing module to this project to integrate smoothly with poetry projects?

It might be sensible to add the parse as on extra to the project that would be installed with liccheck[poetry]. Depends if we use the poetry project to read the lock file.

poetry does have the functionality to generate a requirements.txt so there is a work around possible.

@vegai
Copy link

vegai commented Apr 15, 2021

That would be excellent. poetry export helps some, but tends to sometimes (like with the current very recent 1.1.6 release) generate a requirements.txt that liccheck chokes on.

@vegai
Copy link

vegai commented Apr 15, 2021

I implemented a very rudimentary and ugly poetry.lock reader here: https://github.com/vegai/python-license-check/tree/poetry_lock_support -- the POC was pretty trivial.

If somebody wants to pick this up and implement it properly, feel free. If not, I'll probably be able to make it prettier and mergeable in a few days/weeks.

@vegai
Copy link

vegai commented Jun 22, 2021

So I probably knew when I was writing my last comment that it's a blatant lie. Anyway, perhaps some day it will happen that I get bored of exporting requirements.txt and rereading it here and then finish this.

@mdczaplicki
Copy link

Does exporting from poetry and consuming in liccheck works for you out of the box?

@thehale
Copy link
Contributor

thehale commented Dec 28, 2022

Does exporting from poetry and consuming in liccheck works for you out of the box?

Yes. The following command sequence works great for me in all my Poetry projects.
specifically Poetry versions v1.0.0+ (v1.3.1 is the latest at the time of writing)

poetry export > requirements.txt
poetry run liccheck
rm requirements.txt

@apirogov
Copy link

I'd like to run it in pre-commit with poetry, but this would require a custom pre-commit hook. So having this "workaround" implemented in the package would be nice! Possibly it should also not be specific to poetry, but rather allow giving a command that generates a requirements.txt (this would allow to also e.g. enable Pipfile.lock)

Also, maybe liccheck should just allow passing a requirements.txt file to stdin - then creating temporary files could be avoided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants