fresh-cat-9082707/11/2022, 10:11 AM
./pants dependencies project::
commands? I was relying on
./pants peek project::
but this option was deprecated in
./pants dependencies project:: --dependencies-type=3rdparty
. 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-40407/11/2022, 1:12 PM
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
./pants export ::
fresh-cat-9082707/11/2022, 1:23 PM
— Pants should know this thanks to dependency inference). The
example gives me a list of requirements as per my
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
command happily (totally expected though) created the venv with those deps.
The use case is that the
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-5443407/11/2022, 4:13 PM