[packages/python-freezegun] - new
qboosh
qboosh at pld-linux.org
Sat May 26 17:21:58 CEST 2018
commit 7f39570e3bc71b162f6f400f2997773f10868ffa
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sat May 26 17:22:47 2018 +0200
- new
python-freezegun-mock.patch | 25 ++++++++++
python-freezegun.spec | 117 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 142 insertions(+)
---
diff --git a/python-freezegun.spec b/python-freezegun.spec
new file mode 100644
index 0000000..dacce4a
--- /dev/null
+++ b/python-freezegun.spec
@@ -0,0 +1,117 @@
+#
+# Conditional build:
+%bcond_without tests # unit tests
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
+
+Summary: FreezeGun: Let your Python 2 tests travel through time
+Summary(pl.UTF-8): FreezeGun - umożliwienie testom Pythona 2 podróżowania w czasie
+Name: python-freezegun
+Version: 0.3.10
+Release: 1
+License: Apache v2.0
+Group: Libraries/Python
+#Source0Download: https://pypi.org/simple/freezegun/
+Source0: https://files.pythonhosted.org/packages/source/f/freezegun/freezegun-%{version}.tar.gz
+# Source0-md5: 703b64446743c0d9f81ca9308e5097a0
+Patch0: %{name}-mock.patch
+URL: https://pypi.org/project/freezegun/
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.714
+%if %{with python2}
+BuildRequires: python-modules >= 1:2.6
+BuildRequires: python-setuptools
+%if %{with tests}
+BuildRequires: python-dateutil >= 2.1
+BuildRequires: python-mock
+BuildRequires: python-nose
+BuildRequires: python-six
+%endif
+%endif
+%if %{with python3}
+BuildRequires: python3-modules >= 1:3.3
+BuildRequires: python3-setuptools
+%if %{with tests}
+BuildRequires: python3-dateutil >= 2.1
+BuildRequires: python3-nose
+BuildRequires: python3-six
+%endif
+%endif
+Requires: python-modules >= 1:2.6
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+FreezeGun is a library that allows your Python tests to travel through
+time by mocking the datetime module.
+
+%description -l pl.UTF-8
+FreezeGun to biblioteka pozwalająca testom w Pythonie podróżowanie w
+czasie dzięki atrapie modułu datetime.
+
+%package -n python3-freezegun
+Summary: FreezeGun: Let your Python 3 tests travel through time
+Summary(pl.UTF-8): FreezeGun - umożliwienie testom Pythona 3 podróżowania w czasie
+Group: Libraries/Python
+Requires: python3-modules >= 1:3.3
+
+%description -n python3-freezegun
+FreezeGun is a library that allows your Python tests to travel through
+time by mocking the datetime module.
+
+%description -n python3-freezegun -l pl.UTF-8
+FreezeGun to biblioteka pozwalająca testom w Pythonie podróżowanie w
+czasie dzięki atrapie modułu datetime.
+
+%prep
+%setup -q -n freezegun-%{version}
+%patch0 -p1
+
+%build
+%if %{with python2}
+%py_build
+
+%if %{with tests}
+nosetests-%{py_ver} tests
+%endif
+%endif
+
+%if %{with python3}
+%py3_build
+
+%if %{with tests}
+nosetests-%{py3_ver} tests
+%endif
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%py_install
+
+%py_postclean
+%endif
+
+%if %{with python3}
+%py3_install
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS.rst CHANGELOG README.rst
+%{py_sitescriptdir}/freezegun
+%{py_sitescriptdir}/freezegun-%{version}-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-freezegun
+%defattr(644,root,root,755)
+%doc AUTHORS.rst CHANGELOG README.rst
+%{py3_sitescriptdir}/freezegun
+%{py3_sitescriptdir}/freezegun-%{version}-py*.egg-info
+%endif
diff --git a/python-freezegun-mock.patch b/python-freezegun-mock.patch
new file mode 100644
index 0000000..9092cae
--- /dev/null
+++ b/python-freezegun-mock.patch
@@ -0,0 +1,25 @@
+--- freezegun-0.3.10/tests/test_ticking.py.orig 2018-03-06 01:33:10.000000000 +0100
++++ freezegun-0.3.10/tests/test_ticking.py 2018-05-26 16:55:23.937804778 +0200
+@@ -1,6 +1,9 @@
+ import datetime
+ import time
+-import mock
++try:
++ import mock
++except ImportError:
++ from unittest import mock
+
+ from freezegun import freeze_time
+ from tests import utils
+--- freezegun-0.3.10/tests/test_utils.py.orig 2018-03-06 01:33:10.000000000 +0100
++++ freezegun-0.3.10/tests/test_utils.py 2018-05-26 16:56:12.857804217 +0200
+@@ -1,4 +1,8 @@
+-import mock
++try:
++ import mock
++except ImportError:
++ from unittest import mock
++
+ from nose.plugins import skip
+
+ from freezegun import api
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-freezegun.git/commitdiff/7f39570e3bc71b162f6f400f2997773f10868ffa
More information about the pld-cvs-commit
mailing list