Fixed `numpy` ptests. Added `python3-pyproject-metadata`. (#10270)

This commit is contained in:
Pawel Winogrodzki 2024-08-27 15:15:09 -07:00 коммит произвёл GitHub
Родитель d47dc39ac7
Коммит 82aa2945bd
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
6 изменённых файлов: 196 добавлений и 37 удалений

2
LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md сгенерированный

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -1760,6 +1760,7 @@
"python-pymongo",
"python-PyMySQL",
"python-pyperclip",
"python-pyproject-metadata",
"python-pyroute2",
"python-pyrsistent",
"python-pysocks",
@ -2134,7 +2135,7 @@
"xorg-x11-proto-devel",
"xorg-x11-server",
"xorg-x11-server-utils",
"xorg-x11-server-Xwayland",
"xorg-x11-server-Xwayland",
"xorg-x11-util-macros",
"xorg-x11-utils",
"xorg-x11-xauth",

Просмотреть файл

@ -5,7 +5,7 @@
Summary: A fast multidimensional array facility for Python
Name: numpy
Version: 1.26.3
Release: 2%{?dist}
Release: 3%{?dist}
# Everything is BSD except for class SafeEval in numpy/lib/utils.py which is Python
License: BSD AND Python AND ASL 2.0
Vendor: Microsoft Corporation
@ -36,8 +36,11 @@ BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gcc-gfortran
BuildRequires: lapack-devel
BuildRequires: ninja-build
BuildRequires: python3-Cython
BuildRequires: python3-devel
BuildRequires: python3-pip
BuildRequires: python3-pyproject-metadata
BuildRequires: python3-setuptools
Provides: libnpymath-static = %{version}-%{release}
Provides: libnpymath-static%{?_isa} = %{version}-%{release}
@ -45,7 +48,9 @@ Provides: numpy = %{version}-%{release}
Provides: numpy%{?_isa} = %{version}-%{release}
%if 0%{?with_check}
BuildRequires: meson
BuildRequires: python3-pip
BuildRequires: python3-hypothesis
BuildRequires: python3-pytest
BuildRequires: python3-typing-extensions
%endif
%description -n python3-numpy
@ -99,10 +104,7 @@ EOF
%build
%set_build_flags
env OPENBLAS=%{_libdir} \
BLAS=%{_libdir} \
LAPACK=%{_libdir} CFLAGS="%{optflags}" \
%{__python3} setup.py build
%pyproject_wheel -Csetup-args=-Dblas=%{blaslib} -Csetup-args=-Dlapack=lapack
%install
mkdir docs
@ -110,31 +112,23 @@ pushd docs
unzip %{SOURCE1}
popd
#%%{__python3} setup.py install -O1 --skip-build --root %%{buildroot}
# skip-build currently broken, this works around it for now
env OPENBLAS=%{_libdir} \
FFTW=%{_libdir} BLAS=%{_libdir} \
LAPACK=%{_libdir} CFLAGS="%{optflags}" \
%{__python3} setup.py install --root %{buildroot} --prefix=%{_prefix}
ln -s f2py3 %{buildroot}%{_bindir}/f2py.numpy
%pyproject_install
pushd %{buildroot}%{_bindir} &> /dev/null
ln -s f2py f2py3
ln -s f2py f2py%{python3_version}
ln -s f2py3 f2py.numpy
popd &> /dev/null
#symlink for includes, BZ 185079
mkdir -p %{buildroot}%{_includedir}
ln -s %{python3_sitearch}/%{name}/core/include/numpy/ %{buildroot}%{_includedir}/numpy
# distutils from setuptools don't have the patch that was created to avoid standard runpath here
# we strip it manually instead
# ERROR 0001: file '...' contains a standard runpath '/usr/lib64' in [/usr/lib64]
chrpath --delete %{buildroot}%{python3_sitearch}/%{name}/core/_multiarray_umath.*.so
chrpath --delete %{buildroot}%{python3_sitearch}/%{name}/linalg/lapack_lite.*.so
chrpath --delete %{buildroot}%{python3_sitearch}/%{name}/linalg/_umath_linalg.*.so
%check
export PYTHONPATH=%{buildroot}%{python3_sitearch}
# Hypothesis 6.72.0 introduced a deprecation error for "Healthcheck.all()" which fails the test run
pip install 'pytest==7.2' 'hypothesis<6.72.0' typing-extensions
# Freezing package versions to keep the tests stable.
pip3 install iniconfig==2.0.0 sortedcontainers==2.4.0
# test_ppc64_ibm_double_double128 is unnecessary now that ppc64le has switched long doubles to IEEE format.
# https://github.com/numpy/numpy/issues/21094
@ -150,7 +144,6 @@ python3 runtests.py --no-build -- -ra -k 'not test_ppc64_ibm_double_double128'
%dir %{python3_sitearch}/%{name}
%{python3_sitearch}/%{name}/*.py*
%{python3_sitearch}/%{name}/core
%{python3_sitearch}/%{name}/distutils
%{python3_sitearch}/%{name}/doc
%{python3_sitearch}/%{name}/fft
%{python3_sitearch}/%{name}/lib
@ -162,8 +155,7 @@ python3 runtests.py --no-build -- -ra -k 'not test_ppc64_ibm_double_double128'
%{python3_sitearch}/%{name}/compat
%{python3_sitearch}/%{name}/matrixlib
%{python3_sitearch}/%{name}/polynomial
%{python3_sitearch}/%{name}-*.egg-info
%exclude %{python3_sitearch}/%{name}/LICENSE.txt
%{python3_sitearch}/%{name}-*.dist-info
%{_includedir}/numpy
%{python3_sitearch}/%{name}/__init__.pxd
%{python3_sitearch}/%{name}/__init__.cython-30.pxd
@ -175,13 +167,21 @@ python3 runtests.py --no-build -- -ra -k 'not test_ppc64_ibm_double_double128'
%files -n python3-numpy-f2py
%{_bindir}/f2py
%{_bindir}/f2py3
%{_bindir}/f2py.numpy
%{_bindir}/f2py%{python3_version}
%{python3_sitearch}/%{name}/f2py
%files -n python3-numpy-doc
%doc docs/*
%changelog
* Tue Aug 27 2024 Pawel Winogrodzki <pawelwi@microsoft.com> - 1.26.3-3
- Fix package tests.
- Update to build using python3-pyproject-metadata.
- Align the python3-numpy-f2py file links with Fedora.
- Using Fedora 40 (license: MIT) for guidance.
* Fri Feb 16 2024 Andrew Phelps <anphel@microsoft.com> - 1.26.3-2
- Remove restriction on python3-setuptools < 60

Просмотреть файл

@ -0,0 +1,5 @@
{
"Signatures": {
"python-pyproject-metadata-0.8.0.tar.gz": "bb5015c9f3869c6fa59d8fdf29840a58cda2a570cb557b8aecae0f9e97a4cf88"
}
}

Просмотреть файл

@ -0,0 +1,143 @@
%global pkgname pyproject-metadata
# Building the documentation requires the furo Sphinx theme. But building furo
# requires sphinx_theme_builder, which requires this package. Avoid a
# dependency loop with this conditional.
%bcond_with doc
Name: python-%{pkgname}
Version: 0.8.0
Release: 1%{?dist}
Summary: PEP 621 metadata parsing
License: MIT
Vendor: Microsoft Corporation
Distribution: Azure Linux
URL: https://github.com/pypa/python-%{pkgname}
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python3-flit-core
BuildRequires: python3-pip
BuildRequires: python3-wheel
BuildRequires: %{py3_dist docutils}
%if 0%{?with_check}
BuildRequires: python3-pytest
%endif
%global _desc %{expand:
Dataclass for PEP 621 metadata with support for core metadata generation.
This project does not implement the parsing of pyproject.toml containing
PEP 621 metadata. Instead, given a Python data structure representing
PEP 621 metadata (already parsed), it will validate this input and
generate a PEP 643-compliant metadata file (e.g. PKG-INFO).}
%description %_desc
%package -n python3-%{pkgname}
Summary: PEP 621 metadata parsing
# This can be removed when F40 reaches EOL
Obsoletes: python3-pep621 < 0.5
Provides: python3-pep621 = %{version}-%{release}
%description -n python3-%{pkgname} %_desc
%if %{with doc}
%package doc
Summary: Documentation for python3-%{pkgname}
# This can be removed when F40 reaches EOL
Obsoletes: python3-pep621-doc < 0.5
Provides: python3-pep621-doc = %{version}-%{release}
%description doc
Documentation for python3-%{pkgname}.
%endif
%prep
%autosetup -p1 -n %{pkgname}-%{version}
# No need to BuildRequire pytest-cov to run pytest
sed -i /pytest-cov/d pyproject.toml
%generate_buildrequires
%if %{with doc}
%pyproject_buildrequires -x test,docs
%else
%pyproject_buildrequires -x test
%endif
%build
%pyproject_wheel
rst2html --no-datestamp CHANGELOG.rst CHANGELOG.html
%if %{with doc}
# Build the documentation
PYTHONPATH=$PWD/build/lib
mkdir html
sphinx-build -b html docs html
rm -rf html/{.buildinfo,.doctrees}
%endif
%install
%pyproject_install
%pyproject_save_files pyproject_metadata
%check
# Freezing package versions to keep the tests stable.
pip3 install iniconfig==2.0.0
%pytest
%files -n python3-%{pkgname} -f %{pyproject_files}
%doc CHANGELOG.html README.md
%license LICENSE
%if %{with doc}
%files doc
%doc html
%endif
%changelog
* Tue Aug 27 2024 Pawel Winogrodzki <pawelwi@microsoft.com> - 0.8.0-1
- Initial CBL-Mariner import from Fedora 40 (license: MIT).
- License Verified
- Upgraded to version 0.8.0.
- Switched to using original upstream source.
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jul 11 2023 Miro Hrončok <mhroncok@redhat.com> - 0.7.1-3
- Drop an unused build requirement on pytest-cov
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 0.7.1-2
- Rebuilt for Python 3.12
* Thu Feb 23 2023 Jerry James <loganjerry@gmail.com> - 0.7.1-1
- Dynamically generate BuildRequires
* Mon Jan 30 2023 Jerry James <loganjerry@gmail.com> - 0.7.1-1
- Version 0.7.1
- Drop packaging workaround, resolved upstream
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Wed Jan 18 2023 Jerry James <loganjerry@gmail.com> - 0.7.0-2
- Work around FTI due to version of packaging (rhbz#2161981)
* Tue Jan 17 2023 Jerry James <loganjerry@gmail.com> - 0.7.0-1
- Version 0.7.0
* Tue Jul 26 2022 Jerry James <loganjerry@gmail.com> - 0.6.1-1
- Initial RPM, obsoleting python-pep621

Просмотреть файл

@ -23718,6 +23718,16 @@
}
}
},
{
"component": {
"type": "other",
"other": {
"name": "python-pyproject-metadata",
"version": "0.8.0",
"downloadUrl": "https://github.com/pypa/python-pyproject-metadata/archive/0.8.0/python-pyproject-metadata-0.8.0.tar.gz"
}
}
},
{
"component": {
"type": "other",
@ -27941,16 +27951,6 @@
}
}
},
{
"component": {
"type": "other",
"other": {
"name": "stress-ng",
"version": "0.18.02",
"downloadUrl": "https://github.com/ColinIanKing/stress-ng/archive/V0.18.02/stress-ng-0.18.02.tar.gz"
}
}
},
{
"component": {
"type": "other",
@ -27971,6 +27971,16 @@
}
}
},
{
"component": {
"type": "other",
"other": {
"name": "stress-ng",
"version": "0.18.02",
"downloadUrl": "https://github.com/ColinIanKing/stress-ng/archive/V0.18.02/stress-ng-0.18.02.tar.gz"
}
}
},
{
"component": {
"type": "other",