Fix CI failure during SPEC install by disabling build isolation
CI workflows started failing around October 27, 2024 at the "Build SPEC python wrapper" step with ModuleNotFoundError: No module named 'numpy'.
Root Cause
SPEC's setup.py imports numpy at the top level before calling setup(). Modern pip uses build isolation (PEP 517) by default, creating an isolated environment that excludes packages installed earlier in the workflow.
Changes
Added --no-build-isolation flag to all SPEC installation commands:
-
.github/workflows/tests.yml -
.github/workflows/extensive_test.yml -
ci/Dockerfile.ubuntu -
ci/singularity.def
- pip install .
+ pip install --no-build-isolation .
This allows SPEC's setup.py to access numpy and other dependencies from the main environment during the build.
Original prompt
This section details on the original issue you should resolve
<issue_title>CI is failing during SPEC install</issue_title> <issue_description>The simsopt github actions workflows such as
tests.ymlhave been failing at the stepBuild SPEC python wrapper.Here is one example: https://github.com/hiddenSymmetries/simsopt/actions/runs/19414114247/job/55539740477The key error message seems to be
ModuleNotFoundError: No module named 'numpy'. This is strange because numpy was explicitly pip-installed earlier in the workflow at the stepInstall python dependencies.The failure occurred at least as far back as October 27, 2025: https://github.com/hiddenSymmetries/simsopt/actions/runs/18847961823/job/53776939501
The
Build SPEC python wrapperstep did succeed on October 24, 2025: https://github.com/hiddenSymmetries/simsopt/actions/runs/18795359641There were commits to SPEC main on October 30 and 23: https://github.com/PrincetonUniversity/SPEC/commits/master/ So the dates are not quite consistent with the start of the simsopt CI failure. Also none of those changes to SPEC appear relevant to the
No module named 'numpy'error. So I expect the problem is occurring due to a change in some other library around that time.</issue_description>Comments on the Issue (you are @copilot in this section)
- Fixes hiddenSymmetries/simsopt#561
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
It looks like that change fixed the original issue, as the Extensive Tests workflows now passes for python versions 3.10 and 3.11. However now both the Tests and Extensive Tests workflows are failing for python v3.9. Let's replace the python version 3.9 with 3.12 in those cases.
@mbkumar @smiet What do you think of this approach to fixing #561 ? Some of the workflows are still failing at later steps, but with this change they at least get further than installing SPEC as in #561. It may be cleaner to fix the issue in SPEC itself but I'm not sure how to do that, and the py_spec workflow in SPEC itself seems to have worked fine recently (https://github.com/PrincetonUniversity/SPEC/actions/workflows/py_spec.yml), so I'm still confused why it's failing in simsopt.
I had a chat with Chris on this. They are developing a new version, and the one we are using is not in development anymore. It is better for us to disable SPEC installation for CI/CD. I'll get to it soon.
Superseded by #571