ed22a57
%{?python_enable_dependency_generator}
ed22a57
Jerry James 2181a57
%global pkgname Theano
df74587
%global srcname theano
6acf609
%global commit  29d4caa168eaa213cb0b29fd2cb2bef8cd99b389
70e2d03
#%%global rctag a1
Jerry James 2181a57
Jerry James 2181a57
Name:           python-theano
9317182
Version:        1.0.4
dc53b8f
Release:        5%{?rctag:.%{rctag}}%{?dist}.1
Jerry James 2181a57
Summary:        Mathematical expressions involving multidimensional arrays
Jerry James 2181a57
Jerry James 2181a57
License:        BSD
Jerry James 2181a57
URL:            http://deeplearning.net/software/theano/
94bdf82
Source0:        https://github.com/Theano/Theano/archive/rel-%{version}%{?rctag:%{rctag}}/%{pkgname}-%{version}%{?rctag:%{rctag}}.tar.gz
062ec9e
2f012fb
# Fix the blas interface; see https://github.com/Theano/Theano/issues/6518
2f012fb
Patch0:         %{name}-blas.patch
062ec9e
# Skip new flake8 tests that the code does not pass
062ec9e
Patch1:         %{name}-flake8.patch
aca8903
# Adapt to sphinx 3
aca8903
Patch2:         %{name}-sphinx3.patch
3fb7ae8
# Fix FutureWarnings from numpy.  Upstream commits:
3fb7ae8
# - bb2daf9755c2b05eb9726ca9f52dc6ec487d0129
3fb7ae8
# - 93e8180bf08b6fbe587b6f0ecc877ec90e6e1681
3fb7ae8
# Upstream pull requests:
3fb7ae8
# - https://github.com/Theano/Theano/pull/6711
3fb7ae8
Patch3:         %{name}-future-warning.patch
3fb7ae8
# Fix a GammaQ typo.  Upstream pull request:
3fb7ae8
# - https://github.com/Theano/Theano/pull/6683
3fb7ae8
Patch4:         %{name}-gammaq.patch
3fb7ae8
# Adapt to new ceil, floor, and trunc handling in numpy 1.17.0
3fb7ae8
Patch5:         %{name}-ceil-floor-trunc.patch
3fb7ae8
# A test that involves tracebacks has an extra frame with numpy 1.17.0
3fb7ae8
Patch6:         %{name}-traceback.patch
3fb7ae8
# The behavior of numpy.clip changed in 1.17.0.  One test checks whether the
3fb7ae8
# theano clip implementation matches the behavior of numpy.clip.  That test is
3fb7ae8
# doomed to failure with numpy 1.17.0, so just remove it.
3fb7ae8
Patch7:         %{name}-clip.patch
3fb7ae8
# Tests that used to fail with ValueError no longer do with numpy 1.17.0
3fb7ae8
Patch8:         %{name}-random.patch
fe4076c
# Tests that used to fail with numpy 1.17.0 with TypeError: only integer scalar
fe4076c
# arrays can be converted to a scalar index
fe4076c
Patch9:         %{name}-sort.patch
6acf609
# More robustly import Iterable.  Upstream commits:
6acf609
# - https://github.com/Theano/Theano/commit/513c676ae3ddcae6d23a7e62db19884eaa8c1008
6acf609
# - https://github.com/Theano/Theano/commit/454f4e56c4a859d2f3b48592c731464bf78df342
6acf609
# - https://github.com/Theano/Theano/commit/11bd36d580c6ea2a67f9b2fa1483670f63a6a13b
6acf609
Patch10:        %{name}-iterable.patch
6acf609
# Do not try to invoke git to find the commit
6acf609
Patch11:        %{name}-git.patch
6acf609
# Fix some malformed format strings
6acf609
Patch12:        %{name}-format.patch
6acf609
# Fix some incorrect uses of the 'is' keyword
6acf609
Patch13:        %{name}-is.patch
6acf609
# Fix documentation bugs resulting in sphinx warnings
6acf609
Patch14:        %{name}-doc.patch
e1ee68e
# Scipy 1.3.x produces sorted indices, so do not assert they are unsorted
e1ee68e
Patch15:        %{name}-has-sorted-indices.patch
aca8903
Jerry James 2181a57
BuildArch:      noarch
Jerry James 2181a57
70e2d03
BuildRequires:  gcc-c++
70e2d03
BuildRequires:  gcc-gfortran
33d1a2b
BuildRequires:  git-core
062ec9e
BuildRequires:  openblas-devel
062ec9e
BuildRequires:  tex(latex)
062ec9e
BuildRequires:  tex(anyfontsize.sty)
062ec9e
BuildRequires:  tex-dvipng
062ec9e
062ec9e
BuildRequires:  python3-devel
062ec9e
BuildRequires:  python3-pygpu-devel
062ec9e
BuildRequires:  python3dist(cython)
062ec9e
BuildRequires:  python3dist(flake8)
062ec9e
BuildRequires:  python3dist(nose)
062ec9e
BuildRequires:  python3dist(numpy)
062ec9e
BuildRequires:  python3dist(parameterized)
062ec9e
BuildRequires:  python3dist(pygments)
062ec9e
BuildRequires:  python3dist(scipy)
062ec9e
BuildRequires:  python3dist(setuptools)
062ec9e
BuildRequires:  python3dist(six)
062ec9e
BuildRequires:  python3dist(sphinx)
aca8903
BuildRequires:  python3dist(sphinx-rtd-theme)
Jerry James 2181a57
2f2de8d
%global _desc %{expand:
df74587
Theano is a Python library that allows you to define, optimize, and
df74587
evaluate mathematical expressions involving multi-dimensional arrays
df74587
efficiently.  Theano features:
df74587
- tight integration with NumPy: Use numpy.ndarray in Theano-compiled
df74587
  functions.
df74587
- transparent use of a GPU: Perform data-intensive calculations up to
6acf609
  140x faster than with CPU (float32 only).
df74587
- efficient symbolic differentiation: Theano does your derivatives for
df74587
  function with one or many inputs.
df74587
- speed and stability optimizations: Get the right answer for log(1+x)
df74587
  even when x is really tiny.
df74587
- dynamic C code generation: Evaluate expressions faster.
df74587
- extensive unit-testing and self-verification: Detect and diagnose many
2f2de8d
  types of mistake.}
