Skip to content

Commit ba025f0

Browse files
committed
Add uv support.
Fixes #72
1 parent 42cca23 commit ba025f0

4 files changed

Lines changed: 71 additions & 7 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ benchmark/data
2121
.pixi
2222
*.egg-info
2323

24+
# uv (lockfile intentionally not committed; pixi.lock is the reproducible env)
25+
uv.lock
26+
2427
# ProperDocs build output
2528
site/
2629
# Temporary files

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,22 @@ pip install crazyflow # CPU
5050
pip install "crazyflow[gpu]" # GPU (Linux x86-64, CUDA 12)
5151
```
5252

53-
Developer install with editable submodules ([pixi](https://pixi.sh/) required):
53+
Developer install with editable install ([pixi](https://pixi.sh/) recommended):
5454

5555
```bash
56-
git clone --recurse-submodules https://github.com/learnsyslab/crazyflow.git
56+
git clone https://github.com/learnsyslab/crazyflow.git
5757
cd crazyflow
5858
pixi shell
5959
```
6060

61+
Or with [uv](https://docs.astral.sh/uv/):
62+
63+
```bash
64+
git clone https://github.com/learnsyslab/crazyflow.git
65+
cd crazyflow
66+
uv sync # core + dev tooling (tests, docs, ruff)
67+
```
68+
6169
## Performance
6270

6371
First-principles dynamics, one drone. CPU: AMD Ryzen 9 7950X. GPU: NVIDIA RTX 4090.

docs/get-started/installation.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ Select your installation method from the tabs below, then read the notes under e
3030
pixi shell -e tests
3131
```
3232

33+
=== "uv"
34+
35+
```bash
36+
git clone https://github.com/learnsyslab/crazyflow.git
37+
cd crazyflow
38+
uv sync # core + dev tooling (tests, docs, ruff)
39+
uv run python -c "from crazyflow.sim import Sim; Sim().reset()"
40+
```
41+
3342
---
3443

3544
## GPU support
@@ -41,16 +50,33 @@ JAX defaults to CPU-only execution. The `gpu` extra swaps in `jax[cuda12]`, enab
4150

4251
## Developer install
4352

44-
[Pixi](https://pixi.sh/) creates a fully reproducible environment. This variant installs `crazyflow` in editable mode. Any source change takes effect immediately without reinstalling. Recommended for contributors and researchers who modify the simulator.
53+
[Pixi](https://pixi.sh/) creates a fully reproducible environment (locked via `pixi.lock`). This variant installs `crazyflow` in editable mode. Any source change takes effect immediately without reinstalling. Recommended for contributors and researchers who modify the simulator.
54+
55+
[uv](https://docs.astral.sh/uv/) is supported as an alternative. `uv sync` creates a `.venv` with `crazyflow` installed editable plus the `dev` dependency group (tests, docs, ruff). The dependency groups (`tests`, `docs`, `dist`, `dev`) mirror the pixi features and are defined under `[dependency-groups]` in `pyproject.toml`. The uv lockfile is not committed — `pixi.lock` remains the canonical reproducible environment.
56+
57+
```bash
58+
uv sync # core + dev group (default)
59+
uv sync --group docs # only the docs group + core
60+
uv sync --no-default-groups --extra gpu # core + GPU extra, no dev tooling
61+
```
4562

4663
## Testing
4764

4865
Adds `pytest` and `pytest-markdown-docs` for running the test suite and doc snippet tests.
4966

50-
```bash
51-
pixi run tests # unit and integration tests
52-
pixi run test-docs # doc code snippet tests
53-
```
67+
=== "pixi"
68+
69+
```bash
70+
pixi run tests # unit and integration tests
71+
pixi run test-docs # doc code snippet tests
72+
```
73+
74+
=== "uv"
75+
76+
```bash
77+
uv run pytest -v tests # unit and integration tests
78+
uv run pytest -v --markdown-docs --markdown-docs-syntax=superfences crazyflow/ docs/ --ignore=docs/gen_ref_pages.py
79+
```
5480

5581
## Verify the installation
5682

pyproject.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,33 @@ benchmark = ["fire", "matplotlib", "pandas", "pyinstrument"]
4343
Homepage = "https://github.com/learnsyslab/crazyflow"
4444
Repository = "https://github.com/learnsyslab/crazyflow"
4545

46+
# Dependency groups for uv-based developer workflows. These mirror the pixi features below
47+
# ([tool.pixi.feature.*]). `uv sync` installs the `dev` group by default. pixi ignores this table.
48+
[dependency-groups]
49+
tests = [
50+
"pytest>=8.4.1",
51+
"pytest-timeout>=2.1.0",
52+
"array-api-strict>=2.4.1",
53+
"matplotlib",
54+
"pytest-markdown-docs",
55+
]
56+
docs = [
57+
"properdocs>=1.5.0",
58+
"mkdocs-material>=9.0.0",
59+
"mkdocs-autorefs>=1.2.0",
60+
"mkdocstrings[python]>=0.26.0",
61+
"mkdocs-gen-files>=0.5.0",
62+
"mkdocs-literate-nav>=0.6.0",
63+
"mkdocs-section-index>=0.3.0",
64+
"mkdocs-charts-plugin>=0.0.10",
65+
]
66+
dist = ["build>=1.3", "twine>=6.0"]
67+
dev = [
68+
"ruff",
69+
{ include-group = "tests" },
70+
{ include-group = "docs" },
71+
]
72+
4673
[tool.setuptools.packages]
4774
find = {include = ["crazyflow*"]}
4875

0 commit comments

Comments
 (0)