[packages/python-sure] up to 1.2.24

glen glen at pld-linux.org
Tue Sep 6 18:06:55 CEST 2016


commit b57e180406133e270f9c068efa4a51cc0f1afcb2
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Tue Sep 6 19:06:46 2016 +0300

    up to 1.2.24

 python-sure-py3_fixes.patch | 82 ---------------------------------------------
 python-sure.spec            | 27 +++++++--------
 2 files changed, 12 insertions(+), 97 deletions(-)
---
diff --git a/python-sure.spec b/python-sure.spec
index 7793b56..772cfdc 100644
--- a/python-sure.spec
+++ b/python-sure.spec
@@ -4,17 +4,17 @@
 %bcond_without	python2 # CPython 2.x module
 %bcond_without	python3 # CPython 3.x module
 
-%define 	module	sure
-Summary:	Utility belt for automated testing in python for python
+%define		module		sure
+%define		egg_name	sure
+%define		pypi_name	sure
+Summary:	Utility belt for automated testing in Python for Python
 Name:		python-%{module}
-Version:	1.2.12
-Release:	5
+Version:	1.2.24
+Release:	1
 License:	GPL v3+
 Group:		Libraries/Python
-# Source0:	https://github.com/gabrielfalcao/sure/archive/%{version}.tar.gz
-Source0:	https://pypi.python.org/packages/source/s/%{module}/%{module}-%{version}.tar.gz
-# Source0-md5:	fc57c30e76bddba68f84443ec91e7026
-Patch0:		%{name}-py3_fixes.patch
+Source0:	https://pypi.python.org/packages/source/s/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
+# Source0-md5:	a396cc3c71d551bfdb9bc45363ca05da
 URL:		https://github.com/gabrielfalcao/sure
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.710
@@ -52,7 +52,6 @@ Sure is heavily inspired by should.js.
 
 %prep
 %setup -q -n %{module}-%{version}
-%patch0 -p1
 
 %build
 %if %{with python2}
@@ -83,11 +82,9 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(644,root,root,755)
 %doc README.md
-%dir %{py_sitescriptdir}/sure
-%{py_sitescriptdir}/sure/*.py[co]
-%if "%{py_ver}" > "2.4"
-%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
-%endif
+%dir %{py_sitescriptdir}/%{module}
+%{py_sitescriptdir}/%{module}/*.py[co]
+%{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
 %endif
 
 %if %{with python3}
@@ -95,5 +92,5 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %doc  README.md
 %{py3_sitescriptdir}/%{module}
-%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
+%{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
 %endif
diff --git a/python-sure-py3_fixes.patch b/python-sure-py3_fixes.patch
deleted file mode 100644
index b3e4111..0000000
--- a/python-sure-py3_fixes.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-diff --git a/README.md b/README.md
-index 3714d29..efda4a5 100644
---- a/README.md
-+++ b/README.md
-@@ -32,7 +32,6 @@ import sure
- 
- (4).should.be.equal(2 + 2)
- (7.5).should.eql(3.5 + 4)
--(2).should.equal(8 / 4)
- 
- (3).shouldnt.be.equal(5)
- ```
-diff --git a/setup.py b/setup.py
-index a4877f6..778f8c8 100755
---- a/setup.py
-+++ b/setup.py
-@@ -18,6 +18,7 @@
- 
- import ast
- import os
-+import sys
- from setuptools import setup, find_packages
- 
- 
-@@ -41,8 +42,10 @@ def read_version():
-     return finder.version
- 
- 
--local_file = lambda *f: \
--    open(os.path.join(os.path.dirname(__file__), *f)).read()
-+def local_file( *f):
-+    if sys.version_info < (3, 0, 0):
-+        return open(os.path.join(os.path.dirname(__file__), *f)).read()
-+    return open(os.path.join(os.path.dirname(__file__), *f), encoding="utf-8").read()
- 
- 
- install_requires = ['mock', 'six']
-diff --git a/sure/old.py b/sure/old.py
-index 70822e1..13a3f74 100644
---- a/sure/old.py
-+++ b/sure/old.py
-@@ -42,10 +42,10 @@ from sure.core import itemize_length
- 
- 
- def identify_callable_location(callable_object):
--    filename = os.path.relpath(callable_object.func_code.co_filename)
--    lineno = callable_object.func_code.co_firstlineno
--    callable_name = callable_object.func_code.co_name
--    return b'{0} [{1} line {2}]'.format(callable_name, filename, lineno)
-+    filename = os.path.relpath(callable_object.__code__.co_filename)
-+    lineno = callable_object.__code__.co_firstlineno
-+    callable_name = callable_object.__code__.co_name
-+    return '{0} [{1} line {2}]'.format(callable_name, filename, lineno).encode()
- 
- 
- def is_iterable(obj):
-diff --git a/tests/test_assertion_builder.py b/tests/test_assertion_builder.py
-index 3e1cd8e..7e833e6 100644
---- a/tests/test_assertion_builder.py
-+++ b/tests/test_assertion_builder.py
-@@ -648,13 +648,19 @@ def test_throw_matching_regex():
-         raise RuntimeError('should not have reached here')
- 
-     except AssertionError as e:
--        expect(str(e)).to.equal("When calling 'blah [tests/test_assertion_builder.py line 633]' the exception message does not match. Expected to match regex: u'invalid regex'\n against:\n u'this message'")
-+        if PY3:
-+            expect(str(e)).to.equal("When calling b'blah [tests/test_assertion_builder.py line 633]' the exception message does not match. Expected to match regex: 'invalid regex'\n against:\n 'this message'")
-+        else:
-+            expect(str(e)).to.equal("When calling 'blah [tests/test_assertion_builder.py line 633]' the exception message does not match. Expected to match regex: u'invalid regex'\n against:\n u'this message'")
- 
-     try:
-         expect(blah).when.called_with(1).should.throw(ValueError, re.compile(r'invalid regex'))
-         raise RuntimeError('should not have reached here')
-     except AssertionError as e:
--        expect(str(e)).to.equal("When calling 'blah [tests/test_assertion_builder.py line 633]' the exception message does not match. Expected to match regex: u'invalid regex'\n against:\n u'this message'")
-+        if PY3:
-+            expect(str(e)).to.equal("When calling b'blah [tests/test_assertion_builder.py line 633]' the exception message does not match. Expected to match regex: 'invalid regex'\n against:\n 'this message'")
-+        else:
-+            expect(str(e)).to.equal("When calling 'blah [tests/test_assertion_builder.py line 633]' the exception message does not match. Expected to match regex: u'invalid regex'\n against:\n u'this message'")
- 
- def test_should_not_be_different():
-     ("'something'.should_not.be.different('SOMETHING'.lower())")
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-sure.git/commitdiff/b57e180406133e270f9c068efa4a51cc0f1afcb2



More information about the pld-cvs-commit mailing list