Should we expose internal (python) tools as targets? #17336
Replies: 3 comments 4 replies
-
Thoughts on what the address might look like? Some prefix like |
Beta Was this translation helpful? Give feedback.
-
Re the
specs don't really make sense for export in general (they may for some specific backend's export logic, but then they should be provided via option to that backend). Plugin options for subsytems makes this possible at last! |
Beta Was this translation helpful? Give feedback.
-
So anyway, exposing tools as targets may have benefits, but this is not how I want to solve the "export is currently dumb" problem. However, maybe instead of exposing tools as (synthetic) targets, we should allow (real) targets to be tools: Today a tool is a set of requirements and the lockfile generated from them, and those requirements are in pants.toml. Yet we also have mechanisms for generating a (user) lockfile from targets, so why not lean into that? It seems arbitrary that some requirements go in pants.toml and others go in BUILD files. If, instead, the way you customized tools was to point the logical name, e.g., So basically, this: #12449 This is how it worked in v1 by the way. |
Beta Was this translation helpful? Give feedback.
-
OK my last big request/idea for 2.15.x I promise (but also not really 😉)
Sometimes I find myself wanting to run a tool which Pants is currently wrapping.
black
orpytest
or similarI could of course declare a
pex_binary
and run that but it requires me ensuring the version and configuration is similar to that of Pants (boo double-config).One big reason for this that I find myself wanting is knowing what CLI args are possible (especially for pytest). There's no easy way invoke
pytest --help
and get all the CLI knobs/levers including third-party and first-party ones. A second reason is wanting to runpex lock ...
using the exact same version ofpex
Pants is (See other discussion)So what would it look like to have explicit/implicit targets for each tool? Then I could
run
them. ANDexport
wouldn't be exporting them by default if they had addresses 😉Thoughts? My bikeshed name was
interal_tool
or more specificallyinternal_python_tool
(to mirrorexternal_tool
from #17277)Beta Was this translation helpful? Give feedback.
All reactions