upvote
Bringing uv and ty together

(astral.sh)

I love Astral’s tools, but I wonder why the CLI feels so fragmented.

- Now, ty is integrated into uv, while ty is technically being part of ruff [1], but ruff is not integrated into uv.

- The formatter is part of ruff, but uv also have an undocumented "format" command, which does not produce the same results.

- Actually, ruff is integrated into uv, but you must call it through "uv tool run ruff".

I guess I'd like "uv format" and "uv lint" to become the standard commands.

[1] https://github.com/zed-extensions/pyrefly/issues/26#issuecom...

reply
I don't. Formatting and linting does not belong into a package manager.
reply
That's how Rust's Cargo and Elixir's Mix both work.
reply
I dislike the idea of these separate tools being blended like this. ty is currently perfectly usable on non-uv projects. uv has *a lot* of opinionated quirks, its custom lockfile lockfile, and other nuances which many of us dislike — ty being a separate tool works fine with plain pip plus any other dependency manager (e.g.: pip-tools).

Of note though, ty doesn't NEED to be integrated into uv, nor vice-versa; keeping them as standalone tools seems most natural.

reply
This shouldn't be surprising. Astral has wanted to create lock-in with uv for years and obviously they'll want to bring everyone into their "ecosystem" as much as possible. Stand by for more divergences from main python or use of their "market" capture for leverage over it.
reply
A implies B does not mean B implies A too. You can use ty separately, this isn't stopping that, but it is useful for uv check to use ty together.
reply
deleted
reply
Projects that use ty for its type checking but something else than uv for managing dependencies are probably in a very tiny minority of users.
reply
but there's probably lots of projects that use uv, but not ty.
reply
I'd imagine that, for a substantial percentage of these, part of it is to avoid negotiating and bargaining over an additional tool in your CI arsenal, especially in bigger corporate environments where these sort of conversations are dragged through layers of non-technical middle management.
reply
Ty isn't a compelling option. If you want support for dynamic libraries, mypy is king. If you want speed and strict conformance, Pyrefly and Zuban are better.

Ty's original pitch was that it would have strong inference and be useful for gradually typing existing, untyped codebases, but AI made that moot. Adding types to existing code is now trivial.

reply
Thank god it has opinionated quirks that old timers dislike.

Otherwise we'd still be stuck in the complete dumpster fire that was the python packaging/venv we had for the previous 20 years.

reply
Oh jeez, virtualenv... Python locates its libraries by using the relative path from the python executable. But rather than just extend PYTHONPATH like every other language does with its library path, they decide the solution is to require replicating the entire install structure of python instead. It certainly was a clever hack 20 years ago, but it's always and only ever been a hack.
reply
True, before UV the only way to package python was a container.
reply
Poetry?
reply
Yup, I ended up learning docker because Python packaging was such a dumpster fire.

I'll never forget the day I discovered that pip didn't do any dependency resolution. You had one job, and yet...

reply
Until uv, I used docker to run python projects locally. Got so fed up with venvs and versions and slowness and lack of wheels and spending so much time mucking around with it when cloning or updating a repo.

Uv hasn't fixed all issues, but made it far less painful.

reply
Old timer here: uv is not the first opinionated tool to manage Python packaging. It is build learning from other tools right and wrongs. I now use uv for everything because its quirks are less disruptive than quirks from previous tools that I also tried and disliked for being a bit too much for a very small gain.

What you call "dumpster fire", I call "steps towards uv", maybe even better tools in the future.

reply
I feel like pyrefly was gaining some traction over the year. I started using it this week.

This seems like astral realizing they lost the type checker race and now fold it into their popular project so people have a reason to use it.

If it is already installed with uv, people have less reason to look for a type checker and will just stay with the default option.

reply
Can you elaborate on losing the type checker race?

I am tasked with creating a new baseline for python projects. My first hunch was uv, ty, ruff as I've had a good time with them in the past.

What would you recommend?

reply
I agree, it sounds like they're trying to expand their moat because they realised they were too late to the better type-checking party.

It's somewhat ironic that they're only just getting around to it actually. The predecessor to `uv`, `rye`, had integration for `ruff` fairly early on - but Astral have really dragged their heels on putting it into `uv` (presumably because `ruff` had already won) and even now aren't adding support until after `ty` is integrated.

reply
Eh I think that’s a pretty uncharitable take.

They did the same thing with ruff too. A totally optional interface through the uv command. Use it or not.

reply
It seems like it would make more sense for ty to be integrated with ruff than uv.
reply
I imagine uv will subsume both
reply
[flagged]
reply
I really really love uv but this uv-ty post seems "shipping the org chart"?

They could have just said uv now has type chancing capabilities (or whatever it is ..) ty afaik isn't a super popular brand so the post makes people first understand what ty is ..

reply
Ah, this is great! It's a step towards solving my biggest complaint with PEP 723 scripts: bad editor support.

I loved the idea on paper, but without manually creating a matching venv & installing my deps, I wouldn't get in-editor completions during development. That was fine for small things, but intolerable as the script grew. So it's still not a feature I've used much, since it made more sense to just make a real dev environment.

I'm glad to see there'll be improvements here!

reply
It's cool to see ty support for scripts. That's something I really needed, and I even developed an extension to solve it: https://github.com/karpetrosyan/uv-vscode
reply
This is what’s up! Having worked on several medium sized python projects where linting and type checking were introduced late in the game, having them as a first class feature of the package manager will save so much unnecessary pain.

IMO, part of the problem is that people just don’t know that linters or tools like this exist at all. This is the best type of product marketing where the product gets meaningfully better, while educating the users for free.

reply
I fundamentally appreciate the single tool toolchain but ty‘s hesitant support of Django(’s quirks) preempts the advantages for me.
reply
it seems like they've also solved the inline metadata dependencies syncing in scripts finally. so if you declare script dependencies you'll no longer see module not found errors from that
reply
I'm really glad that unlike most other recent acquisitions, OpenAI's acquisition of Astral had seemingly no negative impact on their products
reply
It’s barely been 6 months. Give it time.
reply
deleted
reply
Don't worry, they'll find a way to enshittify the product at one point. uv went from being a VC-funded tool written in another language (i.e., with a limited contributor pool) to being an AI bubble-funded tool, so it's not something I'd trust would be maintained for a long time.
reply
…yet. I’m definitely concerned for the future. Especially because uv is so good. The rug pull is going to hurt a lot.
reply
One step closer to bringing the Rust experience to Python. Good.
reply
This isn't the Rust experience. Rust still distributes clippy as completely separate from cargo, and rustfmt as separate too, etc. it's technically only rustup that centralizes the distribution of the tools together.
reply
Nevertheless, since rustup is most folks entry point to the rust ecosystem, they are effectively distributed together, and rustfmt is fully integrated in cargo.
reply
[flagged]
reply
[dead]
reply
[flagged]
reply