2f2de8d
2f2de8d
%description %_desc
df74587
df74587
%package -n python3-%{srcname}
ed22a57
Summary:        %{summary}
062ec9e
Requires:       openblas-devel
062ec9e
Requires:       gcc-c++
062ec9e
Requires:       gcc-gfortran
eda01ef
Recommends:     python%{python3_version}dist(pygpu)
eda01ef
Suggests:       python%{python3_version}dist(pydot)
e808ddb
df74587
%{?python_provide:%python_provide python3-%{srcname}}
df74587
2f2de8d
%description -n python3-%{srcname} %_desc
Jerry James be8f770
df74587
%package doc
df74587
Summary:        Theano documentation
2f2de8d
Requires:       fontawesome-fonts-web
2f2de8d
Requires:       font(fontawesome)
2f2de8d
Requires:       font(lato)
2f2de8d
Requires:       font(robotoslab)
df74587
df74587
%description doc
df74587
User documentation for Theano.
df74587
Jerry James 2181a57
%prep
2f012fb
%autosetup -n %{pkgname}-rel-%{version}%{?rctag:%{rctag}} -p0
Jerry James 2181a57
e808ddb
# We don't need to use /usr/bin/env
e808ddb
for fil in $(grep -FRl /bin/env .); do
ed22a57
  sed -ri.orig 's,( )?(/usr)?/bin/env[[:blank:]]*python.*,%{_bindir}/python3,' $fil
e808ddb
  touch -r $fil.orig $fil
e808ddb
  rm $fil.orig
