Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37399732
en ru br
Репозитории ALT

Группа :: Development/Python3
Пакет: python3-module-numpy

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

%def_with check
%define _unpackaged_files_terminate_build 1
%define _stripped_files_terminate_build 1
%set_verify_elf_method strict

%ifarch %ix86 ppc64le armh
%define relax_tests 1
%endif

# LTO causes errors, disable it

%global optflags_lto %nil

%define pypi_name numpy
%define oname %pypi_name

Name: python3-module-%oname
Epoch: 1
Version: 1.25.2
Release: alt1
Summary: Fundamental package for array computing in Python
License: BSD-3-Clause
Group: Development/Python3
Url: https://www.numpy.org/
VCS: https://github.com/numpy/numpy.git
Source: %name-%version.tar
Source3: svml.tar
Source4: x86-simd-sort.tar
Source1: %pyproject_deps_config_name
Patch: numpy-1.20.2-Remove-strict-dependency-on-testing-package.patch
Patch1: numpy-1.21.1-alt-use-system-fallocate-declaration.patch
Patch4: numpy-1.21.4-alt-use-sleep-in-auxv-test.patch
# E2K patchset with MCST numbering scheme
%ifarch %e2k
Patch1001: 0001-arch_e2k_define.patch
Patch1002: 0002-bug92804.patch
Patch1003: 0003-lcc-1.24-compat.patch
%endif
%pyproject_runtimedeps_metadata
BuildRequires(pre): rpm-build-pyproject
BuildRequires: gcc-c++ gcc-fortran liblapack-devel swig
%pyproject_builddeps_build
%if_with check
%pyproject_builddeps_metadata
%pyproject_builddeps_check
# some tests want /proc/meminfo
BuildRequires: /proc
%endif

# numpy provides the hook for PyInstaller via entry_points mechanism

# PyInstaller will call this hook
# see https://github.com/numpy/numpy/issues/17184
%filter_from_requires /python3(PyInstaller\(\..*\)\?)/d

# numpy.distutils is deprecated and will be removed with Python 3.12

# https://numpy.org/doc/stable/reference/distutils.html
# https://numpy.org/doc/stable/reference/distutils_status_migration.html#distutils-status-migration
# https://bugzilla.altlinux.org/35103
%filter_from_requires /python3(distutils\(\..*\)\?)/d
%filter_from_requires /python3(setuptools\(\..*\)\?)/d

# code_generators is only available in source tree and is not

# shipped, but we ship code that may use it, for example, numpy.core.cversions
%filter_from_requires /python3(code_generators\(\..*\)\?)/d
# sys.path is prepended with code_generators path
%add_python3_req_skip genapi
%add_python3_req_skip numpy_api

