fast-nail-55400
07/22/2021, 1:55 AMfast-nail-55400
07/22/2021, 1:56 AMgo_external_module
targets based on the contents of a go.mod
filehundreds-father-404
07/22/2021, 2:05 AM./pants tailor
. Would that work?
We opted to not have dynamic target gen in Pants v2, going with the simpler codegen mechanism that only generates Sources
. It's plausible we may want it still, and generally we've been wanting to get rid of targets in some ways. but not yet implementedfast-nail-55400
07/22/2021, 2:12 AMgo.mod
file, than having to run ./pants tailor
each time go.mod
changes. the main issue would be go.mod
and the tailor-generated targets getting out of sync.fast-nail-55400
07/22/2021, 2:13 AMpython_requirements
do? it seems like it reads requirements.txt
and makes python_requirement_library
targets?hundreds-father-404
07/22/2021, 2:14 AMpoetry_requirements
The API is old and has some limitations, but it works until we have a more robust mechanism!fast-nail-55400
07/22/2021, 2:17 AMhundreds-father-404
07/22/2021, 2:17 AMfast-nail-55400
07/22/2021, 2:17 AMgo
tool via Process
fast-nail-55400
07/22/2021, 2:18 AMgo_module
target means linking with all the external modules in go.mod. But my preference is to have a way of dealing with external modules on an individual basis. hence the thought of go_external_module
.hundreds-father-404
07/22/2021, 2:18 AMrequirements.txt
is changed (if the file name is different than we expected)hundreds-father-404
07/22/2021, 2:18 AMpython_requirements
and poetry_requirements
would benefit from a new mechanismfast-nail-55400
07/22/2021, 2:19 AMgo_external_module
targets and we accept the violation of DRY principle in the short term.fast-nail-55400
07/22/2021, 2:20 AMfast-nail-55400
07/22/2021, 2:20 AMand generally we’ve been wanting to get rid of targets in some ways
hundreds-father-404
07/22/2021, 2:21 AMa short term solution could be to make depending on a go_module target means linking with all the external modules in go.mod. But my preference is to have a way of dealing with external modules on an individual basis.yeah, that feels pretty critical to Pants's whole "fine-grained dependencies" thing We've been realizing that dep inference is the crucial differentiator for Pants, and it's what allows for our benefits like caching and project introspection so, fine-grained 3rd party deps does seem important
hundreds-father-404
07/22/2021, 2:21 AMtargets as a concept probably map better to Go and JVM than they do for PythonEh, even w/ Go (and Terraform) it sounds like targets aren't a great fit. Namely, that it's important the target "own" the whole dir, not less and not more. And that there's only one target doing that
fast-nail-55400
07/22/2021, 2:22 AMfast-nail-55400
07/22/2021, 2:24 AMgo.mod
. No need to even require a BUILD file with a go_module
target in that case. It can just be inferred.hundreds-father-404
07/22/2021, 2:24 AMfast-nail-55400
07/22/2021, 2:25 AM