]>
Commit | Line | Data |
---|---|---|
7f39570e JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # unit tests | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | Summary: FreezeGun: Let your Python 2 tests travel through time | |
8 | Summary(pl.UTF-8): FreezeGun - umożliwienie testom Pythona 2 podróżowania w czasie | |
9 | Name: python-freezegun | |
837c07bf | 10 | # keep 0.3.x here for python3 support |
750984f7 | 11 | Version: 0.3.15 |
7ad78819 | 12 | Release: 3 |
7f39570e JB |
13 | License: Apache v2.0 |
14 | Group: Libraries/Python | |
15 | #Source0Download: https://pypi.org/simple/freezegun/ | |
16 | Source0: https://files.pythonhosted.org/packages/source/f/freezegun/freezegun-%{version}.tar.gz | |
750984f7 | 17 | # Source0-md5: 20d32ddc33d79bf53b6029a265ed2fcc |
7f39570e JB |
18 | URL: https://pypi.org/project/freezegun/ |
19 | BuildRequires: rpm-pythonprov | |
20 | BuildRequires: rpmbuild(macros) >= 1.714 | |
21 | %if %{with python2} | |
43f7d4e7 | 22 | BuildRequires: python-modules >= 1:2.7 |
7f39570e JB |
23 | BuildRequires: python-setuptools |
24 | %if %{with tests} | |
25 | BuildRequires: python-dateutil >= 2.1 | |
26 | BuildRequires: python-mock | |
c7631783 | 27 | BuildRequires: python-modules-sqlite |
43f7d4e7 | 28 | BuildRequires: python-pytest |
7f39570e JB |
29 | BuildRequires: python-six |
30 | %endif | |
31 | %endif | |
32 | %if %{with python3} | |
750984f7 | 33 | BuildRequires: python3-modules >= 1:3.5 |
7f39570e JB |
34 | BuildRequires: python3-setuptools |
35 | %if %{with tests} | |
36 | BuildRequires: python3-dateutil >= 2.1 | |
43f7d4e7 | 37 | BuildRequires: python3-pytest |
7f39570e JB |
38 | BuildRequires: python3-six |
39 | %endif | |
40 | %endif | |
43f7d4e7 | 41 | Requires: python-modules >= 1:2.7 |
7f39570e JB |
42 | BuildArch: noarch |
43 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
44 | ||
45 | %description | |
46 | FreezeGun is a library that allows your Python tests to travel through | |
47 | time by mocking the datetime module. | |
48 | ||
49 | %description -l pl.UTF-8 | |
50 | FreezeGun to biblioteka pozwalająca testom w Pythonie podróżowanie w | |
51 | czasie dzięki atrapie modułu datetime. | |
52 | ||
53 | %package -n python3-freezegun | |
54 | Summary: FreezeGun: Let your Python 3 tests travel through time | |
55 | Summary(pl.UTF-8): FreezeGun - umożliwienie testom Pythona 3 podróżowania w czasie | |
56 | Group: Libraries/Python | |
750984f7 | 57 | Requires: python3-modules >= 1:3.5 |
7f39570e JB |
58 | |
59 | %description -n python3-freezegun | |
60 | FreezeGun is a library that allows your Python tests to travel through | |
61 | time by mocking the datetime module. | |
62 | ||
63 | %description -n python3-freezegun -l pl.UTF-8 | |
64 | FreezeGun to biblioteka pozwalająca testom w Pythonie podróżowanie w | |
65 | czasie dzięki atrapie modułu datetime. | |
66 | ||
67 | %prep | |
68 | %setup -q -n freezegun-%{version} | |
7f39570e JB |
69 | |
70 | %build | |
71 | %if %{with python2} | |
72 | %py_build | |
73 | ||
74 | %if %{with tests} | |
837c07bf | 75 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
43f7d4e7 | 76 | %{__python} -m pytest tests |
7f39570e JB |
77 | %endif |
78 | %endif | |
79 | ||
80 | %if %{with python3} | |
81 | %py3_build | |
82 | ||
83 | %if %{with tests} | |
837c07bf | 84 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
750984f7 | 85 | %{__python3} -m pytest tests |
7f39570e JB |
86 | %endif |
87 | %endif | |
88 | ||
89 | %install | |
90 | rm -rf $RPM_BUILD_ROOT | |
91 | ||
92 | %if %{with python2} | |
93 | %py_install | |
94 | ||
95 | %py_postclean | |
96 | %endif | |
97 | ||
98 | %if %{with python3} | |
99 | %py3_install | |
100 | %endif | |
101 | ||
102 | %clean | |
103 | rm -rf $RPM_BUILD_ROOT | |
104 | ||
105 | %if %{with python2} | |
106 | %files | |
107 | %defattr(644,root,root,755) | |
108 | %doc AUTHORS.rst CHANGELOG README.rst | |
109 | %{py_sitescriptdir}/freezegun | |
110 | %{py_sitescriptdir}/freezegun-%{version}-py*.egg-info | |
111 | %endif | |
112 | ||
113 | %if %{with python3} | |
114 | %files -n python3-freezegun | |
115 | %defattr(644,root,root,755) | |
116 | %doc AUTHORS.rst CHANGELOG README.rst | |
117 | %{py3_sitescriptdir}/freezegun | |
118 | %{py3_sitescriptdir}/freezegun-%{version}-py*.egg-info | |
119 | %endif |