We have a Python repo that uses a `conda` environm...
# general
f
We have a Python repo that uses a
conda
environment. This means we have to add
python_requirement
entries for all third-party dependencies used by goals like
test
and
package
to our root
BUILD
file or
python_infer
throws
UnownedDependencyError
. I’d like to run
./pants dependencies
on our tests to check that Pants can infer all the third-party dependencies successfully. What is the best way to do this?
e
There is none that I'm aware of better than your process. We've had no conda user yet to my knowledge contribute in any significant way to Pants and none of the existing contributors have meaningful conda experience.
Perhaps you could dive in? We always welcome help and will guide.
f
Gotcha. I’ve chimed in on the GitHub discussion about
conda
. I can try to dig into
conda
integration when I find some time. In the meantime, is there a way to tell
./pants dependencies
to only run on tests and imported modules? I thought about adding
tags=["tests"]
to
python_sources
in test directories, but my understanding is that this will only check dependencies for ancillary Python files in those directories. Is it possible to pass
python_tests
as a target?
e
See
./pants help filter
You can always mix in
./pants --filter-xxx=yyy <goal>
🙌 1
f
Thanks, will do!
e
Maybe a lie, but the option exists. There is fuzziness in my head about when it applies / pre vs post.
But the big hammer is
./pants peek
and
jq
f
Looks like
--filter-target-type
does the trick.