Closed JohnHardy closed 1 year ago
@JohnHardy I think that is a very good question. Unfortunately, there is no easy way to exclude dev dependencies with this tool by itself.
Classically, many developers separate requirements.txt
and dev-requirements.txt
for environment management.
Some developers use the --without dev
option in modern package management tools like poetry to build their environments.
We are using PDM (that uses a pyproject.toml
file). There is a command I can use to export (excluding the dev deps) pdm export --production --pyproject
to the console etc.
Can pip-licenses work by taking input from the pipe or similar? :) Or can I say only include these packages / their direct deps?
Can pip-licenses work by taking input from the pipe or similar? :) Or can I say only include these packages / their direct deps?
No, pip-licenses retrieves package information via pip in environments such as venv. So currently it does not work with input from stdin.
Ah ok!
Could you explain to me how it works at the moment? Does it open the requirements.txt file
or look through the site packages or something?
Currently we are getting the working set of pkg_resources from pip's internal API.
There have been proposals to acquire this in other ways. See also #116
Thanks, appreciate the info and your great project :)
I am using pdm
at the moment, and since that seems to store things a bit differently, and because I don't know enough about how pip-licenses
or really anything about the python packaging system works, I implemented it here: https://github.com/pdm-project/pdm/pull/1433
Perhaps there is something that you can use? If I get chance, I'll take a look at #116
It's great that you as a user of PDM implement subcommands in PDM.
Supporting colorized text seems like quite a challenge.
The scope of this issue moved to adding functionality to the pdm-project.
Thanks! I'll still try to get these features into pip-licenses too, since we have projects outside the pdm
world.
Hello!
Love this tool!
Is there an easy way to exclude packages in the dev dependencies?
Thanks!