2018-11-29 21:23:35 +00:00
#
2023-01-27 09:13:21 +00:00
# spec file
2018-11-29 21:23:35 +00:00
#
2023-01-27 09:13:21 +00:00
# Copyright (c) 2023 SUSE LLC
2018-11-29 21:23:35 +00:00
#
# 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/
#
2020-02-24 15:38:56 +00:00
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
2021-04-27 11:15:05 +00:00
%define skip_python36 1
2020-02-24 15:38:56 +00:00
Name : python-Theano%{psuffix}
2020-08-03 16:11:49 +00:00
Version : 1.0.5
2018-11-29 21:23:35 +00:00
Release : 0
Summary : A scientific python library
License : BSD-3-Clause
Group : Development/Libraries/Python
2020-02-20 14:21:48 +00:00
URL : https://github.com/Theano/Theano
2018-11-29 21:23:35 +00:00
Source : https://files.pythonhosted.org/packages/source/T/Theano/Theano-%{version} .tar.gz
Source1 : python-Theano.rpmlintrc
2020-10-27 21:29:45 +00:00
# PATCH-FIX-UPSTREAM remove_warnings.patch gh#Theano/Theano#6764 mcepl@suse.com
# Remove various deprecations
Patch0 : remove_warnings.patch
# PATCH-FEATURE-UPSTREAM remove_nose.patch gh#Theano/Theano#6764 mcepl@suse.com
# port the test suite from nose to pytest
Patch1 : remove_nose.patch
2023-01-27 09:13:21 +00:00
# PATCH-FIX-OPENSUSE numpy-124.patch
Patch2 : numpy-124.patch
2020-02-20 14:21:48 +00:00
BuildRequires : %{python_module devel}
2018-11-29 21:23:35 +00:00
BuildRequires : %{python_module setuptools}
BuildRequires : c++_compiler
BuildRequires : fdupes
BuildRequires : python-rpm-macros
2019-03-10 10:54:23 +00:00
Requires : c++_compiler
2020-02-20 14:21:48 +00:00
Requires : python-devel
2018-11-29 21:23:35 +00:00
Requires : python-numpy >= 1.9.1
2020-02-20 14:21:48 +00:00
Requires : python-numpy-devel >= 1.9.1
2018-11-29 21:23:35 +00:00
Requires : python-scipy >= 0.14
Requires : python-six >= 1.9.0
2020-05-18 13:03:00 +00:00
Requires(post) : update-alternatives
2021-04-21 02:52:36 +00:00
Requires(postun) : update-alternatives
2020-02-24 15:38:56 +00:00
# The tests are compiling and are arch specific
%if !%{with test}
2018-11-29 21:23:35 +00:00
BuildArch : noarch
2020-02-24 15:38:56 +00:00
%endif
%if %{with test}
2018-11-29 21:23:35 +00:00
BuildRequires : %{python_module numpy >= 1.9.1}
2020-02-20 14:21:48 +00:00
BuildRequires : %{python_module numpy-devel}
2018-11-29 21:23:35 +00:00
BuildRequires : %{python_module parameterized}
2020-10-27 21:29:45 +00:00
BuildRequires : %{python_module pytest}
2018-11-29 21:23:35 +00:00
BuildRequires : %{python_module scipy >= 0.14}
BuildRequires : %{python_module six >= 1.9.0}
2020-02-24 15:38:56 +00:00
%endif
2018-11-29 21:23:35 +00:00
%python_subpackages
%description
Theano is a Python library that allows you to define, optimize, and
evaluate mathematical expressions involving multi-dimensional arrays.
Theano features:
* tight integration with numpy - Use numpy.ndarray in Theano-compiled
functions.
2018-12-06 12:42:13 +00:00
* transparent use of a GPU
2018-11-29 21:23:35 +00:00
* symbolic differentiation - Let Theano do your derivatives.
* speed and stability optimizations – Get the right answer for log(1+x)
even when x is really tiny.
* dynamic C code generation - Evaluate expressions faster.
* extensive unit-testing and self-verification – Detect and diagnose
many types of mistake.
%prep
2023-01-27 09:13:21 +00:00
%autosetup -p1 -n Theano-%{version}
2020-10-27 21:29:45 +00:00
for script in theano/gpuarray/tests/check_dnn_conv.py \
theano/misc/buildbot_filter.py theano/gpuarray/tests/check_dnn_conv.py \
theano/misc/check_*.py theano/tests/run_tests_in_batch.py
do
sed -i -e '1s@/usr/bin/env python@/usr/bin/python@' " $ s c r i p t "
done
2018-11-29 21:23:35 +00:00
%build
%python_build
%install
2020-02-24 15:38:56 +00:00
%if !%{with test}
2018-11-29 21:23:35 +00:00
%python_install
2020-05-18 13:03:00 +00:00
%python_clone -a %{buildroot} %{_bindir} /theano-cache
2018-11-29 21:23:35 +00:00
2020-02-24 15:38:56 +00:00
# remove binaries and stuff thats not supposed to end up on system
%python_expand rm -r %{buildroot} %{$python_sitelib}/bin
2020-02-25 15:44:44 +00:00
# Other pkgs use theano tests as a basis (see Keras)
#%%python_expand rm -r %{buildroot}%{$python_sitelib}/theano/tests
#%%python_expand rm -r %{buildroot}%{$python_sitelib}/theano/*/tests
2020-02-24 15:38:56 +00:00
2018-11-29 21:23:35 +00:00
# replace duplicate .pyo/.pyc with hardlinks
%python_expand %fdupes %{buildroot} %{_defaultdocdir} /%{name}
%python_expand %fdupes %{buildroot} %{$python_sitelib}
2020-02-24 15:38:56 +00:00
%endif
2018-11-29 21:23:35 +00:00
2020-02-20 14:21:48 +00:00
%check
2020-02-24 15:38:56 +00:00
%if %{with test}
2020-02-25 09:02:59 +00:00
# https://github.com/Theano/Theano/issues/6719
rm theano/tensor/tests/test_var.py
2023-01-27 09:13:21 +00:00
%pytest -k 'not (test_scan_err1 or test_remove0 or test_csm_unsorted or test_good or test_vector_arguments or test_vector_arguments or test_softmax)' theano/tests
2020-02-24 15:38:56 +00:00
%endif
2020-02-20 14:21:48 +00:00
2020-02-24 15:38:56 +00:00
%if !%{with test}
2020-05-18 13:03:00 +00:00
%post
%python_install_alternative theano-cache
%postun
%python_uninstall_alternative theano-cache
2018-11-29 21:23:35 +00:00
%files %{python_files}
%doc DESCRIPTION.txt EMAIL.txt HISTORY.txt NEWS.txt README.rst
%license doc/LICENSE.txt
2020-05-18 13:03:00 +00:00
%python_alternative %{_bindir} /theano-cache
2018-11-29 21:23:35 +00:00
%{python_sitelib} /theano
%{python_sitelib} /Theano-%{version} -*.egg-info
2020-02-24 15:38:56 +00:00
%endif
2018-11-29 21:23:35 +00:00
%changelog