Skip to content

New release 3.9.0 is only compatible with numpy>=2.0 but requirements specify numpy>=1.26 #485

@joshuacwnewton

Description

@joshuacwnewton

Downstream ref: spinalcordtoolbox/spinalcordtoolbox#5041

blosc2 just updated to 3.9.0, and we started getting errors in our test suite:

  File "/home/runner/work/spinalcordtoolbox/spinalcordtoolbox/python/envs/venv_sct/lib/python3.10/site-packages/acvl_utils/cropping_and_padding/bounding_boxes.py", line 5, in <module>
    import blosc2
  File "/home/runner/work/spinalcordtoolbox/spinalcordtoolbox/python/envs/venv_sct/lib/python3.10/site-packages/blosc2/__init__.py", line 174, in <module>
    isdtype = np.isdtype
  File "/home/runner/work/spinalcordtoolbox/spinalcordtoolbox/python/envs/venv_sct/lib/python3.10/site-packages/numpy/__init__.py", line 333, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'isdtype'. Did you mean: 'dtype'?

Relevant LOC:

isdtype = np.isdtype

We install numpy==1.26.4 because we have not yet migrated to numpy==2.0. It looks like isdtype is a numpy 2.0-specific feature (switching to 1.26 in the docs leads to a 404).

However, blosc2-python specifies 1.26 compatibility in its pyproject.toml:

"numpy>=1.26",
#"numpy>=2",

Meaning it can be installed alongside the (incomptable) 1.26, leading to this failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions