r/Python • u/zsol • Oct 20 '26
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.
10
u/TraditionalBandit Oct 21 '26
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 Oct 21 '26
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 Oct 21 '26
I use ty and ruff, but wonât ever use âuv checkâ or âuv formatâ.
5
u/zsol Oct 21 '26
Can you help me understand why?
13
u/prickneck Oct 21 '26
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.)
6
u/Dull-Visual2955 Oct 21 '26
I second this strongly. I think this captures something very well.
Now, does uv want to behave a bit more akin to something like pixi, where you have sort of aliased project commands? That could be interesting, but it seems best as opt-in functionality that you are explicit about in your toml.1
u/alfawal Oct 23 '26
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 Oct 21 '26
Is astral opening the integration to the ecosystem or is it restricted to only astral tool chain?
3
u/zsol Oct 21 '26
Do you have a specific integration in mind? Open to discussing it, make an issue in the relevant repo!
3
u/AgentCosmic Oct 21 '26
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.
20
u/denehoffman Oct 21 '26
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 Oct 21 '26
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 Oct 21 '26
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 Oct 21 '26
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.
-1
u/Wurstinator Oct 21 '26
Yeah that's another one of those really stupid sentences I keep reading everywhere. "Hurr durr they don't owe you anything". Yes they do. They're not a nice person that's doing you a favor, they're a company doing it for their own good. They profit from you and me and everyone else using their tools.
3
u/denehoffman Oct 21 '26
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 Oct 21 '26
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.
2
u/Wurstinator Oct 21 '26
Being against this doesnât make you any less egotistical in the context of your reasoning unless youâre already working on a clone.
That doesn't even make any sense. Giving feedback to Astral when they specifically asked for it, with the goal of keeping good tooling for everyone, is egotistical? Yeah ok.
10
u/declanaussie Oct 21 '26
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
0
Oct 21 '26
[removed] â view removed comment
1
u/zsol Oct 21 '26
Not at the moment, but it is coming soon. In the meanwhile you can `uv workspace list --scripts` and iterate yourself to do `uv check --script $foo`
75
u/omgpop Oct 20 '26
>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.