Commit 43911e7
CI: fix wheel test-command shadowing + conda-forge libomp for macOS
Previous run produced a green test matrix (all 12 jobs) and sdist, but
all three build-wheels jobs failed. Two independent root causes:
1. Linux and Windows wheels BUILT fine, but cibuildwheel's test-command
failed with `ModuleNotFoundError: No module named 'wlsqm.fitter.defs'`.
Root cause: pytest's default `prepend` import mode walks up the
package tree from each test file looking for a `__init__.py`-less
ancestor, and inserts that ancestor into sys.path. With
`tests/__init__.py` present, pytest treated `tests/` as a package,
walked up to `/project`, and inserted `/project` into sys.path.
Python then resolved `import wlsqm` to `/project/wlsqm/` (source
tree, no compiled .so files) instead of the installed wheel at
`site-packages/wlsqm/`. The source-tree `__init__.py` does
`from .fitter.simple import *` which fails because `defs.pyx` isn't
a compiled module.
Fix: delete `tests/__init__.py` and change the three test files
that had `from .conftest import ...` to plain `from conftest import ...`.
Without `tests/__init__.py`, pytest stops the walk at `tests/` and
inserts `tests/` (not `/project`) into sys.path, which makes
`conftest` importable by bare name and leaves the installed wheel
visible at `site-packages/wlsqm/`. The test job is unaffected because
meson-python's editable loader intercepts `import wlsqm` regardless
of sys.path order.
Verified locally: `pytest tests/` still 57/57 green.
2. macOS wheel failed at compile time with:
`fatal error: 'omp.h' file not found`
Root cause: Cython's `cimport openmp` in simple.pyx, impl.pyx,
expert.pyx, and lapackdrivers.pyx unconditionally emits
`#include <omp.h>` in the generated C. Meson's
`dependency('openmp', required: false)` fallback only controls
whether `-fopenmp` is passed — it does not prevent Cython from
emitting the header include. Apple Clang ships no `omp.h`, so the
previous commit's "drop libomp entirely, fall back to serial"
approach was not actually a viable baseline on macOS.
Fix: install conda-forge's `llvm-openmp` via a standalone micromamba
in cibuildwheel's macOS before-all. conda-forge ships llvm-openmp
rebuilt with a conservative deployment target (11.0 on arm64,
matching cibuildwheel's default), so delocate-wheel is happy to
bundle the resulting `libomp.dylib` into the wheel without the
"Library dependencies do not satisfy target MacOS version" refusal.
CPPFLAGS / LDFLAGS / PKG_CONFIG_PATH / DYLD_FALLBACK_LIBRARY_PATH
are set in `[tool.cibuildwheel.macos].environment` so that meson
discovers libomp during the build and delocate finds it at
bundling time. Same pattern as scipy and numpy's macOS wheel CI.
Also add `.claude/` to .gitignore (Claude Code internals: the
scheduled_tasks lockfile was about to sneak into `git add -A`).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 4211688 commit 43911e7
File tree
6 files changed
+26
-18
lines changed- tests
6 files changed
+26
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
128 | 130 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
138 | 145 | | |
139 | 146 | | |
140 | 147 | | |
| |||
Whitespace-only changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
0 commit comments