fresh-cat-90827
07/11/2022, 10:11 AM./pants dependencies project::
or ./pants peek project::
commands? I was relying on ./pants dependencies project:: --dependencies-type=3rdparty
but this option was deprecated in 2.9.0
. The help docs say that a more robust way of querying dependencies should be available in the later versions, but I struggle to find any.hundreds-father-404
07/11/2022, 1:12 PM./pants export ::
to create a virtualenv instead. But if you just want the strings, the script in https://www.pantsbuild.org/v2.10/docs/python-third-party-dependencies#manual-lockfile-generation-techniques has a snippet using peek
+ jq
fresh-cat-90827
07/11/2022, 1:23 PMprojectA
depends on numpy
and pandas
— Pants should know this thanks to dependency inference). The peek
+ jq
example gives me a list of requirements as per my requirements.txt
file, not the actual dependencies of the projects. E.g. I’ve just added a few random PyPI packages (that no project is using) to the requirements.txt
and the export
command happily (totally expected though) created the venv with those deps.
The use case is that the requirements.txt
may contain arbitrary packages and I would like to make sure that all of them are actually being used in the projects. This is to find requirements that are present but are not used by code (some project depended on the package, but then code is refactored/removed and not this package is no longer required).enough-analyst-54434
07/11/2022, 4:13 PM