luispedro / mahotas

Computer Vision in Python
https://mahotas.rtfd.io
Other
846 stars 148 forks source link

Create new release #148

Closed Czaki closed 4 months ago

Czaki commented 4 months ago

As NumPy 2.0 was released 16 Jun it will be nice to rebuild mahotas wheels against numpy 2.0.

Wheels build against NumPy 2.0 will be binary compatible with 1.16+

Without new release, the environment with NumPy 2.0 will produce such error:

    File "/tmp/tox/py39-PyQt5-all/lib/python3.9/site-packages/_pytest/pathlib.py", line 591, in import_path
      importlib.import_module(module_name)
    File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/importlib/__init__.py", line 127, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "/tmp/tox/py39-PyQt5-all/lib/python3.9/site-packages/_pytest/assertion/rewrite.py", line 178, in exec_module
      exec(co, module.__dict__)
    File "/home/runner/work/PartSeg/PartSeg/package/tests/conftest.py", line 13, in <module>
      from PartSegCore.analysis import ProjectTuple, SegmentationPipeline, SegmentationPipelineElement
    File "/tmp/tox/py39-PyQt5-all/lib/python3.9/site-packages/PartSegCore/analysis/__init__.py", line 7, in <module>
      from PartSegCore.analysis.measurement_calculation import MEASUREMENT_DICT
    File "/tmp/tox/py39-PyQt5-all/lib/python3.9/site-packages/PartSegCore/analysis/measurement_calculation.py", line 27, in <module>
      from mahotas.features import haralick
    File "/tmp/tox/py39-PyQt5-all/lib/python3.9/site-packages/mahotas/__init__.py", line 31, in <module>
      from .bbox import bbox, croptobbox
    File "/tmp/tox/py39-PyQt5-all/lib/python3.9/site-packages/mahotas/bbox.py", line 8, in <module>
      from . import _bbox
  Traceback (most recent call last):
    File "/tmp/tox/py39-PyQt5-all/lib/python3.9/site-packages/numpy/core/_multiarray_umath.py", line 44, in __getattr__
      raise ImportError(msg)
  ImportError: 
  A module that was compiled using NumPy 1.x cannot be run in
  NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
  versions of NumPy, modules must be compiled with NumPy 2.0.
  Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

  If you are a user of the module, the easiest solution will be to
  downgrade to 'numpy<2' or try to upgrade the affected module.
  We expect that some modules will need time to support NumPy 2.

  Could not import submodules (exact error was: numpy.core.multiarray failed to import).

  There are many reasons for this error the most common one is that you have
  either not built the packages or have built (using `python setup.py build`) or
  installed them (using `python setup.py install`) and then proceeded to test
  mahotas **without changing the current directory**.

  Try installing and then changing to another directory before importing mahotas.

  A module that was compiled using NumPy 1.x cannot be run in
  NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
  versions of NumPy, modules must be compiled with NumPy 2.0.
  Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

  If you are a user of the module, the easiest solution will be to
  downgrade to 'numpy<2' or try to upgrade the affected module.
  We expect that some modules will need time to support NumPy 2.

For current project configuration, it should be enough to push new commit with bump version and new tag to repository.

luispedro commented 4 months ago

I also need to release some changes to the code. I was actually just hoping to get numpy 2 into the CI so it could test it properly, but seems to work now: https://github.com/luispedro/mahotas/commit/5e75706160182b882d9eb267a31a8594304d1a50

I will release rn

luispedro commented 4 months ago

Unfortunately, there some issue with the action, so I am reopening here.

vincentschut commented 4 months ago

Hi, I was looking for mahotas 1.4.16 on pypi, which according to the 'recent versions' should have been released July 3rd, but it's not there. Is that due to the "some issue with the action" you mention above? Or is it a separate issue? (I hoped to have a numpy2 compatible version available on pypi...)

Czaki commented 4 months ago

It is because issue in GitHub action that does not allow creating artifacts to upload to PyPi. There is #148 that provides a workaround (there is a problem with the most recent pytest version). So there is a probability that it will be shortly available when @luispedro finds time.

vincentschut commented 4 months ago

It is because issue in GitHub action that does not allow creating artifacts to upload to PyPi. There is #148 that provides a workaround (there is a problem with the most recent pytest version). So there is a probability that it will be shortly available when @luispedro finds time.

perfect, thanks for the update!

luispedro commented 4 months ago

There was actually a long standing bug (more of a missing edge case) that somehow was only triggered on certain versions of Windows! (having to do with how many bits ints and longs and long longs have &c)

I am just about to release v1.4.17 which fixes this and then there will be wheels &c

luispedro commented 4 months ago

New version (1.4.17) is up on pypi!