I've just upgraded from pants 2.20 to 2.24 and it ...
# general
m
I've just upgraded from pants 2.20 to 2.24 and it looks like ruff has been changed to be an external-tool, we used to use the env generated by the
ruff
resolve for configuring the IDE to match the formatting that we get running
pants fmt
but it's not clear how to do that anymore. Does external-tool still create a resolve under-the-hood that we can reference? Or does anyone know where the external-tool binaries are stored?
w
I havne’t tested this with ruff yet - as I’m in the process of updating some repos to it, but are you able to
pants export
it?
m
The resolve still works -- it just seems like now we need to maintain both the resolve and the external-tool and keep the versions in sync
w
I feel like this has been asked before, about external tools - I thought there was a way to ensure consistency… Maybe somewhere back in the slack channel?
m
Looking through the docs -- I missed
--export-bin
-- It looks like maybe
pants export --export-bin=ruff
is doing what I want
w
I thought just doing
pants export ::
would push everything available into dist/ - but yeah, a subset might be nicer for IDE integration
m
Not sure if new, but running without flags gives this: ExportError: Must specify at least one
--resolve
or
--bin
to export
w
Oh… I must be living in the past
h
An external tool is downloaded as a binary , so there is no underlying virtualenv or lockfile
Ruff, because it is used with Python, allows itself to also be installed via
pip
, as a distribution. But fundamentally it’s just a native binary
So AFAIK downloading as an external tool bypasses its thin python wrapping
And therefore I’m mildly surprised that
--export-bin
works…
But hey
m
It looks like export-bin doesn't create a resolve, it just sticks the ruff binary directly in the dist/export/bin/ruff
I think that aligns with what you're saying
w
@happy-kitchen-89482 I thought there was an update in the last few builds that made a lot more of the tooling exportable, because if we're already pulling down the tool - makes no sense to hide that from the user 🤷
h
Ah yes, we can now export binaries as binaries, unrelated to exporting venvs
I forgot about that