curved-television-6568
09/20/2022, 5:49 PMcurved-television-6568
09/20/2022, 5:49 PMpython_requirements(
resolve=parametrize("a", "b"),
dependencies=parametrize(a=["foo"], b=["bar"])
)
curved-television-6568
09/20/2022, 5:51 PMcurved-television-6568
09/20/2022, 5:52 PMpython_requirements(
resolve="a",
dependencies=["foo"]
)
python_requirements(
resolve="b",
dependencies=["bar"]
)
hundreds-father-404
09/20/2022, 5:59 PMhundreds-father-404
09/20/2022, 5:59 PMcurved-television-6568
09/20/2022, 6:32 PM_generator_sources_helper
is great in theory it was hard in practice due to there not being a dependencies
field on python_requirements
and I don’t know of a better way to inject that dependency on all python_requirement
targets as __defaults__
does not apply to generated targets.curved-television-6568
09/20/2022, 6:32 PMoverrides
take wildcards?hundreds-father-404
09/20/2022, 6:32 PMnd I don’t know of a better way to inject that dependency on all python_requirement targets as defaults does not apply to generated targets.I thought it does?
hundreds-father-404
09/20/2022, 6:33 PMDoes overrides take wildcards?Depends on the specific target generator. For source-based ones, yes it does. For python_requirements, it does not
curved-television-6568
09/20/2022, 6:34 PMcurved-television-6568
09/20/2022, 6:34 PMhundreds-father-404
09/20/2022, 6:35 PMit was hard in practice due to there not being a dependencies field on python_requirementswe could possibly add it. the only reason it's not there is thinking
it doesn't make sense generally to add python_requirement deps, other than for undeclared 3rd-party deps, which seems to be more a per-requirement issue.it's only trying to be overly conservative so users don't add deps that they don't want. but probably it's fine here
hundreds-father-404
09/20/2022, 6:36 PMDoesn’t seem so.. https://www.pantsbuild.org/v2.14/docs/reference-python_requirementsi don't understand why this docs passage implies defaults won't work?
curved-television-6568
09/20/2022, 6:36 PMcurved-television-6568
09/20/2022, 6:36 PMcurved-television-6568
09/20/2022, 6:38 PMi don’t understand why this docs passage implies defaults won’t work?my bad, I misread your reply 😛 (I’ll double check the defaults behaviour on generated targets, going off of memory on that one)
curved-television-6568
09/20/2022, 6:43 PM> I don’t know of a better way to inject that dependency on all python_requirement targets as defaults does not apply to generated targets.
I thought it does?It doesn’t. It’s one of two irritating limitations of
__defaults__
, the other one being that you can’t provide a parametrization as a default field value.
https://www.pantsbuild.org/v2.14/docs/targets#field-default-valuescurved-television-6568
09/20/2022, 6:44 PMreturn
key on this keyboard, keep hitting it inadertently.. 😛curved-television-6568
09/20/2022, 6:44 PMhundreds-father-404
09/20/2022, 6:44 PMhundreds-father-404
09/20/2022, 6:46 PMdependencies
to python_requirements
target generator. then you could use defaults with python_requirements
for example, which is what the ticket talks aboutcurved-television-6568
09/20/2022, 6:46 PMcurved-television-6568
09/20/2022, 6:48 PMcurved-television-6568
09/20/2022, 6:49 PM