From 45a7051d4fbeaa32aeff0d072852473754f38dc5 Mon Sep 17 00:00:00 2001 From: Aditya Vaidya Date: Fri, 30 Oct 2026 23:12:36 -0700 Subject: [PATCH 1/2] MNT build with isolation so setuptools-scm sets the version Building with --no-build-isolation without setuptools-scm installed never generates cortex/_version.py, so cortex.__version__ silently fell back to a hardcoded '1.3.0.dev0'. That is why the published docs show 1.3.0.dev0. --no-build-isolation was added in #385 to work around the numpy 1.20 ABI break. Extensions built against numpy 2 run on numpy 1.x too, so it is no longer needed. Drop it (and the manual build-dependency pre-installs it required) from the CI workflows, README, and install docs, and let pip install build-system.requires from pyproject.toml. Also make the fallback version an obviously-wrong '0+unknown' instead of a real-looking version that goes stale. --- .github/workflows/build_docs.yml | 3 +-- .github/workflows/claude.yml | 4 +--- .github/workflows/run_tests.yml | 4 +--- README.md | 6 ++---- cortex/version.py | 6 ++++-- docs/install.rst | 4 +--- 6 files changed, 10 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 4edb3face..946a6be3d 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -42,11 +42,10 @@ jobs: sudo apt-get update sudo apt-get install -y inkscape --no-install-recommends pip install --upgrade pip - pip install wheel setuptools numpy cython # force using latest nibabel pip install -U nibabel pip install -q ipython Sphinx sphinx-gallery numpydoc # TODO: move to pyproject.toml - pip install -e . --no-build-isolation --group dev + pip install -e . --group dev python -c 'import cortex; print(cortex.__full_version__)' - name: Cache Playwright browsers diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 95b8bd9c8..56197e47b 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -79,9 +79,7 @@ jobs: sudo apt-get update sudo apt-get install -y inkscape --no-install-recommends pip install --upgrade pip - pip install wheel setuptools numpy cython - pip install -e '.[headless]' --no-build-isolation - pip install -e . --no-build-isolation --group dev + pip install -e '.[headless]' --group dev python -c 'import cortex; print(cortex.__full_version__)' # Combined with UV_NO_SYNC, this makes `uv run ` execute inside the # environment installed above rather than a throwaway project venv. diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 71eaaa3cc..db1e701d8 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -45,11 +45,9 @@ jobs: sudo apt-get update sudo apt-get install -y inkscape --no-install-recommends pip install --upgrade pip - pip install wheel setuptools numpy cython # force using latest nibabel pip install -U nibabel - pip install -e '.[headless]' --no-build-isolation - pip install -e . --no-build-isolation --group dev + pip install -e '.[headless]' --group dev python -c 'import cortex; print(cortex.__full_version__)' - name: Cache Playwright browsers diff --git a/README.md b/README.md index 10715bc2d..1ec21fb7a 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,6 @@ Installation To install the stable release version of pycortex, do the following: ```bash -# First, install some required dependencies (if not already installed) -pip install -U setuptools wheel numpy cython # Install the latest release of pycortex from pip pip install -U pycortex # or, with headless rendering support: @@ -31,11 +29,11 @@ pip install -U 'pycortex[all]' If you wish to install the development version of pycortex, you can install it directly from Github. -To do so, replace the second install line above with the following: +To do so, replace the first install line above with the following: ```bash # Install development version of pycortex from github -pip install -U git+https://github.com/gallantlab/pycortex.git --no-build-isolation +pip install -U git+https://github.com/gallantlab/pycortex.git ``` Note you will need a C compiler installed to build from scratch because there are cython code. diff --git a/cortex/version.py b/cortex/version.py index e52c4eac5..937a8aea8 100644 --- a/cortex/version.py +++ b/cortex/version.py @@ -7,8 +7,10 @@ from cortex._version import version as __version__ __full_version__ = __version__ except ImportError: - # Fallback for development environments without setuptools-scm - __version__ = '1.3.0.dev0' + # Build ran without setuptools-scm (e.g. --no-build-isolation without it + # installed), so _version.py was never generated. Use an obviously-wrong + # placeholder in this case. + __version__ = '0+unknown' __full_version__ = __version__ __hardcoded_version__ = __version__ diff --git a/docs/install.rst b/docs/install.rst index 96eee37d7..4eb6e991b 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -3,15 +3,13 @@ Installation To install the stable release version of pycortex, do the following:: - # First, install some required dependencies - pip install -U setuptools wheel numpy cython # Install the latest release of pycortex from pip pip install -U pycortex If you wish to install the development version of pycortex, you can install it directly from Github. -To do so, replace the second install line above with the following:: +To do so, replace the first install line above with the following:: # Install development version of pycortex from github pip install -U git+https://github.com/gallantlab/pycortex.git From 33f0a1a2619a44104344607e287f53bf04478470 Mon Sep 17 00:00:00 2001 From: Aditya Vaidya Date: Sun, 1 Nov 2026 00:48:38 -0700 Subject: [PATCH 2/2] MNT require setuptools>=66.1 to build (needed for Python 3.12+) The build isolation changes removed the instructions to upgrade setuptools, so now we need to accurately set the minimum. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 518ef2e43..ba26f4457 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [build-system] # Minimum requirements for the build system to execute, according to PEP518 # specification. -requires = ["setuptools>=64", "setuptools-scm>=8", "build", "numpy>=1.13.0", "cython", "wheel"] +requires = ["setuptools>=66.1", "setuptools-scm>=8", "build", "numpy>=1.13.0", "cython", "wheel"] build-backend = "setuptools.build_meta" [project]