diff --git a/.gitignore b/.gitignore index 4a79d5b..2646ca4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /flexmock-0.9.2.tar.gz /python-flexmock-0.9.2-tests.tgz +/flexmock-0.9.4.tar.gz +/python-flexmock-0.9.4-tests.tgz diff --git a/python-flexmock-proper-reset-of-subclass-methods.patch b/python-flexmock-proper-reset-of-subclass-methods.patch deleted file mode 100644 index 402eff8..0000000 --- a/python-flexmock-proper-reset-of-subclass-methods.patch +++ /dev/null @@ -1,19 +0,0 @@ -commit ae8f5b79d03730d8f48d355ef4a2637c975fe3d3 -Author: Herman Sheremetyev -Date: Wed Feb 15 01:02:05 2012 +0900 - - Closes #66 fix reseting sublcass methods - -diff --git a/flexmock.py b/flexmock.py -index 4f4700e..4babbb5 100644 ---- a/flexmock.py -+++ b/flexmock.py -@@ -482,8 +482,6 @@ class Expectation(object): - if (hasattr(_mock, '__dict__') and - method in _mock.__dict__ and - type(_mock.__dict__) is dict): -- del _mock.__dict__[method] -- if not hasattr(_mock, method): - _mock.__dict__[method] = original_method - else: - setattr(_mock, method, original_method) diff --git a/python-flexmock.spec b/python-flexmock.spec index 95be88d..770a864 100644 --- a/python-flexmock.spec +++ b/python-flexmock.spec @@ -1,22 +1,26 @@ +%global with_python3 1 + Name: python-flexmock -Version: 0.9.2 +Version: 0.9.4 Release: 1%{?dist} Summary: Testing library that makes it easy to create mocks, stubs and fakes License: BSD URL: https://github.com/has207/flexmock -Source0: http://pypi.python.org/packages/source/f/flexmock/flexmock-0.9.2.tar.gz +Source0: http://pypi.python.org/packages/source/f/flexmock/flexmock-0.9.4.tar.gz # git clone https://github.com/has207/flexmock.git && cd flexmock -# should checkout the current version for tests, but we also want the test for the patch -# tar -czf python-flexmock-0.9.2-tests.tgz tests/ +# git checkout 0.9.4 && tar -czf python-flexmock-0.9.4-tests.tgz tests/ Source1: %{name}-%{version}-tests.tgz -Patch0: %{name}-proper-reset-of-subclass-methods.patch - BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools +%if 0%{with_python3} +BuildRequires: python3-devel +BuildRequires: python3-setuptools +%endif + %description Flexmock is a testing library for Python that makes it easy to create mocks, @@ -25,30 +29,80 @@ Python flexmock is not a clone of the Ruby version. It omits a number of redundancies in the Ruby flexmock API, alters some defaults, and introduces a number of Python-only features. + +%if 0%{?with_python3} +%package -n python3-flexmock +Summary: Testing library that makes it easy to create mocks, stubs and fakes + +%description -n python3-flexmock +Flexmock is a testing library for Python that makes it easy to create mocks, +stubs and fakes. The API is inspired by a Ruby library of the same name, but +Python flexmock is not a clone of the Ruby version. It omits a number of +redundancies in the Ruby flexmock API, alters some defaults, and introduces +a number of Python-only features. +%endif # with_python3 + + %prep %setup -q -n flexmock-%{version} -%patch0 -p1 +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' +%endif # with_python3 + %build %{__python} setup.py build +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py build +popd +%endif # with_python3 + %install -rm -rf %{buildroot} +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install --skip-build --root %{buildroot} +popd +%endif # with_python3 + %{__python} setup.py install -O1 --skip-build --root %{buildroot} + %check pushd ./build/lib tar xzf %{SOURCE1} PYTHONPATH="." %{__python} tests/flexmock_unittest_test.py popd +%if 0%{?with_python3} +pushd %{py3dir}/build/lib +tar xzf %{SOURCE1} +PYTHONPATH="." %{__python3} tests/flexmock_unittest_test.py +popd +%endif + %files +%doc LICENSE README.md CHANGELOG %{python_sitelib}/* +%if 0%{?with_python3} +%files -n python3-flexmock +%doc LICENSE README.md CHANGELOG +%{python3_sitelib}/* +%endif %changelog +* Fri May 25 2012 Bohuslav Kabrda - 0.9.4-1 +- Update to flexmock 0.9.4. +- The patch is now part of upstream => remove it. +- Introduce Python 3 subpackage. +- Add documentation files, that are now part of source package. + * Tue Feb 21 2012 Bohuslav Kabrda - 0.9.2-1 - Initial package. diff --git a/sources b/sources index e2b7f18..cccc44b 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -5d724b9dd2566b84633534c1e4076eea flexmock-0.9.2.tar.gz -e91f9efe140ea78977ee65c7c345cfc1 python-flexmock-0.9.2-tests.tgz +69c3186ff2d313794800b07cad34a209 flexmock-0.9.4.tar.gz +a945b7bf98857802b377a6e9176fb050 python-flexmock-0.9.4-tests.tgz