←back to thread

365 points tanelpoder | 6 comments | | HN request time: 0.001s | source | bottom
Show context
thanhhaimai ◴[] No.44978239[source]
I'd rather `ruff` being merged with `ty` instead. `uv` for me is about package / project manager. It's not about code style. The only time `uv` should edit a code file is to update its dependencies (PEP 723).

On the other hand, both `ruff` and `ty` are about code style. They both edit the code, either to format or fix typing / lint issues. They are good candidates to be merged.

replies(7): >>44978308 #>>44978351 #>>44978465 #>>44978499 #>>44978500 #>>44979712 #>>44981364 #
charliermarsh ◴[] No.44978500[source]
To clarify, `ruff` and `uv` aren't being merged. They remain separate tools. This is more about providing a simpler experience for users that don't want to think about their formatter as a separate tool.

The analogy would be to Cargo: `cargo fmt` just runs `rustfmt`, but you can also run `rustfmt` separately if you want.

replies(7): >>44978537 #>>44978539 #>>44979669 #>>44980254 #>>44980289 #>>44985044 #>>44985715 #
1. drdaeman ◴[] No.44978539[source]
Isn’t there `uv tool run ruff` already for this? Or `uv run ruff` if it’s a proper dependency? I’m not sure what’s the point of a special shortcut command, unless there are plans to make it flexible so it’ll be an abstraction over formatters (unifying ruff, black, etc).
replies(3): >>44978623 #>>44978660 #>>44979879 #
2. chippiewill ◴[] No.44978623[source]
It's part of the mission for uv to become "cargo for python". A one stop swiss-army knife for everything you need to manage a Python project. I think it'll get a `uv test` command at some point too.

The whole point is you just install `uv` and stop thinking about the pantheon of tools.

replies(1): >>44979156 #
3. charliermarsh ◴[] No.44978660[source]
Yeah, you can definitely use `uvx ruff` (an alias for `uv tool run ruff`) to invoke Ruff. That's what I've done in my own projects historically.

The goal here is to see if users like a more streamlined experience with an opinionated default, like you have in Rust or Go: install uv, use `uv init` to create a project, use `uv run` to run your code, `uv format` to format it, etc. Maybe they won't like it! TBD.

(Ruff is installed when you invoke `uv format`, rather than bundled with the uv binary, so if you never use `uv format`, there aren't any material downsides to the experiment.)

replies(2): >>44979989 #>>44983021 #
4. robertlagrant ◴[] No.44979156[source]
It'll be interesting to see how the test is done. At the tox level, or the pytest level? (Or another level?) I can see all being useful and ergonomic, but tox's multi-environment setup might fit into it really well.
5. divbzero ◴[] No.44979989[source]
> (Ruff is installed when you invoke `uv format`, rather than bundled with the uv binary, so if you never use `uv format`, there aren't any material downsides to the experiment.)

That’s thoughtful design and could be worth mentioning in the blog post.

6. RS-232 ◴[] No.44983021[source]
Would you ever consider bundling ruff binaries with uv releases similar to uvx and uvw? It would benefit offline users and keep compatible uv/ruff versions in sync.

Perhaps even better… cargo-like commands such as uv check, uv doc, and uv test could subsume ruff, ty, and other tools that we haven’t seen yet ;)

A pyup command that installs python-build-standalone, uv, python docs, etc. would be totally clutch, as would standalone installers [0] that bundle it all together.

[0] https://forge.rust-lang.org/infra/other-installation-methods...