Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use uv consistently throughout the documentation #15302

Merged
merged 5 commits into from
Jan 7, 2025
Merged

Conversation

charliermarsh
Copy link
Member

Summary

Closes #15301 (comment).

@charliermarsh charliermarsh added the documentation Improvements or additions to documentation label Jan 6, 2025
docs/faq.md Outdated
$ uv add --dev ruff # to add ruff to your project
$ uv tool install ruff # to install ruff globally
uv tool install ruff # Install Ruff globally.
uv add --dev ruff # Or add Ruff to your project.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm tempted to remove this line.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be grouping into two separate installation concepts: Installing Ruff globally and adding Ruff to your project?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. It seems like a lot to try and introduce the concept of "projects" here. Are you suggesting that we'd have uv tool and pipx vs. uv add and pip?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's the thought.

I don't know if we need to go into details, just "project" and "globally" 🤷‍♀️

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with an incremental improvement — just a thought on the grouping of the concepts instead of by tool.

@charliermarsh charliermarsh force-pushed the charlie/u branch 3 times, most recently from da70fa4 to 00ee16e Compare January 6, 2025 15:35
README.md Outdated Show resolved Hide resolved
@@ -1,9 +1,16 @@
# Installing Ruff

Ruff is available as [`ruff`](https://pypi.org/project/ruff/) on PyPI:
Ruff is available as [`ruff`](https://pypi.org/project/ruff/) on PyPI. We recommend installing Ruff with [uv](https://docs.astral.sh/uv/):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also include instructions for installing uv, but it feels like that shouldn't live here.


```console
$ # With uv.
$ uv tool install ruff
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it our recommended setup to install ruff globally vs as a project dependency? Having Ruff pinned seems like a big advantage to me and suggesting to install it globally feels like we're misguiding users to struggle with random CI failures etc. in the future

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could recommend both which is to either install it globally or add it as a project dependency with a specific version. Rooster should take care of updating the versions in the documentation (

ruff/pyproject.toml

Lines 106 to 114 in d45c1ee

version_files = [
"README.md",
"docs/integrations.md",
"docs/tutorial.md",
"crates/ruff/Cargo.toml",
"crates/ruff_linter/Cargo.toml",
"crates/ruff_wasm/Cargo.toml",
"scripts/benchmarks/pyproject.toml",
]
).

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
docs/faq.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved

```console
$ # With uv.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should only use a leading $ in the documentation if we add the copy/paste fix javascript from uv.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay thanks. We already use this in a few places, I think. I'll figure out what to do!

@charliermarsh charliermarsh requested a review from zanieb January 7, 2025 02:13
@charliermarsh charliermarsh force-pushed the charlie/u branch 3 times, most recently from 95b4079 to af2a899 Compare January 7, 2025 02:31
@charliermarsh charliermarsh enabled auto-merge (squash) January 7, 2025 14:42
@charliermarsh charliermarsh merged commit 5567e7c into main Jan 7, 2025
20 checks passed
@charliermarsh charliermarsh deleted the charlie/u branch January 7, 2025 14:43
dcreager added a commit that referenced this pull request Jan 7, 2025
* main:
  Use uv consistently throughout the documentation (#15302)
  [red-knot] Eagerly normalize `type[]` types (#15272)
  [`pyupgrade`] Split `UP007` to two individual rules for `Union` and `Optional` (`UP007`, `UP045`) (#15313)
  [red-knot] Improve symbol-lookup tracing (#14907)
  [red-knot] improve type shrinking coverage in red-knot property tests (#15297)
  [`flake8-return`] Recognize functions returning `Never` as non-returning (`RET503`) (#15298)
  [`flake8-bugbear`] Implement `class-as-data-structure` (`B903`) (#9601)
  Avoid treating newline-separated sections as sub-sections (#15311)
  Remove call when removing final argument from `format` (#15309)
  Don't enforce `object-without-hash-method` in stubs (#15310)
  Don't special-case class instances in binary expression inference (#15161)
  Upgrade zizmor to the latest version in CI (#15300)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use uv consistently throughout the docs
4 participants