You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
Copy file name to clipboardExpand all lines: AGENTS.md
+10-12Lines changed: 10 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,33 +11,31 @@ Pycortex visualizes fMRI and other volumetric neuroimaging data on cortical surf
11
11
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:
12
12
13
13
```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
18
16
```
19
17
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.
21
19
22
20
### Tests
23
21
24
22
```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
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
29
27
```
30
28
31
29
-`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)`.
32
30
- 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`.
33
31
- 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.
35
33
36
34
### Docs
37
35
38
36
```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
0 commit comments