You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
167 lines
4.8 KiB
167 lines
4.8 KiB
%if 0%{?fedora}
|
|
%global with_python3 1
|
|
%endif
|
|
|
|
%if 0%{?rhel} && 0%{?rhel} <= 6
|
|
%{!?__python2: %global __python2 /usr/bin/python2}
|
|
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
|
|
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
|
|
%endif
|
|
|
|
%global modname freezegun
|
|
%global sum Let your Python tests travel through time
|
|
|
|
Name: python-freezegun
|
|
Version: 0.3.8
|
|
Release: 3%{?dist}
|
|
Summary: %{sum}
|
|
|
|
Group: Development/Libraries
|
|
License: ASL 2.0
|
|
URL: https://pypi.io/project/freezegun
|
|
Source0: https://pypi.io/packages/source/f/%{modname}/%{modname}-%{version}.tar.gz
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
BuildRequires: python2-devel
|
|
BuildRequires: python-setuptools
|
|
BuildRequires: python-six
|
|
BuildRequires: python-dateutil
|
|
BuildRequires: python-sure
|
|
BuildRequires: python-nose
|
|
BuildRequires: python-coverage
|
|
BuildRequires: python-mock
|
|
|
|
%if 0%{?with_python3}
|
|
BuildRequires: python3-devel
|
|
BuildRequires: python3-setuptools
|
|
BuildRequires: python3-six
|
|
BuildRequires: python3-dateutil
|
|
BuildRequires: python3-sure
|
|
BuildRequires: python3-nose
|
|
BuildRequires: python3-coverage
|
|
BuildRequires: python3-mock
|
|
%endif
|
|
|
|
%description
|
|
freezegun is a library that allows your python tests to travel through time by
|
|
mocking the datetime module.
|
|
|
|
|
|
%package -n python2-freezegun
|
|
Summary: %{sum}
|
|
Group: Development/Libraries
|
|
%{?python_provide:%python_provide python2-freezegun}
|
|
|
|
# EL packages don't provide python2-foo
|
|
Requires: python-six
|
|
Requires: python-dateutil
|
|
|
|
%description -n python2-freezegun
|
|
freezegun is a library that allows your python tests to travel through time by
|
|
mocking the datetime module. This is the Python 2 library.
|
|
|
|
|
|
%if 0%{?with_python3}
|
|
%package -n python3-freezegun
|
|
Summary: %{sum}
|
|
Group: Development/Libraries
|
|
%{?python_provide:%python_provide python3-freezegun}
|
|
|
|
Requires: python3-six
|
|
Requires: python3-dateutil
|
|
|
|
%description -n python3-freezegun
|
|
freezegun is a library that allows your python tests to travel through time by
|
|
mocking the datetime module. This is the Python 3 library.
|
|
%endif
|
|
|
|
%prep
|
|
%setup -q -n %{modname}-%{version}
|
|
|
|
# Remove bundled egg-info in case it exists
|
|
rm -rf %{modname}.egg-info
|
|
%if 0%{?with_python3}
|
|
rm -rf %{py3dir}
|
|
cp -a . %{py3dir}
|
|
%endif
|
|
|
|
%build
|
|
%{__python2} setup.py build
|
|
%if 0%{?with_python3}
|
|
pushd %{py3dir}
|
|
%{__python3} setup.py build
|
|
popd
|
|
%endif
|
|
|
|
%install
|
|
%if 0%{?with_python3}
|
|
pushd %{py3dir}
|
|
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
|
|
popd
|
|
%endif
|
|
%{__python2} setup.py install -O1 --skip-build --root=%{buildroot}
|
|
|
|
%check
|
|
%if %with python3
|
|
pushd %{py3dir}
|
|
nosetests-%{python3_version} tests/
|
|
popd
|
|
%endif
|
|
|
|
nosetests-%{python2_version} tests/
|
|
|
|
%files
|
|
%doc README.rst LICENSE
|
|
%{python2_sitelib}/%{modname}/
|
|
%{python2_sitelib}/%{modname}-%{version}*
|
|
|
|
%if 0%{?with_python3}
|
|
%files -n python3-freezegun
|
|
%doc README.rst LICENSE
|
|
%{python3_sitelib}/%{modname}/
|
|
%{python3_sitelib}/%{modname}-%{version}-*
|
|
%endif
|
|
|
|
%changelog
|
|
* Wed Dec 21 2016 Adam Williamson <awilliam@redhat.com> - 0.3.8-3
|
|
- Rebuild with Python 3.6 again (now python-sure is built)
|
|
- rename Python 2 package to python2-freezegun
|
|
|
|
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.3.8-2
|
|
- Rebuild for Python 3.6
|
|
|
|
* Tue Nov 08 2016 Ralph Bean <rbean@redhat.com> - 0.3.8-1
|
|
- new version
|
|
|
|
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.6-2
|
|
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
|
|
|
|
* Wed Apr 20 2016 Kevin Fenzi <kevin@scrye.com> - 0.3.6-1
|
|
- Update to 0.3.6. Fixes bug #1328934
|
|
|
|
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.2-4
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
|
|
|
* Wed Oct 14 2015 Robert Kuska <rkuska@redhat.com> - 0.3.2-3
|
|
- Rebuilt for Python3.5 rebuild
|
|
|
|
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.2-2
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
|
|
|
* Thu Apr 16 2015 Adam Williamson <awilliam@redhat.com> - 0.3.2-1
|
|
- latest upstream release
|
|
|
|
* Thu Jan 22 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.1.12-4
|
|
- Adjust tests to actually do something
|
|
|
|
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.12-3
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
|
|
|
* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 0.1.12-2
|
|
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
|
|
|
|
* Wed Feb 12 2014 Ralph Bean <rbean@redhat.com> - 0.1.12-1
|
|
- initial package for Fedora
|