https://pantsbuild.org/ logo
#development
Title
# development
a

ancient-vegetable-10556

12/21/2022, 5:42 PM
Useless demo!
Copy code
chrisjrn@chrisjrns-MBP example-python % ./pants_from_sources run ":reqs#black" -- an_source.py
reformatted an_source.py

All done! ✨ 🍰 ✨
1 file reformatted.
chrisjrn@chrisjrns-MBP example-python %
🎉 3
😮 3
b

bitter-ability-32190

12/21/2022, 5:43 PM
🎉
a

ancient-vegetable-10556

12/21/2022, 5:46 PM
While I’m not sure that running
black
per se is useful, I am really excited about being able to open up Pants to using all manner of arbitrary Python tools without needing to write a plugin
🙌 2
e

enough-analyst-54434

12/21/2022, 5:48 PM
This is excellent. Pants getting out of the way and letting you compose your tools.
❤️ 1
a

ancient-vegetable-10556

12/21/2022, 5:51 PM
I landed similar support for running maven artefacts last week, so Pants can now do arbitrary antlr jobs, for instance, or compile OpenAPI specs (which you could, for instance, generate from a Flask app executed by a Python requirement)
p

proud-dentist-22844

12/21/2022, 6:18 PM
Now, I wonder if we can reuse the
run
infra from other goals? Like, running a target as part of the
fmt
goal…
a

ancient-vegetable-10556

12/21/2022, 6:19 PM
@proud-dentist-22844 Funny you should ask 🙂
p

proud-dentist-22844

12/21/2022, 6:19 PM
Because several of my in-repo plugins serve to hook up in-repo scripts so that
fmt
/`lint` runs them.
a

ancient-vegetable-10556

12/21/2022, 6:20 PM
Running as part of the
fmt
goal is extremely complicated, but
check
and
lint
would be trivially doable
👍 1
thanks to the
experimental_run_in_sandbox
rule I landed last week, you can use most
RunRequest
rules for their side-effects, e.g. for code generation
b

busy-vase-39202

12/21/2022, 9:36 PM
Will you be blogging about this soon? I'd love to see more people discovering the powers this brings them.
a

ancient-vegetable-10556

12/21/2022, 9:36 PM
as we enter the 2.16 release cycle, yeah
👍 1
I really don’t want to put a “hey, here’s this cool thing that you can’t use” out into the wild 🙂
b

bitter-ability-32190

12/22/2022, 8:23 PM
Something this really enables is trying to know what args a tool supports. E.g. I know I need to change something in my invocation of pytest, but it's hard to access the same pytest Pants is using for that