e808ddb
done
e808ddb
6acf609
# We don't have a git checkout, so don't invoke git to find the commit
6acf609
sed -i 's/@@tag@@/%{commit}/' doc/conf.py
6acf609
Jerry James 2181a57
%build
Jerry James ad8e482
# Regenerate the Cython files, and fix the numpy interfaces
062ec9e
cython -3 -o theano/scan_module/c_code/scan_perform.c \
062ec9e
             theano/scan_module/scan_perform.pyx
Jerry James ad8e482
sed -e 's/\(__pyx_v_self\)->descr/PyArray_DESCR(\1)/' \
Jerry James ad8e482
    -e 's/\(__pyx_v_arr\)->base = \(.*\);/PyArray_SetBaseObject(\1, \2);/' \
Jerry James ad8e482
    -e 's/\(__pyx_v_arr\)->base/PyArray_BASE(\1)/' \
062ec9e
    -i theano/scan_module/c_code/scan_perform.c
Jerry James be8f770
df74587
%py3_build
Jerry James 2181a57
Jerry James 2181a57
# Build the documentation
Jerry James 2181a57
export PYTHONPATH=$PWD
ed22a57
%{__python3} doc/scripts/docgen.py --nopdf
2f2de8d
rst2html --no-datestamp README.rst README.html
Jerry James 2181a57
Jerry James 2181a57
# Remove build artifacts
Jerry James 2181a57
rm -fr html/.buildinfo html/.doctrees
Jerry James 2181a57
2f2de8d
# Do not bundle fonts into the documentation
2f2de8d
cd html/_static/fonts
2f2de8d
for suffix in eot svg ttf woff woff2; do
2f2de8d
  rm fontawesome-webfont.$suffix
2f2de8d
  ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.$suffix .
