Skip to content

Commit be2d191

Browse files
Switch AGENTS.md install/test/docs commands to uv
Per the review discussion, uv simplifies setup to a single sync command and keeps the environment isolated in the repo; update install, test, and docs commands accordingly. Also note that new Python code should carry type annotations, per feedback on the PR. Co-authored-by: Matteo Visconti di Oleggio Castello <6150554+mvdoc@users.noreply.github.com>
1 parent 6a8c424 commit be2d191

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

AGENTS.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,31 @@ Pycortex visualizes fMRI and other volumetric neuroimaging data on cortical surf
1111
The package has two Cython extensions (`cortex/formats.pyx` for surface mesh I/O, `cortex/openctm.pyx` wrapping the vendored `OpenCTM-1.0.3/` C library), so `import cortex` fails from a source checkout until they are built:
1212

1313
```bash
14-
pip install -U setuptools wheel numpy cython
15-
pip install -e '.[headless]' --no-build-isolation # headless extra = playwright, for WebGL tests
16-
pip install -e . --no-build-isolation --group dev # test + type-checking dependencies
17-
playwright install --only-shell chromium # browser for headless WebGL tests
14+
uv sync --all-extras # headless extra (playwright) + dev group (test/type-checking deps) by default; builds the Cython extensions
15+
uv run playwright install --only-shell chromium # browser for headless WebGL tests
1816
```
1917

20-
Versioning is by `setuptools-scm` from git tags (written to `cortex/_version.py`); never edit version files by hand. A new git worktree does not have the compiled extensions — rebuild, or copy `cortex/*.so` from an existing build.
18+
Versioning is by `setuptools-scm` from git tags (written to `cortex/_version.py`); never edit version files by hand. A new git worktree gets its own `.venv` — rerun `uv sync` there to (re)build the compiled extensions.
2119

2220
### Tests
2321

2422
```bash
25-
pytest # full suite (pytest.ini: testpaths=cortex, coverage on)
26-
pytest cortex/tests/test_quickflat.py # one file
27-
pytest cortex/tests/test_quickflat.py::test_make_figure # one test
28-
pytest -p no:cacheprovider --no-cov -x cortex/tests/test_formats.py # quick iteration without coverage
23+
uv run pytest # full suite (pytest.ini: testpaths=cortex, coverage on)
24+
uv run pytest cortex/tests/test_quickflat.py # one file
25+
uv run pytest cortex/tests/test_quickflat.py::test_make_figure # one test
26+
uv run pytest -p no:cacheprovider --no-cov -x cortex/tests/test_formats.py # quick iteration without coverage
2927
```
3028

3129
- `pytest.ini` sets a 240 s per-test timeout (via `pytest-timeout`) because headless browser sessions can hang; override per-test with `@pytest.mark.timeout(N)`.
3230
- Tests self-skip based on available tools: Inkscape (quickflat/dataset overlay tests), Playwright Chromium (`cortex/tests/testing_utils.py:has_playwright` — WebGL headless tests), and FreeSurfer's `mri_surf2surf`.
3331
- Nearly all tests use the stub subject `S1` bundled in `filestore/db/S1` (transform `fullhead`, 304380 vertices, volume shape `(31, 100, 100)`).
34-
- CI (`.github/workflows/run_tests.yml`) runs `pytest --cov=./` on a matrix of Python versions, with Inkscape and Playwright Chromium installed. The only enforced lint is codespell (config in `pyproject.toml`). mypy is configured in `pyproject.toml` and installed with the dev group but not run in CI.
32+
- CI (`.github/workflows/run_tests.yml`) runs `pytest --cov=./` on a matrix of Python versions, with Inkscape and Playwright Chromium installed. The only enforced lint is codespell (config in `pyproject.toml`). mypy is configured in `pyproject.toml` and installed with the dev group but not run in CI — new Python code should still carry type annotations.
3533

3634
### Docs
3735

3836
```bash
39-
pip install sphinx_gallery numpydoc
40-
cd docs && make html # gallery examples need Inkscape and Playwright too
37+
uv pip install sphinx_gallery numpydoc # not (yet) a dependency group
38+
cd docs && uv run make html # gallery examples need Inkscape and Playwright too
4139
```
4240

4341
## Architecture

0 commit comments

Comments
 (0)