%add_findprov_skiplist %python3_sitelibdir/%oname/random/_examples/*
%add_findreq_skiplist  %python3_sitelibdir/%oname/random/_examples/*

# core.setup_common is imported from core.setup

%add_python3_self_prov_path %buildroot%python3_sitelibdir/%oname/core/
# f2py.setup: from __version__ import version
%add_python3_self_prov_path %buildroot%python3_sitelibdir/%oname/f2py/

Conflicts: python-module-numpy < 1:1.15.4-alt6

%description
NumPy is the fundamental package for scientific computing in Python. It is a
Python library that provides a multidimensional array object, various derived
objects (such as masked arrays and matrices), and an assortment of routines for
fast operations on arrays, including mathematical, logical, shape manipulation,
sorting, selecting, I/O, discrete Fourier transforms, basic linear algebra,
basic statistical operations, random simulation and much more.

%package testing
Summary: Testing part of NumPy (Python 3)
Group: Development/Python3
Requires: %name = %EVR

%description testing
This package contains testing part of NumPy.

%package tests
Summary: Tests for NumPy (Python 3)
Group: Development/Python3
Requires: %name = %EVR

%description tests
This package contains tests NumPy.

%package -n lib%oname-py3-devel
Summary: Development files of NumPy (Python 3)
Group: Development/Python3
Requires: %name = %EVR
Requires: python3-devel

%description -n lib%oname-py3-devel
This package contains development files of NumPy.

%prep
%setup -a 3 -a4
%autopatch -p1

# headers

sed -i 's|^prefix.*|prefix=%python3_sitelibdir/%oname/core|' \
%oname/core/npymath.ini.in
sed -i 's|^includedir.*|includedir=%_includedir/python%_python3_version/%oname|' \
%oname/core/npymath.ini.in

# fix version info

sed -i \
-e "s/git_refnames\s*=\s*\"[^\"]*\"/git_refnames = \" \(tag: v%version\)\"/" \
%oname/_version.py

%pyproject_deps_resync_build
%pyproject_deps_resync_metadata
%if_with check
%pyproject_deps_resync_check_pipreqfile test_requirements.txt
%endif

%build
%add_optflags -fno-strict-aliasing
%pyproject_build

%check
# no-build to avoid double build
%pyproject_run -- python3 runtests.py --no-build -v -- -ra -o=addopts=-Wignore %{?relax_tests:||:}

%install
%pyproject_install

install -d %buildroot%_includedir/python%_python3_version
mv %buildroot%python3_sitelibdir/%oname/core/include/%oname \
%buildroot%_includedir/python%_python3_version/%oname

ln -s %_includedir/python%_python3_version/%oname \
%buildroot%python3_sitelibdir/%oname/core/include/

%files
%doc README.md
%_bindir/f2py*
%python3_sitelibdir/%oname
%python3_sitelibdir/%{pyproject_distinfo %oname}/
%exclude %python3_sitelibdir/%oname/conftest.py
%exclude %python3_sitelibdir/%oname/_pytesttester.py
%exclude %python3_sitelibdir/%oname/_pytesttester.pyi
%exclude %python3_sitelibdir/%oname/__pycache__/conftest.*
%exclude %python3_sitelibdir/%oname/__pycache__/_pytesttester.*
%exclude %python3_sitelibdir/%oname/ma/timer_comparison.py
%exclude %python3_sitelibdir/%oname/ma/__pycache__/timer_comparison.*
%exclude %python3_sitelibdir/%oname/testing
%exclude %python3_sitelibdir/%oname/tests
%exclude %python3_sitelibdir/%oname/*/tests/
%exclude %python3_sitelibdir/%oname/*/test_*
%exclude %python3_sitelibdir/%oname/*/testutils.py
%exclude %python3_sitelibdir/%oname/*/__pycache__/test_*.*
%exclude %python3_sitelibdir/%oname/*/__pycache__/testutils.*
%exclude %python3_sitelibdir/%oname/f2py/src/fortranobject.h
%exclude %python3_sitelibdir/%oname/core/lib/npy-pkg-config
%exclude %python3_sitelibdir/%oname/doc
%exclude %python3_sitelibdir/%oname/core/include
%exclude %python3_sitelibdir/%oname/distutils/mingw
%exclude %python3_sitelibdir/%oname/f2py/src
%exclude %python3_sitelibdir/%oname/core/lib/libnpymath.a
%exclude %python3_sitelibdir/%oname/random/lib/libnpyrandom.a

%files testing
%python3_sitelibdir/%oname/testing
%python3_sitelibdir/%oname/conftest.py
%python3_sitelibdir/%oname/_pytesttester.py
%python3_sitelibdir/%oname/_pytesttester.pyi
%python3_sitelibdir/%oname/__pycache__/conftest.*
%python3_sitelibdir/%oname/__pycache__/_pytesttester.*

%files tests
%python3_sitelibdir/%oname/tests/
%python3_sitelibdir/%oname/typing/tests/
%python3_sitelibdir/%oname/random/tests/
%python3_sitelibdir/%oname/polynomial/tests/
%python3_sitelibdir/%oname/matrixlib/tests/
%python3_sitelibdir/%oname/ma/tests/
%python3_sitelibdir/%oname/linalg/tests/
%python3_sitelibdir/%oname/lib/tests/
%python3_sitelibdir/%oname/fft/tests/
%python3_sitelibdir/%oname/f2py/tests/
%python3_sitelibdir/%oname/distutils/tests/
%python3_sitelibdir/%oname/core/tests/
%python3_sitelibdir/%oname/compat/tests/
%python3_sitelibdir/%oname/array_api/tests/
%python3_sitelibdir/%oname/ma/testutils.py
%python3_sitelibdir/%oname/ma/__pycache__/testutils.*
%python3_sitelibdir/%oname/_pyinstaller/test_pyinstaller.py
%python3_sitelibdir/%oname/_pyinstaller/__pycache__/test_pyinstaller.*

%files -n lib%oname-py3-devel
%_includedir/python%_python3_version/%oname
%python3_sitelibdir/%oname/core/include
%python3_sitelibdir/%oname/distutils/mingw
%python3_sitelibdir/%oname/f2py/src
%python3_sitelibdir/%oname/core/lib/npy-pkg-config
%python3_sitelibdir/%oname/core/lib/libnpymath.a
%python3_sitelibdir/%oname/random/lib/libnpyrandom.a

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin