Apologies if I missed this in the docs, but any ti...
# general
h
Apologies if I missed this in the docs, but any tips on debugging python dependencies? My monorepo has several packages all using
pyproject.toml
files. When I run
pants test ::
, it ends up installing some problematic package that is normally never installed when using poetry or pip directly 👀
c
To make sure I've understood you correctly, when you use
pants test ::
then "badpackage" gets installed. Normally, though, something like
pip install mypackage
doesn't include "badpackage"?
✅ 1
h
yes
c
is "badpackage" a dependency of only some of your packages? I wonder if what's happening is that Pants is batching those runs together and installing common dependencies because they're listed in the same resolve
b
A good way to start would be narrowing down as small an example as possible, e.g.
pants test some_dir::
pants test some_dir/sub::
until you get to an individual file
pants test some_dir/sub/this_file_is_a_problem.py
and then you can start investigating with tools like
pants dependencies --transitive some_dir/sub/this_file_is_a_problem.py
to print out what pants is pulling in. (Although this won't include the transitive dependencies of PyPI requirements, so you might need to do some extra digging there.)
🤔 1
h
aha! I think I found the issue... a stray
requirements.txt
in an old
examples
folder 🤦
the
pants dependencies --transitive
was very helpful 🙂
🎉 1