From fd2f56ce32fa7b60f8cce5b0856eff469a6ca911673429d8fcfbd3faba4a2ca6 Mon Sep 17 00:00:00 2001 From: Ciaran Farrell Date: Mon, 10 Aug 2009 14:47:54 +0000 Subject: [PATCH] added doctest patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-decorator?expand=0&rev=5 --- decorator-2.3.2.tar.bz2 | 3 -- decorator-3.0.1-doctest.patch | 75 +++++++++++++++++++++++++++++++++++ decorator-3.0.1.tar.bz2 | 3 ++ decorator-3.0.1.tar.gz | 3 -- python-decorator.spec | 10 +++-- 5 files changed, 85 insertions(+), 9 deletions(-) delete mode 100644 decorator-2.3.2.tar.bz2 create mode 100644 decorator-3.0.1-doctest.patch create mode 100644 decorator-3.0.1.tar.bz2 delete mode 100644 decorator-3.0.1.tar.gz diff --git a/decorator-2.3.2.tar.bz2 b/decorator-2.3.2.tar.bz2 deleted file mode 100644 index 18d3724..0000000 --- a/decorator-2.3.2.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2a95e9e6076d5d969ae75e79724e54a9ffd4ddc19f395dfc7346fd4a02440263 -size 15458 diff --git a/decorator-3.0.1-doctest.patch b/decorator-3.0.1-doctest.patch new file mode 100644 index 0000000..fcb4055 --- /dev/null +++ b/decorator-3.0.1-doctest.patch @@ -0,0 +1,75 @@ +diff -up decorator-3.0.1/documentation.py.doctest decorator-3.0.1/documentation.py +--- decorator-3.0.1/documentation.py.doctest 2009-05-21 21:13:24.171482875 -0700 ++++ decorator-3.0.1/documentation.py 2009-05-21 21:59:01.242233871 -0700 +@@ -120,7 +120,7 @@ keyword arguments: + + >>> from inspect import getargspec + >>> print getargspec(f1) +- ([], 'args', 'kw', None) ++ ArgSpec(args=[], varargs='args', keywords='kw', defaults=None) + + This means that introspection tools such as pydoc will give + wrong informations about the signature of ``f1``. This is pretty bad: +@@ -186,7 +186,7 @@ The signature of ``heavy_computation`` i + .. code-block:: python + + >>> print getargspec(heavy_computation) +- ([], None, None, None) ++ ArgSpec(args=[], varargs=None, keywords=None, defaults=None) + + A ``trace`` decorator + ------------------------------------------------------ +@@ -219,7 +219,7 @@ and it that it has the correct signature + .. code-block:: python + + >>> print getargspec(f1) +- (['x'], None, None, None) ++ ArgSpec(args=['x'], varargs=None, keywords=None, defaults=None) + + The same decorator works with functions of any signature: + +@@ -233,7 +233,7 @@ The same decorator works with functions + calling f with args (0, 3, 2), {} + + >>> print getargspec(f) +- (['x', 'y', 'z'], 'args', 'kw', (1, 2)) ++ ArgSpec(args=['x', 'y', 'z'], varargs='args', keywords='kw', defaults=(1, 2)) + + That includes even functions with exotic signatures like the following: + +@@ -243,7 +243,7 @@ That includes even functions with exotic + ... def exotic_signature((x, y)=(1,2)): return x+y + + >>> print getargspec(exotic_signature) +- ([['x', 'y']], None, None, ((1, 2),)) ++ ArgSpec(args=[['x', 'y']], varargs=None, keywords=None, defaults=((1, 2),)) + >>> exotic_signature() + calling exotic_signature with args ((1, 2),), {} + 3 +@@ -281,7 +281,7 @@ can easily check that the signature has + .. code-block:: python + + >>> print getargspec(trace) +- (['f'], None, None, None) ++ ArgSpec(args=['f'], varargs=None, keywords=None, defaults=None) + + Therefore now ``trace`` can be used as a decorator and + the following will work: +@@ -387,13 +387,13 @@ be locked. Here is a minimalistic exampl + Each call to ``write`` will create a new writer thread, but there will + be no synchronization problems since ``write`` is locked. + +->>> write("data1") +- ++>>> write("data1") # doctest: +ELLIPSIS ++ + + >>> time.sleep(.1) # wait a bit, so we are sure data2 is written after data1 + +->>> write("data2") +- ++>>> write("data2") # doctest: +ELLIPSIS ++ + + >>> time.sleep(2) # wait for the writers to complete + diff --git a/decorator-3.0.1.tar.bz2 b/decorator-3.0.1.tar.bz2 new file mode 100644 index 0000000..10236ab --- /dev/null +++ b/decorator-3.0.1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c3b80ef5ffc06010990889c7cb9e9c6883907bb27fd8dd2e91f1a94108f3804 +size 121559 diff --git a/decorator-3.0.1.tar.gz b/decorator-3.0.1.tar.gz deleted file mode 100644 index f8a676e..0000000 --- a/decorator-3.0.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d4294afdd740b8f32f2381450b4521c812ba5d8919b57f9abaeb5ea151e6d1f3 -size 151960 diff --git a/python-decorator.spec b/python-decorator.spec index 3255ab1..7c1553e 100644 --- a/python-decorator.spec +++ b/python-decorator.spec @@ -6,10 +6,12 @@ Summary: Better Living Through Python With Decorators URL: http://www.phyast.pitt.edu/~micheles/python/documentation.html License: BSD Group: Development/Libraries/Python -Source: %{modname}-%{version}.tar.gz +Source: %{modname}-%{version}.tar.bz2 +Patch0: decorator-3.0.1-doctest.patch BuildRoot: %{_tmppath}/%{name}-buildroot %{py_requires} BuildRequires: python-devel +BuildRequires: python-nose %description As of now, writing custom decorators correctly requires some experience and it @@ -29,8 +31,10 @@ Authors: %prep %setup -q -n %{modname}-%{version} +%patch0 -p1 -b .doctest # Remove executable bits from doc files -chmod -x * +chmod a-x *.txt *.py +sed -i 's/\r//' README.txt %build export CFLAGS="$RPM_OPT_FLAGS" @@ -44,7 +48,7 @@ rm -rf %{buildroot} %files -f INSTALLED_FILES %defattr(-,root,root) -%doc CHANGES.txt README.txt corner-cases.txt documentation.txt other.txt util.py +%doc CHANGES.txt README.txt documentation.html %changelog * Mon Aug 10 2009 - Ciaran Farrell - 3.0.1-1