Am 16.04.24 um 07:30 schrieb daniel.garcia@suse.com:
On lun, 2024-04-15 at 20:37 +0000, Atri Bhattacharya wrote:
daniel.garcia@suse.com wrote:
I would go for keeping python-numpy as the latest version (in this
case,
2.0) and create a new package called python-numpy_1. Any package that
depends on old numpy can just add the version limit to the spec file
like:

Requires:       python-numpy < 2

..which would entail manual fixes for a rather large number of specfiles.
What would be the benefit, if I may ask, as opposed to using `python-
numpy2` as I suggested above?
The benefit is that we will keep the upstream name for the package and in
the future we just need to drop python-numpy_1. If we do it the other way,
at some point we will need to rename the package or we will keep the
package name mismatch forever.

I mean, if upstream doesn't change the name to numpy2, all the projects
that depends on it should also update their dependencies to pin the version
when it's released.

+1.
Many packages do already pin to numpy < 2. The proposed scheme mirrors the upstream logic and avoids confusion.

Name:      python-numpy
Version:   2.0
Provides:  python-numpy = %{version}-%{release}
Conflicts: python-numpy1
%python_subpackages

Name: python-numpy1
Version:   1.26.4
Provides:  python-numpy = %{version}-%{release}
Conflicts: python-numpy
%python_subpackages

https://build.opensuse.org/projects/openSUSE:Factory/prjconf
Prefer: -python310-numpy1 -python311-numpy1 -python312-numpy1

[ben@skylab:…osc/bmwiedemann/openSUSE]% git grep 'numpy <' packages/*/*/*.spec
packages/a/apache-arrow/python-pyarrow.spec:Requires:       (python-numpy >= 1.16.6 with python-numpy < 2)
packages/p/python-astropy/python-astropy.spec:Requires:       (python-numpy >= 1.22 with python-numpy < 2)
packages/p/python-matplotlib/python-matplotlib.spec:Requires:       (python-numpy >= 1.21 with python-numpy < 2)
packages/p/python-nptyping/python-nptyping.spec:Requires:       (python-numpy >= 1.21.5 with python-numpy < 2)
packages/p/python-nptyping/python-nptyping.spec:BuildRequires:  %{python_module numpy >= 1.20.0 with %python-numpy < 2}
packages/p/python-numba/python-numba.spec:# upper bound is exclusive: min-numpy_ver <= numpy < max_numpy_ver
packages/p/python-numba/python-numba.spec:Requires:       (python-numpy >= %{min_numpy_ver} with python-numpy < %{max_numpy_ver})
packages/p/python-numpy/python-numpy.spec:Conflicts:      %{plainpython}-numpy <= 1.12.0
packages/p/python-pandas/python-pandas.spec:Requires:       (python-numpy >= 1.23.2 with python-numpy < 2)
packages/p/python-pandas/python-pandas.spec:Requires:       (python-numpy >= 1.26  with python-numpy < 2)
packages/p/python-scikit-learn/python-scikit-learn.spec:Requires:       (python-numpy >= 1.19.5 with python-numpy < 2)
packages/p/python-yt/python-yt.spec:Requires:       (python-numpy >= 1.19.3 with python-numpy < 2)


I just hope that we don't have to jump through too many hoops to make the hpc packages work.

- Ben