2f2de8d
done
2f2de8d
rm {Lato,RobotoSlab}/*.ttf
2f2de8d
ln -s %{_datadir}/fonts/lato/Lato-Bold.ttf Lato/lato-bold.ttf
2f2de8d
ln -s %{_datadir}/fonts/lato/Lato-BoldItalic.ttf Lato/lato-bolditalic.ttf
2f2de8d
ln -s %{_datadir}/fonts/lato/Lato-Italic.ttf Lato/lato-italic.ttf
2f2de8d
ln -s %{_datadir}/fonts/lato/Lato-Regular.ttf Lato/lato-regular.ttf
2f2de8d
ln -s %{_datadir}/fonts/google-roboto-slab/RobotoSlab-Bold.ttf RobotoSlab/roboto-slab-v7-bold.ttf
2f2de8d
ln -s %{_datadir}/fonts/google-roboto-slab/RobotoSlab-Regular.ttf RobotoSlab/roboto-slab-v7-regular.ttf
2f2de8d
cd -
2f2de8d
Jerry James 2181a57
%install
df74587
%py3_install
Jerry James 2181a57
Jerry James 2181a57
# Restore executable permission on the scripts
Jerry James 2181a57
chmod a+x $(find %{buildroot} -name \*.py -o -name \*.sh | xargs grep -l '^#!')
Jerry James 2181a57
Jerry James ad8e482
%check
fe309e6
%ifarch %{power64}
fe309e6
# FIXME: some tests fail on ppc64le
fe309e6
# The conv3d2d tests compute the wrong type of values (float32 instead of
fe309e6
# float64) and the wrong values.
fe309e6
sed -i '/parameterized\.expand/,$d' ttheano/tensor/nnet/tests/test_conv3d2d.py
fe309e6
fe309e6
# An unexpected GradientError is thrown at theano/gradient.py line 1790
fe309e6
rm theano/tensor/nnet/tests/test_corr3d.py
a7a1692
%endif
fe309e6
9608d55
%{__python3} bin/theano-nose --processes=0 --process-restartworker
Jerry James 2181a57
df74587
%files -n python3-%{srcname}
2f2de8d
%doc DESCRIPTION.txt HISTORY.txt NEWS.txt README.html
f5f4997
%license doc/LICENSE.txt
Jerry James be8f770
%{_bindir}/theano-*
ed22a57
%{python3_sitelib}/Theano-*.egg-info/
ed22a57
%{python3_sitelib}/theano/
062ec9e
%{python3_sitelib}/bin/
Jerry James be8f770
df74587
%files doc
df74587
%doc html
df74587
Jerry James 2181a57
%changelog
dc53b8f
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-5.1
dc53b8f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
dc53b8f
2f2de8d
* Mon Nov 25 2019 Jerry James <loganjerry@gmail.com> - 1.0.4-5
2f2de8d
- Drop epydoc BR since it has been retired
2f2de8d
- Unbundle fonts from the documentation
2f2de8d
- Ship an HTML form of the README
e1ee68e
- Add -has-sorted-indices patch
2f2de8d
c033815
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.0.4-4.1
c033815
- Rebuilt for Python 3.8.0rc1 (#1748018)
c033815
6acf609
* Thu Aug 29 2019 Jerry James <loganjerry@gmail.com> - 1.0.4-4
6acf609
- Add -iterable, -git, -format, -is, and -doc patches to fix warnings
6acf609
fe4076c
* Fri Aug 23 2019 Robert-André Mauchin <zebob.m@gmail.com> - 1.0.4-3
fe4076c
- Fix FTBFS with python-theano-sort patch (#1737011)
fe4076c
cb6e9ff
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.0.4-2.1
cb6e9ff
- Rebuilt for Python 3.8
cb6e9ff
3fb7ae8
* Fri Aug 16 2019 Jerry James <loganjerry@gmail.com> - 1.0.4-2
3fb7ae8
- Add -future-warning, -gammaq, -ceil-floor-trunc, -traceback, -clip, and
3fb7ae8
  -random patches to fix FTBFS (bz 1737011)
3fb7ae8
94f9412
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-1.2
94f9412
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
94f9412
08164f0
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-1.1
08164f0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
08164f0
9317182
* Sat Jan 19 2019 Jerry James <loganjerry@gmail.com> - 1.0.4-1
9317182
- New upstream release
9317182
eda01ef
* Thu Dec 27 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.0.3-2
eda01ef
- Drop duplicated dependencies
eda01ef
062ec9e
* Sat Oct  6 2018 Jerry James <loganjerry@gmail.com> - 1.0.3-1
062ec9e
- New upstream release
062ec9e
- Partially revert the previous commit; the gcc Requires is needed
062ec9e
- Build with openblas instead of atlas
062ec9e
- Send cython output to the correct directory
062ec9e
- Build with pygpu support
062ec9e
ed22a57
* Sun Aug 12 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.0.2-2
ed22a57
- Drop python2 subpackage
ed22a57
2b22d9c
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-1.2
2b22d9c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
2b22d9c
cdcd94f
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.0.2-1.1
cdcd94f
- Rebuilt for Python 3.7
cdcd94f
5ef9abd
* Wed May 23 2018 Jerry James <loganjerry@gmail.com> - 1.0.2-1
5ef9abd
- New upstream release
5ef9abd
8395bbc
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-1.1
8395bbc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
8395bbc
2f012fb
* Fri Dec 22 2017 Jerry James <loganjerry@gmail.com> - 1.0.1-1
2f012fb
- New upstream release
2f012fb
- Add -blas patch to fix compilation errors when using the blas interface
2f012fb
- Reenable the tests
2f012fb
- Pass nose flags to prevent memory exhaustion while running the tests
2f012fb
8dd79dc
* Fri Nov 17 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.0.0-1
8dd79dc
- Update to 1.0.0
8dd79dc
3adf02b
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-1.1
3adf02b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
3adf02b
33d1a2b
* Wed Mar 22 2017 Jerry James <loganjerry@gmail.com> - 0.9.0-1
33d1a2b
- New upstream release
33d1a2b
a731d6c
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.2-1.3
a731d6c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
a731d6c
c9b2a1e
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.8.2-1.2
c9b2a1e
- Rebuild for Python 3.6
c9b2a1e
7e9efdc
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.2-1.1
7e9efdc
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
7e9efdc
55e692d
* Thu Apr 21 2016 Jerry James <loganjerry@gmail.com> - 0.8.2-1
55e692d
- New upstream release
55e692d
e808ddb
* Fri Apr 15 2016 Jerry James <loganjerry@gmail.com> - 0.8.1-2
e808ddb
- Remove python2 dependency from the python3 subpackage (bz 1324232)
e808ddb
- Recommend pydot instead of requiring it
e808ddb
08412dd
* Sat Apr  2 2016 Jerry James <loganjerry@gmail.com> - 0.8.1-1
08412dd
- New upstream release
08412dd
- Fix the pydot dependencies
08412dd
70e2d03
* Wed Mar 23 2016 Jerry James <loganjerry@gmail.com> - 0.8.0-1
70e2d03
- New upstream release
70e2d03
1f84a83
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.1-0.2.a1
1f84a83
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
1f84a83
df74587
* Mon Feb  1 2016 Jerry James <loganjerry@gmail.com> - 0.7.1-0.1.a1
df74587
- Comply with latest python packaging guidelines
df74587
94bdf82
* Thu Nov 12 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.7.1-0.1.a1
94bdf82
- Update to 0.7.1a1
94bdf82
8da3af2
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.0-2.2
8da3af2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
8da3af2
df74587
* Wed Nov  4 2015 Toshio Kuratomi <toshio@fedoraproject.org> - 0.7.0-2.1
eeed55b
- Fix python3 package requiring python2.
eeed55b
a829163
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.0-1.1
a829163
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
a829163
Jerry James ad8e482
* Wed Apr  1 2015 Jerry James <loganjerry@gmail.com> - 0.7.0-1
Jerry James ad8e482
- New upstream release
Jerry James ad8e482
- Drop upstreamed -arm patch
Jerry James ad8e482
- Regenerate cython files to fix build failure
Jerry James ad8e482
410c310
* Sat Feb 21 2015 Jerry James <loganjerry@gmail.com> - 0.6.0-5
410c310
- Add -arm patch to fix build failure on arm builders due to inverted test
410c310
f5f4997
* Sat Feb 21 2015 Jerry James <loganjerry@gmail.com> - 0.6.0-4
f5f4997
- Drop workaround for fixed bug (bz 1075826)
f5f4997
- Use license macro
f5f4997
f517f04
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-3.1
f517f04
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
f517f04
Jerry James fd4a43f
* Wed May 14 2014 Jerry James <loganjerry@gmail.com> - 0.6.0-3
Jerry James fd4a43f
- Rebuild for https://fedoraproject.org/wiki/Changes/Python_3.4
Jerry James fd4a43f
Jerry James be8f770
* Thu Mar 13 2014 Jerry James <loganjerry@gmail.com> - 0.6.0-2
Jerry James be8f770
- Add python3 subpackage
Jerry James be8f770
- Add another icon to the -missing tarball
Jerry James be8f770
- Update source icons
Jerry James be8f770
- Unbundle python-six
Jerry James be8f770
- Add workaround for bz 1075826
Jerry James be8f770
bfed893
* Sat Dec  7 2013 Jerry James <loganjerry@gmail.com> - 0.6.0-1
bfed893
- New upstream release
bfed893
- Drop upstreamed -import patch
bfed893
Jerry James 2181a57
* Mon Oct 21 2013 Jerry James <loganjerry@gmail.com> - 0.6.0-0.1.rc3
Jerry James 2181a57
- Add the -import patch to fix an exception
Jerry James 2181a57
- Add more files to the base package docs
Jerry James 2181a57
Jerry James 2181a57
* Tue Aug 27 2013 Jerry James <loganjerry@gmail.com> - 0.6.0-0.rc3
Jerry James 2181a57
- Initial RPM