Upgrade python-twisted to 22.2.0 (#2611)

* Upgrade python-twisted

* Switching to 'test' user.

* Removing outdated patch.

* Disabling multicast test not suitable for our build environment.

Co-authored-by: Pawel Winogrodzki <pawelwi@microsoft.com>
This commit is contained in:
jslobodzian 2022-03-29 16:28:41 -07:00 коммит произвёл GitHub
Родитель 701e998e4b
Коммит c6d7516e31
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 53 добавлений и 33 удалений

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

@ -0,0 +1,33 @@
From a3e49d69a8489bd7075896215d3bdde7dc242cec Mon Sep 17 00:00:00 2001
From: Pawel Winogrodzki <pawelwi@microsoft.com>
Date: Tue, 29 Mar 2022 13:55:01 -0700
Subject: [PATCH] Disable multicast test
---
src/twisted/test/test_udp.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/twisted/test/test_udp.py b/src/twisted/test/test_udp.py
index f03f27a..be263e4 100644
--- a/src/twisted/test/test_udp.py
+++ b/src/twisted/test/test_udp.py
@@ -8,7 +8,7 @@ Tests for implementations of L{IReactorUDP} and L{IReactorMulticast}.
import os
-from unittest import skipIf
+from unittest import skip, skipIf
from twisted.internet import defer, error, interfaces, protocol, reactor, udp
from twisted.internet.defer import Deferred, gatherResults, maybeDeferred
@@ -542,6 +542,7 @@ class MulticastTests(TestCase):
o.transport.setTTL(2)
self.assertEqual(o.transport.getTTL(), 2)
+ @skip("test can't run correctly in container environments")
def test_loopback(self):
"""
Test that after loopback mode has been set, multicast packets are
--
2.17.1

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

@ -1,11 +0,0 @@
--- a/src/twisted/python/test/test_setup.py 2018-09-13 19:23:17.219592749 +0530
+++ b/src/twisted/python/test/test_setup.py 2018-09-13 19:25:02.451597309 +0530
@@ -92,7 +92,7 @@ class OptionalDependenciesTests(TestCase
The extras need to be parsed with pkg_resources.parse_requirements(),
which returns a generator.
"""
- extras = dict(im_an_extra_dependency="thing")
+ extras = dict(im_an_extra_dependency=["thing"])
attrs = dict(extras_require=extras)
distribution = Distribution(attrs)

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

@ -1,11 +0,0 @@
--- a/src/twisted/test/test_udp.py 2018-09-13 19:26:34.203601284 +0530
+++ b/src/twisted/test/test_udp.py 2018-09-13 19:27:35.423603937 +0530
@@ -553,7 +553,7 @@ class MulticastTests(unittest.TestCase):
joined.addCallback(cbPacket)
def cbNoPacket(ignored):
- self.assertEqual(len(self.server.packets), 1)
+ self.assertEqual(len(self.server.packets), len(self.server.packets))
joined.addCallback(cbNoPacket)
return joined

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

@ -1,5 +1,5 @@
{
"Signatures": {
"Twisted-19.2.1.tar.bz2": "fa2c04c2d68a9be7fc3975ba4947f653a57a656776f24be58ff0fe4b9aaf3e52"
"twisted-22.2.0.tar.gz": "54904c696d8b89513a40239c9f8927a2b4b591eff4657e89932bd60753c94914"
}
}

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

@ -1,15 +1,17 @@
%global debug_package %{nil}
Summary: An asynchronous networking framework written in Python
Name: python-twisted
Version: 19.2.1
Release: 10%{?dist}
Version: 22.2.0
Release: 1%{?dist}
License: MIT
Vendor: Microsoft Corporation
Distribution: Mariner
Group: Development/Languages/Python
URL: https://twistedmatrix.com
Source0: https://pypi.python.org/packages/source/T/Twisted/Twisted-%{version}.tar.bz2
Patch0: extra_dependency.patch
Patch1: no_packet.patch
Source0: https://github.com/twisted/twisted/archive/refs/tags/twisted-%{version}.tar.gz
# Disabling UDP multicast test, which failes in container environments.
# For more details, see: https://twistedmatrix.com/trac/ticket/7494
Patch0: disable_multicast_test.patch
BuildRequires: python3-devel
BuildRequires: python3-incremental
@ -19,7 +21,10 @@ BuildRequires: python3-xml
BuildRequires: python3-zope-interface
%if %{with_check}
BuildRequires: python3-pip
BuildRequires: net-tools
BuildRequires: sudo
BuildRequires: tzdata
BuildRequires: git
%endif
AutoReqProv: no
@ -45,7 +50,7 @@ Twisted is an event-driven networking engine written in Python and licensed unde
Twisted also supports many common network protocols, including SMTP, POP3, IMAP, SSHv2, and DNS.
%prep
%autosetup -p 1 -n Twisted-%{version}
%autosetup -p 1 -n twisted-twisted-%{version}
%build
%py3_build
@ -65,9 +70,10 @@ ln -s cftp %{buildroot}/%{_bindir}/cftp3
route add -net 224.0.0.0 netmask 240.0.0.0 dev lo
chmod g+w . -R
useradd test -G root -m
pip3 install --upgrade tox
sudo -u test pip3 install --upgrade pip
sudo -u test pip3 install tox PyHamcrest cython-test-exception-raiser
chmod g+w . -R
LANG=en_US.UTF-8 sudo -u test tox -e py%{python3_version_nodots}
LANG=en_US.UTF-8 sudo -u test /home/test/.local/bin/tox -e nocov-posix-alldeps
%files -n python3-twisted
%defattr(-,root,root)
@ -92,6 +98,9 @@ LANG=en_US.UTF-8 sudo -u test tox -e py%{python3_version_nodots}
%{_bindir}/cftp3
%changelog
* Mon Mar 28 2022 Jon Slobodzian <joslobo@microsoft.com> - 22.2.0-1
- Upgrade to version 22.2.0-1
* Tue Mar 15 2022 Muhammad Falak <mwani@microsoft.com> - 19.2.1-10
- Use `py%{python3_version_nodots}` instead of harcoding `py39`

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

@ -24524,8 +24524,8 @@
"type": "other",
"other": {
"name": "python-twisted",
"version": "19.2.1",
"downloadUrl": "https://pypi.python.org/packages/source/T/Twisted/Twisted-19.2.1.tar.bz2"
"version": "22.2.0",
"downloadUrl": "https://github.com/twisted/twisted/archive/refs/tags/twisted-22.2.0.tar.gz"
}
}
},