packages: python-guppy/python-guppy-python_2_7.patch (NEW), python-guppy/py...

jajcus jajcus at pld-linux.org
Mon Jan 31 15:05:22 CET 2011


Author: jajcus                       Date: Mon Jan 31 14:05:22 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- new package

---- Files affected:
packages/python-guppy:
   python-guppy-python_2_7.patch (NONE -> 1.1)  (NEW), python-guppy.spec (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/python-guppy/python-guppy-python_2_7.patch
diff -u /dev/null packages/python-guppy/python-guppy-python_2_7.patch:1.1
--- /dev/null	Mon Jan 31 15:05:22 2011
+++ packages/python-guppy/python-guppy-python_2_7.patch	Mon Jan 31 15:05:16 2011
@@ -0,0 +1,86 @@
+--- a/guppy/heapy/test/test_Part.py
++++ b/guppy/heapy/test/test_Part.py
+@@ -88,16 +88,24 @@
+ 
+ class MixedCase(support.TestCase):
+     def test_1(self):
++        import sys
+ 	x = self.iso(1, 2, 1.0, 2.0, '1', '2')
+ 	if self.allocation_behaves_as_originally:
+-	    self.aseq(str(x), """\
++            if sys.version < '2.7':
++                self.aseq(str(x), """\
+ Partition of a set of 6 objects. Total size = 112 bytes.
+  Index  Count   %     Size   % Cumulative  % Kind (class / dict of class)
+      0      2  33       56  50        56  50 str
+      1      2  33       32  29        88  79 float
+      2      2  33       24  21       112 100 int""")
+-
+-
++            else:
++                self.aseq(str(x), """\
++Partition of a set of 6 objects. Total size = 104 bytes.
++ Index  Count   %     Size   % Cumulative  % Kind (class / dict of class)
++     0      2  33       48  46        48  46 str
++     1      2  33       32  31        80  77 float
++     2      2  33       24  23       104 100 int""")
++                
+ 	for row in x.partition.get_rows():
+ 	    self.assert_(row.set <= row.kind)
+ 	 
+--- a/guppy/sets/test.py
++++ b/guppy/sets/test.py
+@@ -892,7 +892,7 @@
+ 	    except OverflowError:
+ 		pass
+ 	    else:
+-		raise 'expected ValueError'
++		raise 'expected OverflowError'
+ 
+ 	tsv(bitset([maxint]), 1)
+ 	tsv(bitset([minint]), -1)
+--- a/src/sets/bitset.c
++++ b/src/sets/bitset.c
+@@ -2017,7 +2017,11 @@
+     int cpl = 0;
+     PyObject *w = 0;
+     
+-    x = _PyLong_AsScaledDouble(v, &e);
++#if PY_VERSION_HEX >= 0x02070000
++	x = _PyLong_Frexp(v, &e);
++#else
++	x = _PyLong_AsScaledDouble(v, &e);
++#endif
+     if (x == -1 && PyErr_Occurred())
+       return -1;
+     if (x < 0) {
+@@ -2026,15 +2030,24 @@
+ 	w = PyNumber_Invert(v);
+ 	if (!w) return -1;
+ 	v = w;
++#if PY_VERSION_HEX >= 0x02070000
++	x = _PyLong_Frexp(v, &e);
++#else
+ 	x = _PyLong_AsScaledDouble(v, &e);
++#endif
+ 	if (x == -1 && PyErr_Occurred())
+ 	  return -1;
+ 	assert(x >= 0);
+     }
+-    if (x != 0)
+-      num_bits = 1.0 * e * SHIFT + log(x)/log(2) + 1;
++    if (x != 0) {
++	num_bits = e;
++#if PY_VERSION_HEX < 0x02070000
++	num_bits *= SHIFT;
++#endif
++	num_bits += log(x)/log(2) + 1;
++    }
+     else
+-      num_bits = 0;
++	num_bits = 0;
+ 	
+     num_poses = (long)(num_bits / NyBits_N + 1);
+     /* fprintf(stderr, "x %f e %d num_bits %f num_poses %ld\n", x, e, num_bits, num_poses); */
+
+

================================================================
Index: packages/python-guppy/python-guppy.spec
diff -u /dev/null packages/python-guppy/python-guppy.spec:1.1
--- /dev/null	Mon Jan 31 15:05:22 2011
+++ packages/python-guppy/python-guppy.spec	Mon Jan 31 15:05:16 2011
@@ -0,0 +1,84 @@
+# $Revision$, $Date$
+#
+# TODO:
+#	- Assetrion error at "guppy/heapy/Part.py", line 705, in __init__
+#
+%define 	module	guppy
+Summary:	Guppy - A Python Programming Environment
+Name:		python-%{module}
+Version:	0.1.9
+Release:	0.1
+License:	MIT
+Group:		Development/Languages/Python
+Source0:	http://pypi.python.org/packages/source/g/guppy/%{module}-%{version}.tar.gz
+# Source0-md5:	221c50d574277e4589cc4ae03f76727a
+Patch0:		%{name}-python_2_7.patch
+URL:		http://guppy-pe.sourceforge.net/
+BuildRequires:	python-devel
+BuildRequires:	python-distribute
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.219
+Requires:	python-modules
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Guppy-PE is a programming environment providing object and heap memory sizing,
+profiling and analysis. It includes a prototypical specification language that
+can be used to formally specify aspects of Python programs and generate tests
+and documentation from a common source. 
+
+Guppy is an umbrella package combining Heapy and GSL with support utilities
+such as the Glue module that keeps things together. 
+
+%prep
+%setup -q -n %{module}-%{version}
+%patch0 -p1
+
+%build
+CC="%{__cc}" \
+CFLAGS="%{rpmcflags}" \
+%{__python} setup.py build
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%{__python} setup.py install \
+	--skip-build \
+	--optimize=2 \
+	--root=$RPM_BUILD_ROOT
+
+%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
+%py_comp $RPM_BUILD_ROOT%{py_sitedir}
+%py_postclean
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc ANNOUNCE ChangeLog README PKG-INFO
+%dir %{py_sitedir}/%{module}
+%{py_sitedir}/%{module}/*.py[co]
+%dir %{py_sitedir}/%{module}/doc
+%{py_sitedir}/%{module}/doc/*.html
+%{py_sitedir}/%{module}/doc/*.jpg
+%dir %{py_sitedir}/%{module}/etc
+%dir %{py_sitedir}/%{module}/gsl
+%dir %{py_sitedir}/%{module}/heapy
+%dir %{py_sitedir}/%{module}/heapy/test
+%dir %{py_sitedir}/%{module}/sets
+%{py_sitedir}/%{module}/*/*.py[co]
+%{py_sitedir}/%{module}/*/test/*.py[co]
+%attr(755,root,root) %{py_sitedir}/%{module}/*/*.so
+%if "%{py_ver}" > "2.4"
+%{py_sitedir}/%{module}-*.egg-info
+%endif
+
+%define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
+%changelog
+* %{date} PLD Team <feedback at pld-linux.org>
+All persons listed below can be reached at <cvs_login>@pld-linux.org
+
+$Log$
+Revision 1.1  2011/01/31 14:05:16  jajcus
+- new package
+
================================================================


More information about the pld-cvs-commit mailing list