jwst
jwst copied to clipboard
`ImportPathMismatchError` when running `pytest` on Apple M1 Mac
pytest
================================================================= test session starts ==================================================================
platform darwin -- Python 3.10.4, pytest-7.1.2, pluggy-1.0.0
crds_context: jwst_0842.pmap
rootdir: /Users/zburnett/projects/jwst, configfile: setup.cfg
plugins: xdist-2.5.0, forked-1.4.0, requests-mock-1.9.3, ci-watson-0.6.1, openfiles-0.5.0, doctestplus-0.12.0, asdf-2.11.1, cov-3.0.0, jwst-1.5.1a1.dev19+g605f1452
collected 0 items / 1 error
======================================================================== ERRORS ========================================================================
____________________________________________________________ ERROR collecting test session _____________________________________________________________
../../miniforge3/envs/jwst/lib/python3.10/site-packages/_pytest/config/__init__.py:607: in _importconftest
mod = import_path(conftestpath, mode=importmode, root=rootpath)
../../miniforge3/envs/jwst/lib/python3.10/site-packages/_pytest/pathlib.py:556: in import_path
raise ImportPathMismatchError(module_name, module_file, path)
E _pytest.pathlib.ImportPathMismatchError: ('jwst.conftest', '/Users/zburnett/projects/jwst/build/lib.macosx-11.0-arm64-cpython-310/jwst/conftest.py', PosixPath('/Users/zburnett/projects/jwst/jwst/conftest.py'))
=============================================================== short test summary info ================================================================
ERROR - _pytest.pathlib.ImportPathMismatchError: ('jwst.conftest', '/Users/zburnett/projects/jwst/build/lib.macosx-11.0-arm64-cpython-310/jwst/conft...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=================================================================== 1 error in 1.78s ===================================================================
note: miniconda3 (installed from the *.pkg distribution) did not work, so I built this with miniforge3 for Mac OSX AMD64 (installed via the shell script) instead.
I think the issue was that pip did not recognize the miniconda environment as an arm64 platform, and thus did not pull the scipy arm64 wheels, and so fell back onto a build from *.tar.gz which failed due to missing BLAS. Installing openblas from conda also did not work, but changing the installation to miniforge did work.
https://jira.stsci.edu/browse/SCSB-41