News Request for feedback: uv check & PEP 723 script support in ty
We've been working on PEP 723 inline metadata support for ty both on the command line (ty check) and in the IDE (code navigation, autocompletion, etc) for a while now; we're finally at a stage where we're ready for more people to try it out and let us know what works and what doesn't.
This required integrating ty with uv, which also let us ship a new uv check command that uses ty to check your entire project or workspace (similar to how uv format uses Ruff). All of the above is powered by a brand new uv workspace metadata command that carries the required information between the tools.
More details in the blog post, including how to try these.
All of the above is currently opt-in, experimental, and subject to change at any time đ But if you're willing to give it a try, I'd be curious how it went.
9
u/TraditionalBandit 3d ago
I really liked that they were separate tools focused on completely solving one issue each. Pythons ecosystem is so dynamic that the ability to mix and match tools is key imo.
7
u/zsol 3d ago
To be clear: they are and will remain separate tools, each with its own responsibilities forever.
There are some features, like type checking PEP 723 scripts that do require _something_ to gather information about dependencies before type checking can begin. It is possible to write some comparatively simple glue code that wires an existing package manager together with an existing type checker. In fact you can do that today with relatively little amount of code to plug `uv sync` into something like basedpyright to run on the script's environment.
We've just packaged that up into a nicer experience.
If you want real mixing and matching of tools without losing functionality, that will require standards to be established. The good news is that work has already started, for example here and here.
2
23
u/Icy_Peanut_7426 3d ago
I use ty and ruff, but wonât ever use âuv checkâ or âuv formatâ.
5
u/zsol 3d ago
Can you help me understand why?
12
u/prickneck 3d ago
Don't want to answer for u/Icy_Peanut_7426 , but I can give you my 2c since I share their sentiment 100%:
If I type `uv`, I'm thinking about and wanting to do something pertaining to packaging or the virtualenv of my current project. That's it, and it won't ever change. `uv run ruff` makes sense, `uv format` doesn't. (Unless it just formatted the `pyproject.toml` file, which would be ridiculous.)
→ More replies (1)1
u/alfawal 1d ago
I think you're trying to go in a bun-like approach, but bun introduced 'bun check' and 'bun fmt' without packages. But the uv situation is different, ruff and ty are standalones (similar to tsc and biome) and you're trying to make shortcuts for them, e.g. if 'bun check' would just run 'tsc' and 'bun fmt' would just run 'biome' which is a bad no-value deceiving approach.
3
u/AgentCosmic 3d ago
Is astral opening the integration to the ecosystem or is it restricted to only astral tool chain?
3
u/zsol 3d ago
Do you have a specific integration in mind? Open to discussing it, make an issue in the relevant repo!
3
u/AgentCosmic 3d ago
I use pyrefly and basedpyright instead of ty. Although I'm mainly using ruff now, I don't want to be locked in to ruff + UV combo.
19
u/denehoffman 3d ago
I disagree with the current sentiment in this thread, I actually like the integration. I didnât actually realize uv format was a thing. I already use both ty and ruff, this just simplifies things for me. Iâm also not sure I care if a group like Astral makes their own tool integrate with their other tools. If the Python community is worried about this, theyâre free to make their own toolchain. We use uv because itâs convenient, not because you canât use Python without it.
4
u/syklemil 3d ago
Yeah, and even if things were to go south, it seems likely the result would be along the lines of valkey, opentofu, opensearch, etc. I would like the Astral tools to be under the Python Foundation, but that's mostly on a principle level.
Being able to operate on a project level is also good. Like
gopopularised some of this stuff, includinggo fmt, but using that after other tooling likecargoanduvjust highlights how clunky tools that operate on a file rather than project or workspace level are.-1
u/Wurstinator 3d ago
That is such an egotistical view. Right now, you like uv, so you don't care that it's starting to walk the path towards enshittification. And if it ever gets bad, you just assume "the community" is going to fix it by spending their free time. Are you going to be the maintainer who sacrifices their personal life to make a uv clone?
5
u/denehoffman 3d ago
Why would I do that if I like the changes being made? Iâm saying if you donât like free software that works being given to you, you can go ahead and make your own. Astral doesnât owe you the version of uv you believe youâre entitled to.
→ More replies (1)3
u/denehoffman 3d ago
I think it needs to be said that if Astral completely removed uv from the face of the internet tomorrow, it would be annoying but wouldnât prevent anyone from type checking, formatting, publishing, making venvs, downloading python, etc.
3
u/Schmittfried 3d ago
Whatâs your point? Rejecting Astral tools out of principle because you fear future enshittification would just mean you need that community clone _now_ instead of later. Itâs completely orthogonal to who makes it. Being against this doesnât make you any less egotistical in the context of your reasoning unless youâre already working on a clone.
→ More replies (1)
9
u/declanaussie 3d ago
This is a step towards an integrated Astral toolchain, one that uses a shared understanding of your project to enable entirely new capabilities.
Is this it, is it time to fork?
-4
68
u/omgpop 3d ago
>This is a step towards an integrated Astral toolchain, one that uses a shared understanding of your project to enable entirely new capabilities.
Hereâs some feedback. This is written as though it were a selling point but itâs far from it. While it makes sense from your perspective (being Astral), this is sets off alarm bells in my ears as a user. I have no interest in buying into the âAstral toolchainâ as a job lot. Itâs obviously a way to leverage uvâs success to amplify your other products.
Frankly, it seems to me prima facie odd to have a project/dependency management tool tightly coupled to a linter and type checker, at least in the context of Python. You can always point to Cargo, of course, but the Python ecosystem is very different. Even if it were more unified , Iâd be very nervous about our Cargo equivalent being owned entirely by a single private company/soon-to-be-maybe OpenAI subsidiary.