Useless demo! ```chrisjrn@chrisjrns-MBP example-p...
# development
a
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
🎉
a
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
This is excellent. Pants getting out of the way and letting you compose your tools.
❤️ 1
a
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
Now, I wonder if we can reuse the
run
infra from other goals? Like, running a target as part of the
fmt
goal…
a
@proud-dentist-22844 Funny you should ask 🙂
p
Because several of my in-repo plugins serve to hook up in-repo scripts so that
fmt
/`lint` runs them.
a
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
Will you be blogging about this soon? I'd love to see more people discovering the powers this brings them.
a
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
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