From e65fb65a1f29ff123b7826e51e75ecea6f3d8c8d Mon Sep 17 00:00:00 2001 From: konradm Date: Mon, 15 Feb 2010 14:36:42 +0000 Subject: [PATCH] - Patch around private copy nicely; avoid breakage from trying to replace a directory with a symlink. --- sympy-0.6.6-strip-internal-mpmath.diff | 379 +++++++++++++++++++++++++ sympy.spec | 15 +- 2 files changed, 389 insertions(+), 5 deletions(-) create mode 100644 sympy-0.6.6-strip-internal-mpmath.diff diff --git a/sympy-0.6.6-strip-internal-mpmath.diff b/sympy-0.6.6-strip-internal-mpmath.diff new file mode 100644 index 0000000..99e0c64 --- /dev/null +++ b/sympy-0.6.6-strip-internal-mpmath.diff @@ -0,0 +1,379 @@ +diff -urN sympy-0.6.6.orig/examples/advanced/pidigits.py sympy-0.6.6-modified/examples/advanced/pidigits.py +--- sympy-0.6.6.orig/examples/advanced/pidigits.py 2009-12-19 17:12:24.000000000 -0800 ++++ sympy-0.6.6-modified/examples/advanced/pidigits.py 2010-02-15 06:23:53.196245619 -0800 +@@ -5,8 +5,8 @@ + computation of the digits of pi. + """ + +-from sympy.mpmath import libmpf +-from sympy.mpmath import functions as mpf_funs ++from mpmath import libmpf ++from mpmath import functions as mpf_funs + + import math + from time import clock +diff -urN sympy-0.6.6.orig/setup.py sympy-0.6.6-modified/setup.py +--- sympy-0.6.6.orig/setup.py 2009-12-20 04:29:20.000000000 -0800 ++++ sympy-0.6.6-modified/setup.py 2010-02-15 06:14:07.930249701 -0800 +@@ -63,7 +63,6 @@ + 'sympy.logic', + 'sympy.logic.algorithms', + 'sympy.logic.utilities', +- 'sympy.mpmath', + 'sympy.polys', + 'sympy.printing', + 'sympy.printing.pretty', +@@ -165,7 +164,6 @@ + 'sympy.integrals.tests', + 'sympy.logic.tests', + 'sympy.matrices.tests', +- 'sympy.mpmath.tests', + 'sympy.ntheory.tests', + 'sympy.parsing.tests', + 'sympy.physics.tests', +diff -urN sympy-0.6.6.orig/sympy/core/basic.py sympy-0.6.6-modified/sympy/core/basic.py +--- sympy-0.6.6.orig/sympy/core/basic.py 2009-12-20 04:29:20.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/core/basic.py 2010-02-15 06:22:02.585370625 -0800 +@@ -1,6 +1,6 @@ + """Base class for all objects in sympy""" + +-import sympy.mpmath as mpmath ++import mpmath + + from decorators import _sympifyit + from assumptions import AssumeMeths, make__get_assumption +diff -urN sympy-0.6.6.orig/sympy/core/evalf.py sympy-0.6.6-modified/sympy/core/evalf.py +--- sympy-0.6.6.orig/sympy/core/evalf.py 2009-12-19 17:12:24.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/core/evalf.py 2010-02-15 06:21:20.444640314 -0800 +@@ -3,21 +3,21 @@ + for mathematical functions. + """ + +-from sympy.mpmath.libmpf import (from_int, from_rational, fzero, normalize, ++from mpmath.libmpf import (from_int, from_rational, fzero, normalize, + bitcount, round_nearest, to_str, fone, fnone, fhalf, from_float, + to_float, fnone, to_int, mpf_lt, mpf_sqrt, mpf_cmp, mpf_abs, + mpf_pow_int, mpf_shift, mpf_add, mpf_mul, mpf_neg) + +-import sympy.mpmath.libmpc as libmpc +-from sympy.mpmath.settings import dps_to_prec +-from sympy.mpmath import mpf, mpc, quadts, quadosc, mp, make_mpf +-from sympy.mpmath.libelefun import mpf_pi, mpf_log, mpf_pow, mpf_sin, mpf_cos, \ ++import mpmath.libmpc as libmpc ++from mpmath.settings import dps_to_prec ++from mpmath import mpf, mpc, quadts, quadosc, mp, make_mpf ++from mpmath.libelefun import mpf_pi, mpf_log, mpf_pow, mpf_sin, mpf_cos, \ + mpf_atan, mpf_atan2, mpf_e, mpf_exp +-from sympy.mpmath.libmpf import MP_BASE, from_man_exp +-from sympy.mpmath.calculus import nsum +-from sympy.mpmath import inf as mpmath_inf ++from mpmath.libmpf import MP_BASE, from_man_exp ++from mpmath.calculus import nsum ++from mpmath import inf as mpmath_inf + +-from sympy.mpmath.gammazeta import mpf_bernoulli ++from mpmath.gammazeta import mpf_bernoulli + + import math + +diff -urN sympy-0.6.6.orig/sympy/core/function.py sympy-0.6.6-modified/sympy/core/function.py +--- sympy-0.6.6.orig/sympy/core/function.py 2009-12-20 04:29:20.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/core/function.py 2010-02-15 06:20:22.225245372 -0800 +@@ -40,7 +40,7 @@ + from sympy.utilities.decorator import deprecated + from sympy.utilities import all + +-from sympy import mpmath ++import mpmath + + class PoleError(Exception): + pass +diff -urN sympy-0.6.6.orig/sympy/core/numbers.py sympy-0.6.6-modified/sympy/core/numbers.py +--- sympy-0.6.6.orig/sympy/core/numbers.py 2009-12-19 17:12:24.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/core/numbers.py 2010-02-15 06:20:52.952471587 -0800 +@@ -1,10 +1,10 @@ + from basic import Atom, SingletonMeta, S, Basic + from decorators import _sympifyit + from cache import Memoizer, cacheit, clear_cache +-import sympy.mpmath as mpmath +-import sympy.mpmath.libmpf as mlib +-import sympy.mpmath.libmpc as mlibc +-from sympy.mpmath.libelefun import mpf_pow, mpf_pi, mpf_e, phi_fixed ++import mpmath ++import mpmath.libmpf as mlib ++import mpmath.libmpc as mlibc ++from mpmath.libelefun import mpf_pow, mpf_pi, mpf_e, phi_fixed + import decimal + + rnd = mlib.round_nearest +diff -urN sympy-0.6.6.orig/sympy/core/power.py sympy-0.6.6-modified/sympy/core/power.py +--- sympy-0.6.6.orig/sympy/core/power.py 2009-12-20 04:29:21.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/core/power.py 2010-02-15 06:19:48.239370607 -0800 +@@ -3,7 +3,7 @@ + from cache import cacheit + from symbol import Symbol, Wild + +-from sympy import mpmath ++import mpmath + + from math import log as _log + +diff -urN sympy-0.6.6.orig/sympy/core/sets.py sympy-0.6.6-modified/sympy/core/sets.py +--- sympy-0.6.6.orig/sympy/core/sets.py 2009-12-19 17:12:24.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/core/sets.py 2010-02-15 06:21:35.536860851 -0800 +@@ -1,6 +1,6 @@ + from basic import Basic, SingletonMeta, S + from sympify import _sympify +-from sympy.mpmath import mpi ++from mpmath import mpi + + class Set(Basic): + """ +diff -urN sympy-0.6.6.orig/sympy/core/tests/test_numbers.py sympy-0.6.6-modified/sympy/core/tests/test_numbers.py +--- sympy-0.6.6.orig/sympy/core/tests/test_numbers.py 2009-12-19 17:12:24.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/core/tests/test_numbers.py 2010-02-15 06:21:48.085245775 -0800 +@@ -4,7 +4,7 @@ + + from sympy.core.numbers import igcd, ilcm, igcdex, seterr + from sympy.utilities.pytest import raises +-from sympy import mpmath ++import mpmath + + def test_seterr(): + seterr(divide = True) +diff -urN sympy-0.6.6.orig/sympy/core/tests/test_sets.py sympy-0.6.6-modified/sympy/core/tests/test_sets.py +--- sympy-0.6.6.orig/sympy/core/tests/test_sets.py 2009-12-19 17:12:24.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/core/tests/test_sets.py 2010-02-15 06:21:52.860388990 -0800 +@@ -1,5 +1,5 @@ + from sympy import Symbol, Set, Union, Interval, oo, S, Inequality, max_, min_, raises +-from sympy.mpmath import mpi ++from mpmath import mpi + + def test_interval_arguments(): + assert Interval(0, oo) == Interval(0, oo, False, True) +diff -urN sympy-0.6.6.orig/sympy/functions/combinatorial/numbers.py sympy-0.6.6-modified/sympy/functions/combinatorial/numbers.py +--- sympy-0.6.6.orig/sympy/functions/combinatorial/numbers.py 2009-12-19 17:12:24.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/functions/combinatorial/numbers.py 2010-02-15 06:18:17.542245639 -0800 +@@ -9,7 +9,7 @@ + + from sympy import Function, S, Symbol, Rational, oo, Integer, C + +-from sympy.mpmath import bernfrac ++from mpmath import bernfrac + + from sympy.utilities.decorator import deprecated + +diff -urN sympy-0.6.6.orig/sympy/functions/special/error_functions.py sympy-0.6.6-modified/sympy/functions/special/error_functions.py +--- sympy-0.6.6.orig/sympy/functions/special/error_functions.py 2009-12-19 17:12:24.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/functions/special/error_functions.py 2010-02-15 06:18:37.521329185 -0800 +@@ -70,6 +70,6 @@ + if arg.is_Number: + # XXX: Temporary hack. FIX THIS + from sympy.core.numbers import Real +- from sympy.mpmath import erf ++ from mpmath import erf + e = erf(float(arg)) + return Real(str(e)) +diff -urN sympy-0.6.6.orig/sympy/matrices/matrices.py sympy-0.6.6-modified/sympy/matrices/matrices.py +--- sympy-0.6.6.orig/sympy/matrices/matrices.py 2009-12-19 17:12:24.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/matrices/matrices.py 2010-02-15 06:15:24.782442547 -0800 +@@ -804,7 +804,7 @@ + self is the coefficient matrix A and rhs is the right side b. + + This is for symbolic matrices, for real or complex ones use +- sympy.mpmath.lu_solve or sympy.mpmath.qr_solve. ++ mpmath.lu_solve or mpmath.qr_solve. + """ + assert rhs.rows == self.rows + A, perm = self.LUdecomposition_Simple(iszerofunc=_iszero) +@@ -1023,7 +1023,7 @@ + to use QRsolve. + + This is mainly for educational purposes and symbolic matrices, for real +- (or complex) matrices use sympy.mpmath.qr_solve. ++ (or complex) matrices use mpmath.qr_solve. + """ + + Q, R = self.QRdecomposition() +diff -urN sympy-0.6.6.orig/sympy/ntheory/partitions_.py sympy-0.6.6-modified/sympy/ntheory/partitions_.py +--- sympy-0.6.6.orig/sympy/ntheory/partitions_.py 2009-12-19 17:12:24.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/ntheory/partitions_.py 2010-02-15 06:15:59.115371173 -0800 +@@ -1,8 +1,8 @@ +-from sympy.mpmath.libmpf import (fzero, ++from mpmath.libmpf import (fzero, + from_man_exp, from_int, from_rational, + fone, ftwo, fhalf, bitcount, to_int, to_str, mpf_mul, mpf_div, mpf_sub, + mpf_add) +-from sympy.mpmath.libelefun import mpf_sqrt, mpf_pi, cosh_sinh, pi_fixed, \ ++from mpmath.libelefun import mpf_sqrt, mpf_pi, cosh_sinh, pi_fixed, \ + mpf_cos + from sympy.core.numbers import igcd + import math +diff -urN sympy-0.6.6.orig/sympy/polys/integerpolys.py sympy-0.6.6-modified/sympy/polys/integerpolys.py +--- sympy-0.6.6.orig/sympy/polys/integerpolys.py 2009-12-19 17:12:24.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/polys/integerpolys.py 2010-02-15 06:15:42.017245864 -0800 +@@ -15,7 +15,7 @@ + from random import randint + + from sympy.core.numbers import igcd, igcdex +-from sympy.mpmath.libmpf import isqrt ++from mpmath.libmpf import isqrt + + INT_TYPE = int + INT_ZERO = 0 +diff -urN sympy-0.6.6.orig/sympy/printing/latex.py sympy-0.6.6-modified/sympy/printing/latex.py +--- sympy-0.6.6.orig/sympy/printing/latex.py 2009-12-19 17:12:24.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/printing/latex.py 2010-02-15 06:19:13.243371216 -0800 +@@ -8,8 +8,8 @@ + from sympy.simplify import fraction + from sympy import Interval + +-import sympy.mpmath.libmpf as mlib +-from sympy.mpmath.settings import prec_to_dps ++import mpmath.libmpf as mlib ++from mpmath.settings import prec_to_dps + + import re + +diff -urN sympy-0.6.6.orig/sympy/printing/repr.py sympy-0.6.6-modified/sympy/printing/repr.py +--- sympy-0.6.6.orig/sympy/printing/repr.py 2009-12-19 17:12:24.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/printing/repr.py 2010-02-15 06:19:26.785254450 -0800 +@@ -8,8 +8,8 @@ + from printer import Printer + from sympy.printing.precedence import precedence + from sympy.core import Basic +-import sympy.mpmath.libmpf as mlib +-from sympy.mpmath.settings import prec_to_dps, repr_dps ++import mpmath.libmpf as mlib ++from mpmath.settings import prec_to_dps, repr_dps + + class ReprPrinter(Printer): + printmethod = "_sympyrepr_" +diff -urN sympy-0.6.6.orig/sympy/printing/str.py sympy-0.6.6-modified/sympy/printing/str.py +--- sympy-0.6.6.orig/sympy/printing/str.py 2009-12-19 17:12:24.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/printing/str.py 2010-02-15 06:19:31.951301823 -0800 +@@ -10,8 +10,8 @@ + from sympy.core.symbol import Symbol, Wild + from sympy.core.basic import Basic + +-import sympy.mpmath.libmpf as mlib +-from sympy.mpmath.settings import prec_to_dps ++import mpmath.libmpf as mlib ++from mpmath.settings import prec_to_dps + + class StrPrinter(Printer): + printmethod = "_sympystr_" +diff -urN sympy-0.6.6.orig/sympy/simplify/simplify.py sympy-0.6.6-modified/sympy/simplify/simplify.py +--- sympy-0.6.6.orig/sympy/simplify/simplify.py 2009-12-20 04:29:21.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/simplify/simplify.py 2010-02-15 06:18:05.473244593 -0800 +@@ -14,7 +14,7 @@ + + from sympy.polys import Poly, factor, PolynomialError + +-import sympy.mpmath as mpmath ++import mpmath + + def fraction(expr, exact=False): + """Returns a pair with expression's numerator and denominator. +diff -urN sympy-0.6.6.orig/sympy/solvers/solvers.py sympy-0.6.6-modified/sympy/solvers/solvers.py +--- sympy-0.6.6.orig/sympy/solvers/solvers.py 2009-12-20 04:29:21.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/solvers/solvers.py 2010-02-15 06:16:55.652380119 -0800 +@@ -30,7 +30,7 @@ + from sympy.utilities import any, all + from sympy.utilities.iterables import iff + from sympy.utilities.lambdify import lambdify +-from sympy.mpmath import findroot ++from mpmath import findroot + + from sympy.solvers.polysys import solve_poly_system + +@@ -746,7 +746,7 @@ + + >>> from sympy import Symbol, nsolve + >>> import sympy +- >>> sympy.mpmath.mp.dps = 15 ++ >>> mpmath.mp.dps = 15 + >>> x1 = Symbol('x1') + >>> x2 = Symbol('x2') + >>> f1 = 3 * x1**2 - 2 * x2**2 - 1 +diff -urN sympy-0.6.6.orig/sympy/solvers/tests/test_numeric.py sympy-0.6.6-modified/sympy/solvers/tests/test_numeric.py +--- sympy-0.6.6.orig/sympy/solvers/tests/test_numeric.py 2009-12-19 17:12:24.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/solvers/tests/test_numeric.py 2010-02-15 06:17:16.048245920 -0800 +@@ -1,4 +1,4 @@ +-from sympy.mpmath import mnorm, mpf ++from mpmath import mnorm, mpf + from sympy.solvers import nsolve + from sympy.utilities.lambdify import lambdify + from sympy import Symbol, Matrix, sqrt, Eq +diff -urN sympy-0.6.6.orig/sympy/statistics/distributions.py sympy-0.6.6-modified/sympy/statistics/distributions.py +--- sympy-0.6.6.orig/sympy/statistics/distributions.py 2009-12-19 17:12:24.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/statistics/distributions.py 2010-02-15 06:19:07.433245545 -0800 +@@ -129,7 +129,7 @@ + # error function is not yet implemented in SymPy but can easily be + # computed numerically + +- from sympy.mpmath import mpf, erfinv ++ from mpmath import mpf, erfinv + + # calculate y = ierf(p) by solving erf(y) - p = 0 + y = erfinv(mpf(p)) +diff -urN sympy-0.6.6.orig/sympy/statistics/tests/test_statistics.py sympy-0.6.6-modified/sympy/statistics/tests/test_statistics.py +--- sympy-0.6.6.orig/sympy/statistics/tests/test_statistics.py 2009-12-19 17:12:24.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/statistics/tests/test_statistics.py 2010-02-15 06:19:01.975496630 -0800 +@@ -4,7 +4,7 @@ + from sympy.statistics.distributions import PDF + import operator # XXX weird abs/sympy.abs conflict + +-from sympy.mpmath import mp ++from mpmath import mp + + def test_normal(): + dps, mp.dps = mp.dps, 20 +diff -urN sympy-0.6.6.orig/sympy/test_external/test_numpy.py sympy-0.6.6-modified/sympy/test_external/test_numpy.py +--- sympy-0.6.6.orig/sympy/test_external/test_numpy.py 2009-12-19 17:12:24.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/test_external/test_numpy.py 2010-02-15 06:16:16.091728064 -0800 +@@ -16,7 +16,7 @@ + from sympy import Rational, Symbol, list2numpy, sin, Real, Matrix, lambdify + import sympy + +-from sympy import mpmath ++import mpmath + mpmath.mp.dps = 16 + sin02 = mpmath.mpf("0.198669330795061215459412627") + +diff -urN sympy-0.6.6.orig/sympy/utilities/lambdify.py sympy-0.6.6-modified/sympy/utilities/lambdify.py +--- sympy-0.6.6.orig/sympy/utilities/lambdify.py 2009-12-19 17:12:24.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/utilities/lambdify.py 2010-02-15 06:17:40.527245430 -0800 +@@ -58,7 +58,7 @@ + # Available modules: + MODULES = { + "math":(MATH, MATH_TRANSLATIONS, ("from math import *",)), +- "mpmath":(MPMATH, MPMATH_TRANSLATIONS, ("from sympy.mpmath import *",)), ++ "mpmath":(MPMATH, MPMATH_TRANSLATIONS, ("from mpmath import *",)), + "numpy":(NUMPY, NUMPY_TRANSLATIONS, ("from numpy import *",)), + "sympy":(SYMPY, {}, ("from sympy.functions import *", + "from sympy.matrices import Matrix", +diff -urN sympy-0.6.6.orig/sympy/utilities/runtests.py sympy-0.6.6-modified/sympy/utilities/runtests.py +--- sympy-0.6.6.orig/sympy/utilities/runtests.py 2009-12-20 04:29:21.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/utilities/runtests.py 2010-02-15 06:23:01.443370703 -0800 +@@ -173,8 +173,6 @@ + blacklist = kwargs.get("blacklist", []) + blacklist.extend([ + "sympy/thirdparty/pyglet", # segfaults +- "doc/src/modules/mpmath", # needs to be fixed upstream +- "sympy/mpmath", # needs to be fixed upstream + "doc/src/modules/plotting.txt", # generates live plots + "sympy/plotting", # generates live plots + "sympy/utilities/compilef.py", # needs tcc +diff -urN sympy-0.6.6.orig/sympy/utilities/tests/test_lambdify.py sympy-0.6.6-modified/sympy/utilities/tests/test_lambdify.py +--- sympy-0.6.6.orig/sympy/utilities/tests/test_lambdify.py 2009-12-19 17:12:24.000000000 -0800 ++++ sympy-0.6.6-modified/sympy/utilities/tests/test_lambdify.py 2010-02-15 06:23:46.467246026 -0800 +@@ -1,7 +1,7 @@ + from sympy.utilities.pytest import XFAIL + from sympy import (symbols, lambdify, sqrt, sin, cos, pi, atan, Rational, Real, + Matrix, Lambda, exp, Integral, oo) +-from sympy import mpmath ++import mpmath + import math, sympy + + # high precision output of sin(0.2*pi) is used to detect if precision is lost unwanted diff --git a/sympy.spec b/sympy.spec index 3eaf395..ebb77bc 100644 --- a/sympy.spec +++ b/sympy.spec @@ -2,12 +2,15 @@ Name: sympy Version: 0.6.6 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A Python library for symbolic mathematics Group: Development/Languages License: BSD URL: http://code.google.com/p/sympy/ Source0: http://sympy.googlecode.com/files/%{name}-%{version}.tar.gz +# Upstream tried to graft in another project as a private copy; we rip +# it out (rhbz# 551576): +Patch0: sympy-0.6.6-strip-internal-mpmath.diff BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -24,6 +27,8 @@ Python and does not require any external libraries. %prep %setup -q +%patch0 -p1 +rm -rf sympy/mpmath doc/src/modules/mpmath %build @@ -35,10 +40,6 @@ rm -rf %{buildroot} %{__python} setup.py install -O1 --skip-build --root %{buildroot} # Remove extra files rm -f %{buildroot}%{_bindir}/{,doc}test -rm -rf %{buildroot}%{python_sitelib}/sympy/mpmath/ -pushd %{buildroot}%{python_sitelib}/sympy/ - ln -s %{python_sitelib}/mpmath/ -popd %clean rm -rf %{buildroot} @@ -54,6 +55,10 @@ rm -rf %{buildroot} %changelog +* Mon Feb 15 2010 Conrad Meyer - 0.6.6-3 +- Patch around private copy nicely; avoid breakage from trying to replace + a directory with a symlink. + * Mon Feb 15 2010 Conrad Meyer - 0.6.6-2 - Remove private copy of system lib 'mpmath' (rhbz #551576).