diff --git a/badge.png b/badge.png index a52082a..9244b2c 100644 Binary files a/badge.png and b/badge.png differ diff --git a/badge2.png b/badge2.png index c2f56e0..361baf0 100644 Binary files a/badge2.png and b/badge2.png differ diff --git a/python-theano-six.patch b/python-theano-six.patch new file mode 100644 index 0000000..284e01c --- /dev/null +++ b/python-theano-six.patch @@ -0,0 +1,251 @@ +--- ./theano/compat/__init__.py.orig 2013-12-03 10:47:22.000000000 -0700 ++++ ./theano/compat/__init__.py 2014-03-12 20:00:00.000000000 -0600 +@@ -3,9 +3,9 @@ + """ + + # Python 3.x compatibility +-from theano.compat.six import PY3, b, BytesIO, next, get_unbound_function +-from theano.compat.six.moves import configparser +-from theano.compat.six.moves import reload_module as reload ++from six import PY3, b, BytesIO, next, get_unbound_function ++from six.moves import configparser ++from six.moves import reload_module as reload + + if PY3: + +--- ./theano/compile/debugmode.py.orig 2013-12-03 10:47:22.000000000 -0700 ++++ ./theano/compile/debugmode.py 2014-03-12 20:00:00.000000000 -0600 +@@ -12,8 +12,7 @@ import numpy + + import theano + from theano import gof +-from theano.compat import get_unbound_function +-from theano.compat.six import StringIO ++from six import get_unbound_function, StringIO + from theano.gof import FunctionGraph,graph, utils, link, ops_with_inner_function + from theano.gof.link import raise_with_op + from theano.gof.cc import CLinker +--- ./theano/compile/tests/test_module.py.orig 2013-12-03 10:47:22.000000000 -0700 ++++ ./theano/compile/tests/test_module.py 2014-03-12 20:00:00.000000000 -0600 +@@ -721,7 +721,7 @@ def test_pickle_aliased_memory(): + assert m.y[0,0] == 3.14 + + import logging +- from theano.compat.six import StringIO ++ from six import StringIO + + sio = StringIO() + handler = logging.StreamHandler(sio) +--- ./theano/configparser.py.orig 2013-12-03 10:47:22.000000000 -0700 ++++ ./theano/configparser.py 2014-03-12 20:00:00.000000000 -0600 +@@ -7,7 +7,7 @@ import os + import sys + import warnings + +-from theano.compat.six import StringIO ++from six import StringIO + + import theano + from theano.compat import configparser as ConfigParser +--- ./theano/gof/cc.py.orig 2013-12-03 10:47:22.000000000 -0700 ++++ ./theano/gof/cc.py 2014-03-12 20:00:00.000000000 -0600 +@@ -10,8 +10,7 @@ from itertools import izip + + import numpy + +-from theano.compat import PY3 +-from theano.compat.six import StringIO ++from six import PY3, StringIO + + if PY3: + import hashlib +--- ./theano/gof/cmodule.py.orig 2013-12-03 10:47:22.000000000 -0700 ++++ ./theano/gof/cmodule.py 2014-03-12 20:00:00.000000000 -0600 +@@ -24,8 +24,8 @@ except ImportError: + import numpy.distutils # TODO: TensorType should handle this + + import theano +-from theano.compat import any, PY3, next, decode, decode_iter +-from theano.compat.six import BytesIO, StringIO ++from theano.compat import any, next, decode, decode_iter ++from six import PY3, BytesIO, StringIO + from theano.gof.utils import flatten + from theano.configparser import config + from theano.gof.cc import hash_from_code +--- ./theano/gof/optdb.py.orig 2013-12-03 10:47:22.000000000 -0700 ++++ ./theano/gof/optdb.py 2014-03-12 20:00:00.000000000 -0600 +@@ -3,7 +3,7 @@ import sys + from theano.gof.python25 import DefaultOrderedDict + + import numpy +-from theano.compat.six import StringIO ++from six import StringIO + from theano.gof import opt + from theano.configparser import AddConfigVar, FloatParam + from theano import config +--- ./theano/gof/opt.py.orig 2013-12-03 10:47:22.000000000 -0700 ++++ ./theano/gof/opt.py 2014-03-12 20:00:00.000000000 -0600 +@@ -296,7 +296,7 @@ class SeqOptimizer(Optimizer, list): + new_sub_profile.append(None) + + # merge not common opt +- from theano.compat.six import StringIO ++ from six import StringIO + for l in set(prof1[0]).symmetric_difference(set(prof2[0])): + #The set trick above only work for the same object optimization + #It don't work for equivalent optimization. +--- ./theano/misc/pkl_utils.py.orig 2013-12-03 10:47:22.000000000 -0700 ++++ ./theano/misc/pkl_utils.py 2014-03-12 20:00:00.000000000 -0600 +@@ -13,8 +13,7 @@ __license__ = "3-clause BSD" + import pickle + import sys + import theano +-from theano.compat import PY3 +-from theano.compat.six import string_types ++from six import PY3, string_types + + + sys.setrecursionlimit(3000) +--- ./theano/printing.py.orig 2013-12-03 10:47:22.000000000 -0700 ++++ ./theano/printing.py 2014-03-12 20:00:00.000000000 -0600 +@@ -25,7 +25,7 @@ except ImportError: + import theano + from theano import gof + from theano import config +-from theano.compat.six import StringIO ++from six import StringIO + from theano.gof import Op, Apply + from theano.gof.python25 import any + from theano.compile import Function, debugmode +--- ./theano/sandbox/cuda/basic_ops.py.orig 2013-12-03 10:47:22.000000000 -0700 ++++ ./theano/sandbox/cuda/basic_ops.py 2014-03-12 20:00:00.000000000 -0600 +@@ -7,7 +7,7 @@ import numpy + import theano + from theano import gof, Type, Apply + from theano import tensor, scalar, config +-from theano.compat.six import StringIO ++from six import StringIO + from theano.scalar import Scalar + scal = scalar # somewhere scalar gets reassigned to be a function + +--- ./theano/sandbox/cuda/blas.py.orig 2013-12-03 10:47:22.000000000 -0700 ++++ ./theano/sandbox/cuda/blas.py 2014-03-12 20:00:00.000000000 -0600 +@@ -4,7 +4,7 @@ import os + import theano + from theano import Apply + from theano import tensor +-from theano.compat.six import StringIO ++from six import StringIO + from theano.sandbox.cuda.type import CudaNdarrayType + from theano.sandbox.cuda import GpuOp + +--- ./theano/sandbox/cuda/elemwise.py.orig 2013-12-03 10:47:22.000000000 -0700 ++++ ./theano/sandbox/cuda/elemwise.py 2014-03-12 20:00:00.000000000 -0600 +@@ -13,7 +13,7 @@ import numpy + + from theano.scalar.basic import upgrade_to_float_no_complex, complex_types + from theano.scalar.basic_scipy import Erfinv +-from theano.compat.six import StringIO ++from six import StringIO + from theano import Apply, Constant, Op, Type, Variable + from theano import gof, scalar, tensor + +--- ./theano/sandbox/cuda/nnet.py.orig 2013-12-03 10:47:22.000000000 -0700 ++++ ./theano/sandbox/cuda/nnet.py 2014-03-12 20:00:00.000000000 -0600 +@@ -1,5 +1,5 @@ + from theano import Op, Apply +-from theano.compat.six import StringIO ++from six import StringIO + + from theano.sandbox.cuda import GpuOp + +--- ./theano/sandbox/cuda/type.py.orig 2013-12-03 10:47:23.000000000 -0700 ++++ ./theano/sandbox/cuda/type.py 2014-03-12 20:00:00.000000000 -0600 +@@ -9,7 +9,7 @@ import theano + from theano import Type, Variable + from theano import tensor, config + from theano import scalar as scal +-from theano.compat.six import StringIO ++from six import StringIO + + try: + # We must do those import to be able to create the full doc when nvcc +--- ./theano/tensor/opt.py.orig 2013-12-03 10:47:28.000000000 -0700 ++++ ./theano/tensor/opt.py 2014-03-12 20:00:00.000000000 -0600 +@@ -37,7 +37,7 @@ from theano.gof.opt import (Optimizer, p + from theano.gof.opt import merge_optimizer + from theano.gof import toolbox, DestroyHandler + from theano.tensor.basic import get_scalar_constant_value, ShapeError, NotScalarConstantError +-from theano.compat.six import StringIO ++from six import StringIO + + theano.configparser.AddConfigVar('on_shape_error', + "warn: print a warning and use the default" +--- ./theano/tensor/tests/test_basic.py.orig 2013-12-03 10:47:28.000000000 -0700 ++++ ./theano/tensor/tests/test_basic.py 2014-03-12 20:00:00.000000000 -0600 +@@ -18,8 +18,8 @@ from numpy.testing import dec, assert_ar + from numpy.testing.noseclasses import KnownFailureTest + + import theano +-from theano.compat import PY3, exc_message, operator_div +-from theano.compat.six import StringIO ++from theano.compat import exc_message, operator_div ++from six import PY3, StringIO + from theano import compile, config, function, gof, tensor, shared + from theano.compile import DeepCopyOp + from theano.compile.mode import get_default_mode +--- ./theano/tensor/tests/test_naacl09.py.orig 2013-12-03 10:47:28.000000000 -0700 ++++ ./theano/tensor/tests/test_naacl09.py 2014-03-12 20:00:00.000000000 -0600 +@@ -652,7 +652,7 @@ def profile_main(): + # We've renamed our original main() above to real_main() + import cProfile + import pstats +- from theano.compat.six import StringIO ++ from six import StringIO + prof = cProfile.Profile() + prof = prof.runctx("real_main()", globals(), locals()) + stream = StringIO() +--- ./theano/tensor/tests/test_opt.py.orig 2013-12-03 10:47:28.000000000 -0700 ++++ ./theano/tensor/tests/test_opt.py 2014-03-12 20:00:00.000000000 -0600 +@@ -15,7 +15,7 @@ from numpy.testing.noseclasses import Kn + + import theano + import theano.scalar as scal +-from theano.compat.six import PY3, StringIO ++from six import PY3, StringIO + from theano import compile + from theano.compile import deep_copy_op, DeepCopyOp + from theano import config +--- ./theano/tensor/tests/test_subtensor.py.orig 2013-12-03 10:47:28.000000000 -0700 ++++ ./theano/tensor/tests/test_subtensor.py 2014-03-12 20:00:00.000000000 -0600 +@@ -8,7 +8,7 @@ import numpy + + import theano + from theano.compat import exc_message +-from theano.compat.six import StringIO ++from six import StringIO + from theano.gof.python25 import any + from theano.compile import DeepCopyOp + from theano import config +--- ./theano/tests/test_determinism.py.orig 2013-12-03 10:47:28.000000000 -0700 ++++ ./theano/tests/test_determinism.py 2014-03-12 20:00:00.000000000 -0600 +@@ -9,7 +9,7 @@ from nose.plugins.skip import SkipTest + + from theano import config + from theano import shared +-from theano.compat.six import StringIO ++from six import StringIO + + def sharedX(x, name=None): + x = np.cast[config.floatX](x) +--- ./theano/tests/test_printing.py.orig 2013-12-03 10:47:28.000000000 -0700 ++++ ./theano/tests/test_printing.py 2014-03-12 20:00:00.000000000 -0600 +@@ -9,7 +9,7 @@ import theano + import theano.tensor as tensor + + from theano.printing import min_informative_str, debugprint +-from theano.compat.six import StringIO ++from six import StringIO + + def test_pydotprint_cond_highlight(): + """ diff --git a/python-theano.spec b/python-theano.spec index df2c4f2..f27ff60 100644 --- a/python-theano.spec +++ b/python-theano.spec @@ -3,7 +3,7 @@ Name: python-theano Version: 0.6.0 -Release: 1%{?rctag:.%{rctag}}%{?dist} +Release: 2%{?rctag:.%{rctag}}%{?dist} Summary: Mathematical expressions involving multidimensional arrays License: BSD @@ -20,18 +20,21 @@ Source4: badge2.png # Fix some documentation bugs Patch0: %{name}-doc.patch +# Unbundle python-six +Patch1: %{name}-six.patch BuildArch: noarch BuildRequires: atlas-devel BuildRequires: epydoc -BuildRequires: numpy +BuildRequires: numpy python3-numpy BuildRequires: pydot -BuildRequires: python2-devel -BuildRequires: python-nose -BuildRequires: python-setuptools +BuildRequires: python2-devel python3-devel +BuildRequires: python-nose python3-nose +BuildRequires: python-setuptools python3-setuptools +BuildRequires: python-six python3-six BuildRequires: python-sphinx -BuildRequires: scipy +BuildRequires: scipy python3-scipy BuildRequires: tex-dvipng Requires: atlas-devel @@ -39,6 +42,7 @@ Requires: gcc-c++ Requires: gcc-gfortran Requires: numpy Requires: pydot +Requires: python-six Requires: scipy %description @@ -63,10 +67,36 @@ Summary: Theano documentation %description doc User documentation for Theano. +%package -n python3-theano +Summary: Mathematical expressions involving multidimensional arrays +Requires: atlas-devel +Requires: gcc-c++ +Requires: gcc-gfortran +Requires: python3-numpy +Requires: python3-scipy +Requires: python3-six + +%description -n python3-theano +Theano is a Python library that allows you to define, optimize, and +evaluate mathematical expressions involving multi-dimensional arrays +efficiently. Theano features: +- tight integration with NumPy: Use numpy.ndarray in Theano-compiled + functions. +- transparent use of a GPU: Perform data-intensive calculations up to + 140x faster than with CPU.(float32 only) +- efficient symbolic differentiation: Theano does your derivatives for + function with one or many inputs. +- 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 %setup -q -n %{pkgname}-%{version}%{?rctag:.%{rctag}} %setup -q -n %{pkgname}-%{version}%{?rctag:.%{rctag}} -T -D -a 1 %patch0 +%patch1 # Don't use non-local images when building documentation cp -p %{SOURCE2} %{SOURCE3} %{SOURCE4} doc/images @@ -78,6 +108,9 @@ sed -e 's,https://.*/Theano\.png?branch=master,images/Theano.png,' \ # Remove the packaged egg rm -fr %{pkgname}.egg-info +# Remove bundled python-six +rm -f theano/compat/six.py + # Remove the shebang from a non-executable Python file for fil in theano/sandbox/neighbourhoods.py; do sed '1d' $fil > $fil.new @@ -85,26 +118,60 @@ for fil in theano/sandbox/neighbourhoods.py; do mv -f $fil.new $fil done +# Prepare for python 3 build +cp -a . %{py3dir} + # We don't need to use /usr/bin/env for fil in $(grep -FRl /usr/bin/env .); do - sed 's,/usr/bin/env[[:blank:]]*python.*,/usr/bin/python,' $fil > $fil.new + sed 's,/usr/bin/env[[:blank:]]*python.*,/usr/bin/python2,' $fil > $fil.new + touch -r $fil $fil.new + chmod a+x $fil.new + mv -f $fil.new $fil +done +for fil in $(grep -FRl /usr/bin/env %{py3dir}); do + sed 's,/usr/bin/env[[:blank:]]*python.*,/usr/bin/python3,' $fil > $fil.new touch -r $fil $fil.new chmod a+x $fil.new mv -f $fil.new $fil done +# Part 1 of workaround for bz 1075826. Remove this when that bug is resolved. +mkdir html +cp -p doc/images/theano_logo_allblue_200x46.png html + %build -python setup.py build +# The python3 build fails with Unicode errors without this +export LC_ALL=en_US.UTF-8 + +# Python 2 build +python2 setup.py build + +# Python 3 build +pushd %{py3dir} +python3 setup.py build +popd # Build the documentation export PYTHONPATH=$PWD -python doc/scripts/docgen.py --nopdf +python2 doc/scripts/docgen.py --nopdf # Remove build artifacts rm -fr html/.buildinfo html/.doctrees +# Part 2 of workaround for bz 1075826. Remove this when that bug is resolved. +rm -f html/theano_logo_allblue_200x46.png + %install -python setup.py install -O1 --skip-build --root %{buildroot} +# The python3 installation fails with Unicode errors without this +export LC_ALL=en_US.UTF-8 + +# Install python 2 build +python2 setup.py install -O1 --skip-build --root %{buildroot} + +# Install python 3 build +pushd %{py3dir} +python3 setup.py install -O1 --skip-build --root %{buildroot} +popd # Restore executable permission on the scripts chmod a+x $(find %{buildroot} -name \*.py -o -name \*.sh | xargs grep -l '^#!') @@ -117,13 +184,24 @@ chmod a+x $(find %{buildroot} -name \*.py -o -name \*.sh | xargs grep -l '^#!') %files %doc doc/LICENSE.txt DESCRIPTION.txt HISTORY.txt NEWS.txt README.txt -%{_bindir}/theano-* -%{python_sitelib}/* +%{python2_sitelib}/* %files doc %doc html +%files -n python3-theano +%doc doc/LICENSE.txt DESCRIPTION.txt HISTORY.txt NEWS.txt README.txt +%{_bindir}/theano-* +%{python3_sitelib}/* + %changelog +* Thu Mar 13 2014 Jerry James - 0.6.0-2 +- Add python3 subpackage +- Add another icon to the -missing tarball +- Update source icons +- Unbundle python-six +- Add workaround for bz 1075826 + * Sat Dec 7 2013 Jerry James - 0.6.0-1 - New upstream release - Drop upstreamed -import patch diff --git a/sources b/sources index 4cae233..0167432 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ 44df6c476d8012290a2d5bb66611126a Theano-0.6.0.tar.gz -efb79e98a7da72a91132f8c53e54c567 Theano-missing.tar.xz +765e79f33d9f4e0d818fa411c17956e8 Theano-missing.tar.xz