Skip to content

Commit

Permalink
Use uv workspaces instead of pip
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Aug 2, 2024
1 parent 2e2b1b4 commit ef63ee8
Show file tree
Hide file tree
Showing 6 changed files with 692 additions and 21 deletions.
14 changes: 8 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,28 +294,30 @@ Finally, regenerate the documentation and generated code with `cargo dev generat

To preview any changes to the documentation locally:

1. Install the [Rust toolchain](https://www.rust-lang.org/tools/install).
1. Install the [Rust toolchain](https://www.rust-lang.org/tools/install).]

1. Install MkDocs and Material for MkDocs with:
1. Install [uv](https://docs.astral.sh/uv/installation/)

1. Install the dependencies

```shell
pip install -r docs/requirements.txt
uv sync
```

1. Generate the MkDocs site with:

```shell
python scripts/generate_mkdocs.py
uv run scripts/generate_mkdocs.py
```

1. Run the development server with:

```shell
# For contributors.
mkdocs serve -f mkdocs.public.yml
uv run -- mkdocs serve -f mkdocs.public.yml
# For members of the Astral org, which has access to MkDocs Insiders via sponsorship.
mkdocs serve -f mkdocs.insiders.yml
uv run --with-requirements docs/requirements-insiders.txt -- mkdocs serve -f mkdocs.insiders.yml
```

The documentation should then be available locally at
Expand Down
21 changes: 21 additions & 0 deletions docs/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[project]
name = "ruff-docs"
version = "0.0.0"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

dependencies = [
"PyYAML==6.0.1",
"mkdocs==1.5.0",
"mdformat==0.7.17",
"mdformat-mkdocs==2.0.4",
"mdformat-admon==2.0.2"
]

[tool.uv]
dev-dependencies = [
"mkdocs-material==9.1.18",
"mkdocs-redirects==1.2.1",
]
7 changes: 0 additions & 7 deletions docs/requirements-insiders.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
PyYAML==6.0.1
black==23.10.0
mkdocs==1.5.0
mkdocs-material @ git+ssh://git@github.com/astral-sh/mkdocs-material-insiders.git@38c0b8187325c3bab386b666daf3518ac036f2f4
mkdocs-redirects==1.2.1
mdformat==0.7.17
mdformat-mkdocs==2.0.4
mdformat-admon==2.0.2
8 changes: 0 additions & 8 deletions docs/requirements.txt

This file was deleted.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ Repository = "https://github.com/astral-sh/ruff"
Documentation = "https://docs.astral.sh/ruff/"
Changelog = "https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md"

[tool.uv.workspace]
members = ["docs", "python/ruff-ecosystem"]

[tool.maturin]
bindings = "bin"
manifest-path = "crates/ruff/Cargo.toml"
Expand Down
Loading

0 comments on commit ef63ee8

Please sign in to comment.