Compare commits

..

No commits in common. "c8s" and "c10s" have entirely different histories.
c8s ... c10s

4 changed files with 190 additions and 36 deletions

3
.gitignore vendored
View File

@ -1,2 +1 @@
SOURCES/pid-2.1.1.tar.gz /pid-*.tar.gz
/pid-2.1.1.tar.gz

View File

@ -1,65 +1,204 @@
%global srcname pid %global srcname pid
%global common_description %{expand:
pid provides a PidFile class that manages PID files. PidFile features:
- stale detection
- locking using fcntl
- chmod (default is 0o644)
- chown
- custom exceptions
PidFile can also be used as a context manager or a decorator.}
%if %{defined el6}
%bcond_without python2
# nose is too old
%bcond_with python2_tests
%endif
%if %{defined el7}
%bcond_without python2
%bcond_without python2_tests
%endif
%bcond_without python3
%bcond_without python3_tests
Name: python-%{srcname} Name: python-%{srcname}
Version: 2.1.1 Version: 2.2.3
Release: 7%{?dist} Release: 23%{?dist}
Summary: PID file management library Summary: PID file management library
License: ASL 2.0 License: Apache-2.0
URL: https://pypi.python.org/pypi/%{srcname} URL: https://github.com/trbs/pid
Source0: https://pypi.python.org/packages/source/p/%{srcname}/%{srcname}-%{version}.tar.gz Source0: %pypi_source
# https://github.com/trbs/pid/pull/23
Patch0: use-standard-library-mock-when-available.patch
BuildArch: noarch BuildArch: noarch
%description %description %{common_description}
pid provides a PidFile class that manages PID files. PidFile features:
- stale detection
- locking using fcntl
- chmod (default is 0o644)
- chown
- custom exceptions
PidFile can also be used as a context manager or a decorator. %if %{with python2}
%package -n python2-%{srcname}
Summary: %{summary}
%package -n python3-%{srcname} BuildRequires: python2-devel
Summary: PID file management library BuildRequires: python2-setuptools
%if %{with python2_tests}
BuildRequires: python2-nose >= 1.0
BuildRequires: python2-mock
%endif
BuildRequires: python3-devel %{?python_provide:%python_provide python2-%{srcname}}
BuildRequires: python3-setuptools
BuildRequires: python3-nose
%{?python_provide:%python_provide python3-%{srcname}} %description -n python2-%{srcname} %{common_description}
%endif
%description -n python3-%{srcname} %if %{with python3}
pid provides a PidFile class that manages PID files. PidFile features: %package -n python%{python3_pkgversion}-%{srcname}
- stale detection Summary: %{summary}
- locking using fcntl
- chmod (default is 0o644)
- chown
- custom exceptions
PidFile can also be used as a context manager or a decorator. BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
%if %{with python3_tests}
BuildRequires: python%{python3_pkgversion}-pytest
%endif
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
%description -n python%{python3_pkgversion}-%{srcname} %{common_description}
%endif
%prep %prep
%autosetup -n %{srcname}-%{version} # This needs to have a blank line after because of a bug in the EL6 macros
rm -rf *.egg-info %autosetup -p1 -n %{srcname}-%{version}
rm -rf %{srcname}.egg-info
%build %build
%if %{with python2}
%py2_build
%endif
%if %{with python3}
%py3_build %py3_build
%endif
%install %install
%if %{with python2}
%py2_install
%endif
%if %{with python3}
%py3_install %py3_install
%endif
%check %check
%{__python3} setup.py test %if %{with python2_tests}
PYTHONPATH=%{buildroot}%{python2_sitelib} nosetests-%{python2_version} --verbose
%endif
%if %{with python3_tests}
%pytest
%endif
%files -n python3-%{srcname} %if %{with python2}
%files -n python2-%{srcname}
%license LICENSE %license LICENSE
%doc AUTHORS CHANGELOG README.rst %doc AUTHORS CHANGELOG README.rst
%{python3_sitelib}/pid %{python2_sitelib}/%{srcname}
%{python3_sitelib}/pid-*.egg-info %{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info
%endif
%if %{with python3}
%files -n python%{python3_pkgversion}-%{srcname}
%license LICENSE
%doc AUTHORS CHANGELOG README.rst
%{python3_sitelib}/%{srcname}
%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info
%endif
%changelog %changelog
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 2.2.3-23
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 2.2.3-22
- Bump release for June 2024 mass rebuild
* Mon Jan 29 2024 David Shea <reallylongword@gmail.com> - 2.2.3-21
- Migrate to SPDX license identifier
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 2.2.3-17
- Rebuilt for Python 3.12
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 2.2.3-14
- Rebuilt for Python 3.11
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Thu Jun 03 2021 Python Maint <python-maint@redhat.com> - 2.2.3-11
- Rebuilt for Python 3.10
* Mon Feb 08 2021 Charalampos Stratakis <cstratak@redhat.com> - 2.2.3-10
- Switch the test run from nose to pytest
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Sat May 23 2020 Miro Hrončok <mhroncok@redhat.com> - 2.2.3-7
- Rebuilt for Python 3.9
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 2.2.3-5
- Rebuilt for Python 3.8.0rc1 (#1748018)
* Fri Aug 16 2019 Miro Hrončok <mhroncok@redhat.com> - 2.2.3-4
- Rebuilt for Python 3.8
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Mar 08 2019 Troy Dawson <tdawson@redhat.com> - 2.2.3-2
- Rebuilt to change main python from 3.4 to 3.6
* Tue Mar 05 2019 Carl George <carl@george.computer> - 2.2.3-1
- Latest upstream
- Build python3 subpackage on el6
- Run tests correctly
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Jun 15 2018 Miro Hrončok <mhroncok@redhat.com> - 2.1.1-8
- Rebuilt for Python 3.7
* Thu Mar 22 2018 David Shea <dshea@redhat.com> - 2.1.1-7 * Thu Mar 22 2018 David Shea <dshea@redhat.com> - 2.1.1-7
- Remove the python2 package - Remove the python2 package

View File

@ -1 +1 @@
SHA512 (pid-2.1.1.tar.gz) = 5f20338ca902d68a0c4a614b0b8229cd498712bf1750b68fa49037e9e6915c66ad562564d70d7c9308538f4302e90473a5d253dd6366bfa561f6a2248b21a45e SHA512 (pid-2.2.3.tar.gz) = c9630e8e2138ed04deb54b607629024359c94cf3009641a3e6b002511c76f27b111ac4216940398fb3ea10c5a6c4afd0f4e893cd34a67915c10107ec8cdc225c

View File

@ -0,0 +1,16 @@
diff --git a/tests/test_pid.py b/tests/test_pid.py
index 7c57c46..e36c29e 100644
--- a/tests/test_pid.py
+++ b/tests/test_pid.py
@@ -2,7 +2,10 @@
import os.path
import signal
from contextlib import contextmanager
-from mock import patch
+try:
+ from unittest.mock import patch
+except ImportError:
+ from mock import patch
import pid