Add upstream patch, pin test dependency versions to fix python-daemon ptests (#6900)

This commit is contained in:
Olivia Crain 2023-12-07 09:46:44 -06:00 коммит произвёл GitHub
Родитель b1bbba05f0
Коммит a56940a4b1
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 45 добавлений и 6 удалений

Просмотреть файл

@ -0,0 +1,31 @@
From 74a3f2f56d1343db18613f3bf0ea908a3d16910c Mon Sep 17 00:00:00 2001
From: Ben Finney <ben+python@benfinney.id.au>
Date: Thu, 4 Apr 2019 08:05:19 +0000
Subject: [PATCH] =?UTF-8?q?Create=20the=20socket=20and=20catch=20=E2=80=9C?=
=?UTF-8?q?non-socket=E2=80=9D=20errors.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
daemon/daemon.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/daemon/daemon.py b/daemon/daemon.py
index f7cbaa2..d75b2c0 100644
--- a/daemon/daemon.py
+++ b/daemon/daemon.py
@@ -761,9 +761,8 @@ def is_socket(fd):
"""
result = False
- file_socket = socket.fromfd(fd, socket.AF_INET, socket.SOCK_RAW)
-
try:
+ file_socket = socket.fromfd(fd, socket.AF_INET, socket.SOCK_RAW)
file_socket.getsockopt(socket.SOL_SOCKET, socket.SO_TYPE)
except socket.error as exc:
exc_errno = exc.args[0]
--
2.41.0

Просмотреть файл

@ -1,13 +1,15 @@
Summary: Library to implement a well-behaved Unix daemon process.
Name: python-daemon
Version: 2.2.0
Release: 6%{?dist}
License: ASL 2.0
Release: 7%{?dist}
License: Apache-2.0
Vendor: Microsoft Corporation
Distribution: Mariner
Group: Development/Languages/Python
URL: https://pypi.python.org/pypi/python-daemon/
Source0: https://files.pythonhosted.org/packages/source/p/python-daemon/%{name}-%{version}.tar.gz
# Upstream: https://pagure.io/python-daemon/c/b7089121e305ef29dee9b72bfdb8b1496ffed48c
Patch0: fix-test-socket-errors.patch
BuildArch: noarch
%description
@ -35,7 +37,7 @@ daemon program. A DaemonContext instance holds the behaviour and configured proc
use the instance as a context manager to enter a daemon state.
%prep
%autosetup
%autosetup -p1
sed -i 's/distclass=version.ChangelogAwareDistribution,/ /g' setup.py
%build
@ -45,7 +47,8 @@ sed -i 's/distclass=version.ChangelogAwareDistribution,/ /g' setup.py
%py3_install
%check
pip3 install mock testscenarios testtools
# Pinned versions are the most recent releases prior to changes that break the test suite
pip3 install 'mock==4.0.3' testscenarios 'testtools==2.4.0'
%python3 -m unittest discover
%files -n python3-daemon
@ -53,10 +56,15 @@ pip3 install mock testscenarios testtools
%{python3_sitelib}/*
%changelog
* Fri Dec 03 2021 Thomas Crain <thcrain@microsoft.com> - 2.2.0-6
* Mon Dec 04 2023 Olivia Crain <oliviacrain@microsoft.com> - 2.2.0-7
- Add upstream patch to fix socket errors during tests
- Pin versions of mock, testtools from PyPI used during tests
- Use SPDX license expression in license tag
* Fri Dec 03 2021 Olivia Crain <oliviacrain@microsoft.com> - 2.2.0-6
- Replace easy_install usage with pip in %%check sections
* Wed Oct 20 2021 Thomas Crain <thcrain@microsoft.com> - 2.2.0-5
* Wed Oct 20 2021 Olivia Crain <oliviacrain@microsoft.com> - 2.2.0-5
- Add license to python3 package
- Remove python2 package
- Lint spec