When pulling in a 3rd party requirement in a rule ...
# plugins
g
When pulling in a 3rd party requirement in a rule as a dependency how do I hydrate the full file sources? It seems if I pull in Sources for a 3rd party requirement I simply get back
requirements.txt
h
Hello! Could you please clarify what you mean with hydrating the full file sources? Do you mean downloading/building the wheel for that requirement via pip/Pex from PyPI?
g
yes, precisely
I've been banging my head reading through
pants.backend.python
and only just realized there's a
PythonSourceFilesRequest
which is what I'm assuming is what I should be using?
h
Not quite - instead, check out
pex_from_targets.py
. You can use that out of the box to get the behavior you want, e.g. hooking up to
[python-setup].requirement_constraints
for you
1