vitessce / vitessce-python

Python API and Jupyter widget for Vitessce
https://python-docs.vitessce.io
MIT License
40 stars 7 forks source link

NickAkhmetov/Cap `numpy` under v2 #349

Closed NickAkhmetov closed 5 months ago

NickAkhmetov commented 5 months ago

numpy 2.0 released yesterday: https://numpy.org/doc/stable/reference/index.html

Since pip resolves to the latest supported version during install, this leads to a conflict with ome/skimage:

[2024-06-17 12:29:14] ERROR in hubmap_translator:835: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
[2024-06-17 12:29:14] ERROR in hubmap_translator:837: Failed to dynamically import transform module index: portal at time: 1718627354.2877655
Traceback (most recent call last):
  File "/usr/src/app/src/hubmap_translator.py", line 832, in init_transformers
    m = importlib.import_module(xform_module)
  File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
--
    from .ome import (
  File "/usr/local/lib/python3.9/site-packages/vitessce/data_utils/ome.py", line 3, in <module>
    from ome_zarr.writer import write_image
  File "/usr/local/lib/python3.9/site-packages/ome_zarr/writer.py", line 15, in <module>
    from .scale import Scaler
  File "/usr/local/lib/python3.9/site-packages/ome_zarr/scale.py", line 16, in <module>
    from skimage.transform import (
  File "/usr/local/lib64/python3.9/site-packages/skimage/__init__.py", line 122, in <module>
    from ._shared import geometry
  File "geometry.pyx", line 1, in init skimage._shared.geometry
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

This PR adjusts the resolved versions of numpy to avoid using this latest version until we are ready to make this upgrade.

ilan-gold commented 5 months ago

Just a heads up, we can unpin https://github.com/ome/ome-zarr-py/commit/9205bd7b4611e87c20e43ff097f7587e060c7127 on the next release