Use time.monotonic if available (Python3 > 3.2)
Resolves: rhbz#1294335
This commit is contained in:
parent
358d51eff3
commit
528d2fd96a
16
fasteners-monotonic.patch
Normal file
16
fasteners-monotonic.patch
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
diff --git a/fasteners/_utils.py b/fasteners/_utils.py
|
||||||
|
index c5418d7..e0eff38 100644
|
||||||
|
--- a/fasteners/_utils.py
|
||||||
|
+++ b/fasteners/_utils.py
|
||||||
|
@@ -19,7 +19,10 @@
|
||||||
|
import logging
|
||||||
|
import time
|
||||||
|
|
||||||
|
-from monotonic import monotonic as now # noqa
|
||||||
|
+try:
|
||||||
|
+ from time import monotonic as now
|
||||||
|
+except ImportError:
|
||||||
|
+ from monotonic import monotonic as now
|
||||||
|
|
||||||
|
# log level for low-level debugging
|
||||||
|
BLATHER = 5
|
||||||
@ -6,12 +6,13 @@
|
|||||||
|
|
||||||
Name: python-%{pypi_name}
|
Name: python-%{pypi_name}
|
||||||
Version: 0.14.1
|
Version: 0.14.1
|
||||||
Release: 5%{?dist}
|
Release: 6%{?dist}
|
||||||
Summary: A python package that provides useful locks
|
Summary: A python package that provides useful locks
|
||||||
|
|
||||||
License: ASL 2.0
|
License: ASL 2.0
|
||||||
URL: https://github.com/harlowja/fasteners
|
URL: https://github.com/harlowja/fasteners
|
||||||
Source0: https://codeload.github.com/harlowja/fasteners/tar.gz/%{version}#/%{pypi_name}-%{version}.tar.gz
|
Source0: https://codeload.github.com/harlowja/fasteners/tar.gz/%{version}#/%{pypi_name}-%{version}.tar.gz
|
||||||
|
Patch0: fasteners-monotonic.patch
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
|
|
||||||
@ -56,41 +57,20 @@ A python package that provides useful locks.
|
|||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -qc
|
%autosetup -p1 -n %{pypi_name}-%{version}
|
||||||
mv %{pypi_name}-%{version} python2
|
|
||||||
pushd python2
|
|
||||||
|
|
||||||
# copy LICENSE etc. to top level dir
|
|
||||||
cp -a LICENSE ..
|
|
||||||
cp -a README.rst ..
|
|
||||||
|
|
||||||
popd
|
|
||||||
|
|
||||||
%if 0%{?with_python3}
|
|
||||||
cp -a python2 python3
|
|
||||||
%endif
|
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
pushd python2
|
%py2_build
|
||||||
%{__python2} setup.py build
|
|
||||||
popd
|
|
||||||
|
|
||||||
%if 0%{?with_python3}
|
%if 0%{?with_python3}
|
||||||
pushd python3
|
%py3_build
|
||||||
%{__python3} setup.py build
|
|
||||||
popd
|
|
||||||
%endif # with_python3
|
%endif # with_python3
|
||||||
|
|
||||||
%install
|
%install
|
||||||
pushd python2
|
%py2_install
|
||||||
%{__python2} setup.py install --skip-build --root %{buildroot}
|
|
||||||
popd
|
|
||||||
|
|
||||||
%if 0%{?with_python3}
|
%if 0%{?with_python3}
|
||||||
pushd python3
|
%py3_install
|
||||||
%{__python3} setup.py install --skip-build --root %{buildroot}
|
|
||||||
popd
|
|
||||||
%endif # with_python3
|
%endif # with_python3
|
||||||
|
|
||||||
%check
|
%check
|
||||||
@ -116,6 +96,11 @@ nosetests-%{python3_version}
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Aug 29 2016 Matthias Runge <mrunge@redhat.com> - 0.14.1-6
|
||||||
|
- Use time.monotonic if available (Python3 > 3.2)
|
||||||
|
patch thanks to Ville Skyttä (rhbz#1294335)
|
||||||
|
- modernize spec
|
||||||
|
|
||||||
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.14.1-5
|
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.14.1-5
|
||||||
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
|
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user