python-numba/python-numba.spec
Dirk Mueller ef1752b2cb Accepting request 880602 from home:bnavigator:branches:devel:languages:python:numeric
- Update to 0.53.0
  * Support for Python 3.9
  * Function sub-typing
  * Initial support for dynamic gufuncs (i.e. from @guvectorize)
  * Parallel Accelerator (@njit(parallel=True) now supports
    Fortran ordered arrays
  * Full release notes at
    https://numba.readthedocs.io/en/0.53.0/release-notes.html
- Don't unpin-llvmlite.patch. It really need to be the correct
  version.
- Refresh skip-failing-tests.patch
- Add packaging-ignore-setuptools-deprecation.patch
  gh#numba/numba#6837
- Add numba-pr6851-llvm-timings.patch gh#numba/numba#6851 in order
  to fix 32-bit issues gh#numba/numba#6832
- Update to 0.52.0
  https://numba.readthedocs.io/en/stable/release-notes.html
  This release focuses on performance improvements, but also adds 
  some new features and contains numerous bug fixes and stability 
  improvements.
  Highlights of core performance improvements include:
  * Intel kindly sponsored research and development into producing 
    a new reference count pruning pass. This pass operates at the 
    LLVM level and can prune a number of common reference counting 
    patterns. This will improve performance for two primary 
    reasons:
    - There will be less pressure on the atomic locks used to do 
      the reference counting.
    - Removal of reference counting operations permits more 
      inlining and the optimisation passes can in general do more 
      with what is present.
    (Siu Kwan Lam).
  * Intel also sponsored work to improve the performance of the 
    numba.typed.List container, particularly in the case of 
    __getitem__ and iteration (Stuart Archibald).
  * Superword-level parallelism vectorization is now switched on 
    and the optimisation pipeline has been lightly analysed and 
    tuned so as to be able to vectorize more and more often 
    (Stuart Archibald).
  Highlights of core feature changes include:
  * The inspect_cfg method on the JIT dispatcher object has been 
    significantly enhanced and now includes highlighted output and 
    interleaved line markers and Python source (Stuart Archibald).
  * The BSD operating system is now unofficially supported (Stuart 
    Archibald).
  * Numerous features/functionality improvements to NumPy support, 
    including support for:
    - np.asfarray (Guilherme Leobas)
    - “subtyping” in record arrays (Lucio Fernandez-Arjona)
    - np.split and np.array_split (Isaac Virshup)
    - operator.contains with ndarray (@mugoh).
    - np.asarray_chkfinite (Rishabh Varshney).
    - NumPy 1.19 (Stuart Archibald).
    - the ndarray allocators, empty, ones and zeros, accepting a 
      dtype specified as a string literal (Stuart Archibald).
  * Booleans are now supported as literal types (Alexey Kozlov).
  * On the CUDA target:
  * CUDA 9.0 is now the minimum supported version (Graham Markall).
  * Support for Unified Memory has been added (Max Katz).
  * Kernel launch overhead is reduced (Graham Markall).
  * Cudasim support for mapped array, memcopies and memset has 
    been   * added (Mike Williams).
  * Access has been wired in to all libdevice functions (Graham
    Markall).
  * Additional CUDA atomic operations have been added (Michae 
    Collison).
  * Additional math library functions (frexp, ldexp, isfinite) 
    (Zhihao   * Yuan).
  * Support for power on complex numbers (Graham Markall).
  Deprecations to note:
  * There are no new deprecations. However, note that 
    “compatibility” mode, which was added some 40 releases ago to 
    help transition from 0.11 to 0.12+, has been removed! Also, 
    the shim to permit the import of jitclass from Numba’s top 
    level namespace has now been removed as per the deprecation 
    schedule.
- NEP 29: Skip python36 build. Python 3.6 is dropped by NumPy 1.20

OBS-URL: https://build.opensuse.org/request/show/880602
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-numba?expand=0&rev=47
2021-03-22 22:18:24 +00:00

173 lines
6.0 KiB
RPMSpec

#
# spec file for package python-numba-test
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
# NEP 29: python36-numpy and -scipy no longer in TW
%define skip_python36 1
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
Name: python-numba%{psuffix}
Version: 0.53.0
Release: 0
Summary: NumPy-aware optimizing compiler for Python using LLVM
License: BSD-2-Clause
URL: https://numba.pydata.org/
Source: https://files.pythonhosted.org/packages/source/n/numba/numba-%{version}.tar.gz
# PATCH-FIX-UPSTREAM fix-max-name-size.patch -- fix for gh#numba/numba#3876 -- from gh#numba/numba#4373
Patch0: fix-max-name-size.patch
# PATCH-FIX-UPSTREAM packaging-ignore-setuptools-deprecation.patch -- gh#numba/numba#6837
Patch1: https://github.com/numba/numba/pull/6837.patch#/packaging-ignore-setuptools-deprecation.patch
# PATCH-FIX-USPTREAM ignore empty system time column on llvm timings -- gh#numba/numba#6851
Patch2: numba-pr6851-llvm-timings.patch
# PATCH-FIX-OPENSUSE skip tests failing due to OBS specifics
Patch3: skip-failing-tests.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module numpy-devel >= 1.15}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: python-rpm-macros
BuildRequires: tbb-devel
Requires: python-llvmlite < 0.37
Requires: python-llvmlite >= 0.36
Requires: python-numpy >= 1.15
Requires: python-scipy >= 0.16
Requires(post): update-alternatives
Requires(preun):update-alternatives
Recommends: python-Jinja2
Recommends: python-Pygments
Recommends: python-cffi
Recommends: python-tbb
%if %{with test}
BuildRequires: %{python_module Jinja2}
BuildRequires: %{python_module PyYAML}
BuildRequires: %{python_module Pygments}
BuildRequires: %{python_module cffi}
BuildRequires: %{python_module ipython}
BuildRequires: %{python_module numba >= %{version}}
BuildRequires: %{python_module numba-devel >= %{version}}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module psutil}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module scipy >= 0.16}
BuildRequires: %{python_module tbb}
%endif
%python_subpackages
%description
Numba is a NumPy-aware optimizing compiler for Python. It uses the
LLVM compiler infrastructure to compile Python syntax to
machine code.
It is aware of NumPy arrays as typed memory regions and so can speed-up
code using NumPy arrays. Other, less well-typed code will be translated
to Python C-API calls, effectively removing the "interpreter", but not removing
the dynamic indirection.
Numba is also not a tracing JIT. It *compiles* your code before it gets
run, either using run-time type information or type information you provide
in the decorator.
Numba is a mechanism for producing machine code from Python syntax and typed
data structures such as those that exist in NumPy.
%package devel
Summary: Development files for numba applications
Requires: %{name} = %{version}
Requires: python-devel
Requires: python-numpy-devel >= 1.11
%description devel
This package contains files for developing applications using numba.
%prep
%setup -q -n numba-%{version}
%autopatch -p1
# Incompatilbe numpy versions (?)
# Check these with every version update! (Last check 0.53)
# https://github.com/numba/numba/issues/5251
# https://numba.discourse.group/t/helping-test-numba-0-53-0-rc/519/34
rm numba/tests/test_np_functions.py
rm numba/tests/test_array_reductions.py
# timeouts randomly in OBS
rm numba/tests/test_typedlist.py
# if we reduced the amount of tests too much:
#sed -i -e '/check_testsuite_size/ s/5000/3000/' numba/tests/test_runtests.py
# our setup imports distutils. Not sure why, but should not be a problem.
sed -i -e "/def test_laziness/,/def/ {/'distutils',/ d}" numba/tests/test_import.py
sed -i -e '1{/env python/ d}' numba/misc/appdirs.py
%build
export CFLAGS="%{optflags} -fPIC"
%python_build
%install
%if !%{with test}
%python_install
%{python_expand #
%fdupes %{buildroot}%{$python_sitearch}
find %{buildroot}%{$python_sitearch} -name '*.[ch]' > devel-files0-%{$python_bin_suffix}.files
sed 's|^%{buildroot}||' devel-files0-%{$python_bin_suffix}.files > devel-files-%{$python_bin_suffix}.files
sed 's|^%{buildroot}|%%exclude |' devel-files0-%{$python_bin_suffix}.files > devel-files-exclude-%{$python_bin_suffix}.files
}
%python_clone -a %{buildroot}%{_bindir}/numba
%python_clone -a %{buildroot}%{_bindir}/pycc
%endif
%check
%if %{with test}
mv numba numba_temp
export NUMBA_PARALLEL_DIAGNOSTICS=1
%{python_expand # test the installed package
%{_bindir}/numba-%{$python_bin_suffix} -s
$python -m numba.runtests -v -b --exclude-tags='long_running' -m %{_smp_build_ncpus} -- numba.tests
}
mv numba_temp numba
%endif
%if !%{with test}
%post
%{python_install_alternative numba pycc}
%preun
%python_uninstall_alternative numba
%files %{python_files} -f devel-files-exclude-%{python_bin_suffix}.files
%license LICENSE
%doc CHANGE_LOG README.rst
%python_alternative %{_bindir}/numba
%python_alternative %{_bindir}/pycc
%{python_sitearch}/numba/
%{python_sitearch}/numba-%{version}-py*.egg-info
%files %{python_files devel} -f devel-files-%{python_bin_suffix}.files
%license LICENSE
%endif
%changelog