From b8ee72b33e41cda018250a20cb6ab7046ce9b6cb Mon Sep 17 00:00:00 2001 From: mattcieslak Date: Wed, 18 Nov 2026 12:23:04 -0500 Subject: [PATCH 1/2] Install MITTENS from PyPI wheels instead of building it with Rust mittens-dmri 2.0.0a1 is on PyPI with prebuilt abi3 wheels for Linux, macOS and Windows, so MPAT no longer needs to pin it to GitHub and compile it with Rust and maturin. - Depend on mittens-dmri>=2.0.0a1; naming the pre-release lets pip pick it without --pre. - README and the install page drop the maturin/Rust step and point at rokemlab/MPAT. - CI drops the Rust toolchain, cache and maturin steps. --- .github/workflows/docs.yml | 9 ++------- .github/workflows/test.yml | 6 +----- README.md | 6 +++--- docs/source/install.md | 12 +++++++----- pyproject.toml | 4 ++-- 5 files changed, 15 insertions(+), 22 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index cc8c8a6..7e04d77 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -24,13 +24,9 @@ jobs: python-version: "3.12" cache: pip - # MITTENS v2 (mittens-dmri) builds from GitHub with Rust - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - name: Install MPAT with the docs and test extras run: | - python -m pip install --upgrade pip maturin + python -m pip install --upgrade pip python -m pip install -e ".[docs,test]" # rendered animations and the phantom's chains are reused while the scripts and @@ -75,10 +71,9 @@ jobs: with: python-version: "3.12" cache: pip - - uses: dtolnay/rust-toolchain@stable - name: Install run: | - python -m pip install --upgrade pip maturin + python -m pip install --upgrade pip python -m pip install -e ".[docs]" - name: Check external links env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e28fd2e..1116417 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,13 +29,9 @@ jobs: python-version: ${{ matrix.python-version }} cache: pip - # MITTENS v2 (mittens-dmri) builds from GitHub with Rust - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - name: Install MPAT with the test extra run: | - python -m pip install --upgrade pip maturin + python -m pip install --upgrade pip python -m pip install -e ".[test]" - name: Run the tests diff --git a/README.md b/README.md index 2366632..770d364 100644 --- a/README.md +++ b/README.md @@ -28,11 +28,11 @@ mpat sub-01_dwi.nii.gz sub-01_dwi.bval sub-01_dwi.bvec sub-01_T1w.nii.gz out/ -- ## Install ```bash -pip install maturin # MITTENS v2 builds with Rust (https://rustup.rs) -pip install "mpat-tractography[viewer] @ git+" +pip install "mpat-tractography[viewer] @ git+https://github.com/rokemlab/MPAT.git" ``` -MITTENS v2 (`mittens-dmri`) is not on PyPI yet, so pip builds it from GitHub with your Rust toolchain. +MITTENS v2 (`mittens-dmri`) comes from PyPI as a prebuilt wheel for Linux, macOS and Windows, so no +compiler is needed. ## Options diff --git a/docs/source/install.md b/docs/source/install.md index 75e8377..bafa8d4 100644 --- a/docs/source/install.md +++ b/docs/source/install.md @@ -1,14 +1,16 @@ # Installation -MPAT needs Python 3.10 or newer. It depends on [MITTENS](https://github.com/mattcieslak/MITTENS) -v2 (`mittens-dmri`), which is not on PyPI yet, so pip builds it from GitHub. That build needs a -Rust toolchain ([rustup.rs](https://rustup.rs)) and `maturin`: +MPAT needs Python 3.10 or newer. Install it from GitHub: ```bash -pip install maturin -pip install "mpat-tractography[viewer] @ git+https://github.com/36000/MPAT.git" +pip install "mpat-tractography[viewer] @ git+https://github.com/rokemlab/MPAT.git" ``` +It depends on [MITTENS](https://github.com/mattcieslak/MITTENS) v2 (`mittens-dmri`), which pip +installs from PyPI as a prebuilt wheel for Linux (x86_64, aarch64), macOS (Intel, Apple Silicon) +and Windows, so no compiler is needed. On other platforms pip builds it from source, which needs a +Rust toolchain ([rustup.rs](https://rustup.rs)). + Extras: | extra | for | diff --git a/pyproject.toml b/pyproject.toml index f41a1d9..ed22e0e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,8 +12,8 @@ license = { text = "BSD-3-Clause" } dependencies = [ "numpy>=1.26", "scipy>=1.11", "nibabel>=5", "numba>=0.59", "dipy>=1.9", "scikit-image", "pyAFQ>=3.4", "trx-python", - # MITTENS v2 is not on PyPI yet (it builds with a Rust toolchain via maturin) - "mittens-dmri @ git+https://github.com/mattcieslak/MITTENS.git", + # MITTENS v2: prebuilt wheels on PyPI. Naming the pre-release lets pip pick it without --pre + "mittens-dmri>=2.0.0a1", ] [project.optional-dependencies] From aa82bad8c8de164e9b915b2984b02f7a13a3f28a Mon Sep 17 00:00:00 2001 From: mattcieslak Date: Thu, 19 Nov 2026 09:46:16 -0500 Subject: [PATCH 2/2] Fix the docs link check - usage.md: pyAFQ moved its API pages; link ParticipantAFQ's new page. - conf.py: skip DOIs from AGU (10.1029) and SIAM (10.1137) in the link check. Those publishers answer automated requests with 403 Forbidden, though the DOIs resolve. --- docs/source/conf.py | 7 ++++++- docs/source/usage.md | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index bc5e556..ffaf3fc 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -91,7 +91,12 @@ html_sidebars = {"**": []} # navigation lives in the header; pages use the full width html_show_sourcelink = False -linkcheck_ignore = [r"https://github\.com/rokemlab/MPAT.*"] +linkcheck_ignore = [ + r"https://github\.com/rokemlab/MPAT.*", + # AGU (Wiley) and SIAM answer automated requests with 403 Forbidden; their DOIs resolve + r"https://doi\.org/10\.1029/", + r"https://doi\.org/10\.1137/", +] # ------------------------------------------------------------------ build environment # the `mpat` console script lives next to the interpreter running Sphinx (virtualenvs) diff --git a/docs/source/usage.md b/docs/source/usage.md index ec51846..a9aa8cf 100644 --- a/docs/source/usage.md +++ b/docs/source/usage.md @@ -3,7 +3,7 @@ ## From Python MPAT runs on top of a pyAFQ -[`ParticipantAFQ`](https://tractometry.org/pyAFQ/reference/api.html), or every participant of a +[`ParticipantAFQ`](https://tractometry.org/pyAFQ/reference/api/AFQ/api/participant/index.html#AFQ.api.participant.ParticipantAFQ), or every participant of a `GroupAFQ`. pyAFQ computes the derivatives MPAT needs: the fODF, the tissue PVE and brain mask, the white/grey-matter interface, and the bundle ROIs warped to the subject. MPAT then replaces the tracking and segmentation: