summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Rasmus Thomsen <Rasmus.thomsen@protonmail.com> 2017-09-07 21:21:47 +0200
committerAvatar Heiko Becker <heirecka@exherbo.org> 2017-09-16 17:11:13 +0200
commit350a4d04904ddf222b99c3070c36bbc55f6730ac (patch)
tree697388dd8402a33c2e0f0ae9c1bf38f0a1a8e5d2
parent3dd62b183ba3240f2c4743c21fe976e8e6cc4905 (diff)
downloadpython-350a4d04904ddf222b99c3070c36bbc55f6730ac.tar.gz
python-350a4d04904ddf222b99c3070c36bbc55f6730ac.tar.xz
net-twisted/Twisted: initial exheres
Change-Id: I82c92b5f35198f776952393e7504695de31532c0 Reviewed-on: https://galileo.mailstation.de/gerrit/10015 Reviewed-by: Heiko Becker <heirecka@exherbo.org>
-rw-r--r--packages/net-twisted/Twisted/Twisted-17.5.0.exheres-0145
-rw-r--r--packages/net-twisted/Twisted/files/trial22
-rw-r--r--packages/net-twisted/Twisted/files/twisted-remove-tests.patch29
-rw-r--r--packages/net-twisted/Twisted/files/twisted-test-override.patch285
4 files changed, 481 insertions, 0 deletions
diff --git a/packages/net-twisted/Twisted/Twisted-17.5.0.exheres-0 b/packages/net-twisted/Twisted/Twisted-17.5.0.exheres-0
new file mode 100644
index 0000000..b16733a
--- /dev/null
+++ b/packages/net-twisted/Twisted/Twisted-17.5.0.exheres-0
@@ -0,0 +1,145 @@
+# Copyright 2017 Rasmus Thomsen <Rasmus.thomsen@protonmail.com>
+# Distributed under the terms of the GNU General Public License v2
+# Based in part upon 'twisted-17.5.0-r1.ebuild' from Gentoo, which is:
+# Copyright 1999-2017 Gentoo Foundation
+
+require setup-py [ import=setuptools has_bin=true ]
+require flag-o-matic
+require utf8-locale
+
+SUMMARY="Twisted is an event-driven networking engine"
+DESCRIPTION="Twisted is an event-based framework for internet applications,
+supporting Python 2.7 and Python 3.3+.It includes modules for many different
+purposes, including the following: twisted.web: HTTP clients and servers,
+HTML templating, and a WSGI server twisted.conch: SSHv2 and Telnet clients
+and servers and terminal emulators twisted.words: Clients and servers for
+IRC, XMPP, and other IM protocols twisted.mail: IMAPv4, POP3, SMTP clients
+and servers twisted.positioning: Tools for communicating with NMEA-compatible
+GPS receivers twisted.names: DNS client and tools for making your own DNS
+servers twisted.trial: A unit testing framework that integrates
+well with Twisted-based code"
+
+HOMEPAGE="http://twistedmatrix.com"
+
+DOWNLOADS="http://twistedmatrix.com/Releases/${PN}/$(ever range 1-2 ${PV})/${PNV}.tar.bz2"
+
+LICENCES="MIT"
+PLATFORMS="~amd64"
+SLOT="0"
+
+
+MYOPTIONS=""
+
+#TODO: python2.7 soap, http2
+DEPENDENCIES="
+ build+run:
+ dev-python/Automat[>=0.3.0][python_abis:*(-)?]
+ dev-python/constantly[>=15.1.0][python_abis:*(-)?]
+ dev-python/hyperlink[>=17.1.1][python_abis:*(-)?]
+ dev-python/idna[>=0.6][python_abis:*(-)?]
+ dev-python/incremental[>=16.1.0][python_abis:*(-)?]
+ dev-python/pyopenssl[>=16.0.0][python_abis:*(-)?]
+ dev-python/service_identity[python_abis:*(-)?]
+ dev-python/zopeinterface[>=4.0][python_abis:*(-)?]
+ (
+ !net-twisted/TwistedConch
+ !net-twisted/TwistedCore
+ !net-twisted/TwistedLore
+ !net-twisted/TwistedMail
+ !net-twisted/TwistedNames
+ !net-twisted/TwistedNews
+ !net-twisted/TwistedRunner
+ !net-twisted/TwistedWeb
+ !net-twisted/TwistedWords
+ ) [[
+ *description = [ Old Twisted packages, now provided by Twisted ]
+ *resolution = uninstall-blocked-before
+ ]]
+ test:
+ dev-python/appdirs[>=1.4.0][python_abis:*(-)?]
+ dev-python/cryptography[>=0.9.1][python_abis:*(-)?]
+ dev-python/gmpy2[python_abis:*(-)?]
+ dev-python/idna[>=0.6][python_abis:*(-)?]
+ dev-python/pyasn1[python_abis:*(-)?]
+ dev-python/pyopenssl[>=16.0.0][python_abis:*(-)?]
+ dev-python/pyserial[python_abis:*(-)?]
+ dev-python/service_identity[python_abis:*(-)?]
+ suggestion:
+ (
+ dev-python/appdirs[>=1.4.0][python_abis:*(-)?]
+ dev-python/cryptography[>=0.9.1][python_abis:*(-)?]
+ dev-python/pyasn1[python_abis:*(-)?]
+ ) [[
+ *description = [ Required for Twisted's SSHv2 implementation ]
+ ]]
+ dev-python/pyserial[python_abis:*(-)?] [[ description = [
+ Use pySerial to provide support for an asynchronous serial port transport ] ]]
+"
+
+DEFAULT_SRC_PREPARE_PATCHES=(
+ "${FILES}"/twisted-test-override.patch
+ "${FILES}"/twisted-remove-tests.patch
+)
+
+prepare_one_multibuild() {
+ # Remove since this is an upstream distribution test for making releases
+ edo rm src/twisted/python/test/test_release.py
+
+ # failing test
+ edo rm src/twisted/test/test_main.py
+
+ # Testing with pytest doesn't work, so we'll have to do it with Twisted's tool
+ edo cp "${FILES}"/trial trial
+
+ setup-py_prepare_one_multibuild
+}
+
+compile_one_multibuild() {
+ # see http://twistedmatrix.com/trac/ticket/5701
+ add-flag -fno-strict-aliasing
+
+ setup-py_compile_one_multibuild
+}
+
+test_one_multibuild() {
+ require_utf8_locale
+
+ PYWORK="${WORKBASE}/${MULTIBUILD_CLASS}/${MULTIBUILD_TARGET}/${PNV}"
+
+ esandbox allow_net --connect "inet6:::1@1024-65535"
+ esandbox allow_net "inet:0.0.0.0@0-65535"
+ esandbox allow_net --connect "inet:0.0.0.0@0-65535"
+ esandbox allow_net "unix-abstract:*"
+ esandbox allow_net --connect "inet:127.0.0.1@69"
+ esandbox allow_net --connect "inet:127.0.0.1@80"
+ esandbox allow_net --connect "inet:127.0.0.1@024-65535"
+ esandbox allow_net "unix:${TEMP%/}/tmp*"
+ esandbox allow_net "unix:${PYWORK}/_trial_temp/twisted.internet.test.test_unix/*/*/*/temp"
+ esandbox allow_net "unix:${PYWORK}/_trial_temp/twisted.test.test_unix/*/*/*/temp"
+ esandbox allow_net "unix:${PYWORK}/_trial_temp/twisted.web.test.test_tap/*/*/*/temp"
+ esandbox allow_net "unix:${PYWORK}/_trial_temp/tmp*"
+ esandbox allow_net "unix:${PYWORK}/_trial_temp/tmp*.sock"
+ # There are a few tests which consist out of random numbers
+ esandbox allow_net "unix:${PYWORK}/_trial_temp/*"
+
+ # Disable a few tests which don't play nice with sydbox
+ export TEST_OVERRIDE=1
+
+ PYTHONPATH="$(ls -d build/lib*)" edo ${PYTHON} -B trial twisted
+
+ esandbox disallow_net --connect "inet6:::1@1024-65535"
+ esandbox disallow_net "inet:0.0.0.0@065535"
+ esandbox disallow_net --connect "inet:0.0.0.0@0-65535"
+ esandbox disallow_net "unix-abstract:*"
+ esandbox disallow_net --connect "inet:127.0.0.1@69"
+ esandbox disallow_net --connect "inet:127.0.0.1@80"
+ esandbox disallow_net --connect "inet:127.0.0.1@024-65535"
+ esandbox disallow_net "unix:${PYWORK}/_trial_temp/twisted.internet.test.test_unix/*/*/*/temp"
+ esandbox disallow_net "unix:${PYWORK}/_trial_temp/twisted.test.test_unix/*/*/*/temp"
+ esandbox disallow_net "unix:${PYWORK}/_trial_temp/twisted.web.test.test_tap/*/*/*/temp"
+ esandbox disallow_net "unix:${PYWORK}/_trial_temp/tmp*"
+ esandbox disallow_net "unix:${PYWORK}/_trial_temp/tmp*.sock"
+ esandbox disallow_net "unix:${PYWORK}/_trial_temp/*"
+ esandbox disallow_net "unix:${TEMP%/}/tmp*"
+}
+
diff --git a/packages/net-twisted/Twisted/files/trial b/packages/net-twisted/Twisted/files/trial
new file mode 100644
index 0000000..8da5886
--- /dev/null
+++ b/packages/net-twisted/Twisted/files/trial
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+# Copyright (c) Twisted Matrix Laboratories.
+# See LICENSE for details.
+import os, sys
+
+try:
+ import _preamble
+except ImportError:
+ try:
+ sys.exc_clear()
+ except AttributeError:
+ # exc_clear() (and the requirement for it) has been removed from Py3
+ pass
+
+# begin chdir armor
+sys.path[:] = map(os.path.abspath, sys.path)
+# end chdir armor
+
+sys.path.insert(0, os.path.abspath(os.getcwd()))
+
+from twisted.scripts.trial import run
+run()
diff --git a/packages/net-twisted/Twisted/files/twisted-remove-tests.patch b/packages/net-twisted/Twisted/files/twisted-remove-tests.patch
new file mode 100644
index 0000000..4d07989
--- /dev/null
+++ b/packages/net-twisted/Twisted/files/twisted-remove-tests.patch
@@ -0,0 +1,29 @@
+Source: Rasmus Thomsen <Rasmus.thomsen@protonmail.com>
+Upstream: No, tests fail because of sydbox
+Reason: Some of Twisted's tests fail because of Sydbox and require to write to the live FS
+
+diff --git a/src/twisted/python/test/test_setup.py b/src/twisted/python/test/test_setup.py
+index 9aa3433..7593e63 100644
+--- a/src/twisted/python/test/test_setup.py
++++ b/src/twisted/python/test/test_setup.py
+@@ -73,20 +73,6 @@ class OptionalDependenciesTests(TestCase):
+ Tests for L{_EXTRAS_REQUIRE}
+ """
+
+- def test_distributeTakesExtrasRequire(self):
+- """
+- Setuptools' Distribution object parses and stores its C{extras_require}
+- argument as an attribute.
+- """
+- extras = dict(im_an_extra_dependency="thing")
+- attrs = dict(extras_require=extras)
+- distribution = Distribution(attrs)
+- self.assertEqual(
+- extras,
+- distribution.extras_require
+- )
+-
+-
+ def test_extrasRequireDictContainsKeys(self):
+ """
+ L{_EXTRAS_REQUIRE} contains options for all documented extras: C{dev},
diff --git a/packages/net-twisted/Twisted/files/twisted-test-override.patch b/packages/net-twisted/Twisted/files/twisted-test-override.patch
new file mode 100644
index 0000000..f49401a
--- /dev/null
+++ b/packages/net-twisted/Twisted/files/twisted-test-override.patch
@@ -0,0 +1,285 @@
+Source: Gentoo
+Upstream: No
+Reason: A few Twisted tests fail, so we disable them
+From 91b6d8b5b9d602152fb7148c6e2921463b93a8a5 Mon Sep 17 00:00:00 2001
+From: Brian Dolbec <dolsen@gentoo.org>
+Date: Fri, 31 Mar 2017 10:55:32 -0700
+Subject: [PATCH] twisted test overrides
+
+---
+ src/twisted/internet/test/test_gireactor.py | 3 ++-
+ src/twisted/pair/test/test_ethernet.py | 9 +++++++++
+ src/twisted/pair/test/test_ip.py | 8 ++++++++
+ src/twisted/pair/test/test_rawudp.py | 10 +++++++++-
+ src/twisted/pair/test/test_tuntap.py | 16 ++++++++++++++++
+ src/twisted/python/test/test_dist3.py | 2 ++
+ src/twisted/test/test_ident.py | 5 ++++-
+ src/twisted/test/test_plugin.py | 6 ++++++
+ src/twisted/test/test_policies.py | 5 +++++
+ src/twisted/test/test_udp.py | 6 ++++++
+ 10 files changed, 67 insertions(+), 3 deletions(-)
+
+diff --git a/src/twisted/internet/test/test_gireactor.py b/src/twisted/internet/test/test_gireactor.py
+index 43147fdce..6333218e7 100644
+--- a/src/twisted/internet/test/test_gireactor.py
++++ b/src/twisted/internet/test/test_gireactor.py
+@@ -39,6 +39,7 @@ from twisted.python.compat import _PY3
+ if gireactor is None:
+ skip = "gtk3/gi not importable"
+
++TEST_OVERRIDE = os.environ.get("TEST_OVERRIDE", False)
+
+
+ class GApplicationRegistrationTests(ReactorBuilder, TestCase):
+@@ -103,7 +104,7 @@ class GApplicationRegistrationTests(ReactorBuilder, TestCase):
+
+ self.runReactor(app, reactor)
+
+- if gtk3reactor is None:
++ if gtk3reactor is None or TEST_OVERRIDE:
+ test_gtkApplicationActivate.skip = (
+ "Gtk unavailable (may require running with X11 DISPLAY env set)")
+
+diff --git a/src/twisted/pair/test/test_ethernet.py b/src/twisted/pair/test/test_ethernet.py
+index a4c3a5d19..fe9c57151 100644
+--- a/src/twisted/pair/test/test_ethernet.py
++++ b/src/twisted/pair/test/test_ethernet.py
+@@ -1,11 +1,16 @@
+ # Copyright (c) Twisted Matrix Laboratories.
+ # See LICENSE for details.
++
++import os
++
+ from twisted.trial import unittest
+
+ from twisted.python import components
+ from twisted.pair import ethernet, raw
+ from zope.interface import implementer
+
++TEST_OVERRIDE = os.environ.get("TEST_OVERRIDE", False)
++
+
+ @implementer(raw.IRawPacketProtocol)
+ class MyProtocol:
+@@ -221,3 +226,7 @@ class EthernetTests(unittest.TestCase):
+ raise
+ else:
+ raise AssertionError('addProto must raise an exception for bad protocols')
++
++
++if TEST_OVERRIDE:
++ EthernetTests.skip = "This test does not work with sydbox"
+diff --git a/src/twisted/pair/test/test_ip.py b/src/twisted/pair/test/test_ip.py
+index 0f192a357..0a99658ef 100644
+--- a/src/twisted/pair/test/test_ip.py
++++ b/src/twisted/pair/test/test_ip.py
+@@ -1,11 +1,16 @@
+ # Copyright (c) Twisted Matrix Laboratories.
+ # See LICENSE for details.
++
++import os
++
+ from twisted.trial import unittest
+
+ from twisted.python import components
+ from twisted.pair import ip, raw
+ from zope import interface
+
++TEST_OVERRIDE = os.environ.get("TEST_OVERRIDE", False)
++
+
+ @interface.implementer(raw.IRawDatagramProtocol)
+ class MyProtocol:
+@@ -432,3 +437,6 @@ class IPTests(unittest.TestCase):
+ raise
+ else:
+ raise AssertionError('addProto must raise an exception for bad protocols')
++
++if TEST_OVERRIDE:
++ IPTests.skip = "This test does not work with sydbox"
+diff --git a/src/twisted/pair/test/test_rawudp.py b/src/twisted/pair/test/test_rawudp.py
+index 15aae10f1..dade38618 100644
+--- a/src/twisted/pair/test/test_rawudp.py
++++ b/src/twisted/pair/test/test_rawudp.py
+@@ -1,12 +1,17 @@
+ # Copyright (c) Twisted Matrix Laboratories.
+ # See LICENSE for details.
+-
+ #
++
++import os
++
+ from twisted.trial import unittest
+
+ from twisted.internet import protocol
+ from twisted.pair import rawudp
+
++TEST_OVERRIDE = os.environ.get("_TEST_OVERRIDE", False)
++
++
+ class MyProtocol(protocol.DatagramProtocol):
+ def __init__(self, expecting):
+ self.expecting = list(expecting)
+@@ -325,3 +330,6 @@ class RawUDPTests(unittest.TestCase):
+ raise
+ else:
+ raise AssertionError('addProto must raise an exception for bad protocols')
++
++if TEST_OVERRIDE:
++ RawUDPTests.skip = "This test does not work with sydbox"
+diff --git a/src/twisted/pair/test/test_tuntap.py b/src/twisted/pair/test/test_tuntap.py
+index 5e2da6e0f..53e03a008 100644
+--- a/src/twisted/pair/test/test_tuntap.py
++++ b/src/twisted/pair/test/test_tuntap.py
+@@ -64,6 +64,7 @@ if platformSkip is None:
+ else:
+ skip = platformSkip
+
++TEST_OVERRIDE = os.environ.get("TEST_OVERRIDE", False)
+
+
+ @implementer(IReactorFDSet)
+@@ -1417,3 +1418,18 @@ class RealIOSystemTests(IOSystemTestsMixin, SynchronousTestCase,
+ """
+ General L{_IInputOutputSystem} tests applied to L{_RealSystem}.
+ """
++
++if TEST_OVERRIDE:
++ RealIOSystemTests.skip = "This test does not work with sydbox"
++ MemoryIOSystemTests.skip = "This test does not work with sydbox"
++ TapTests.skip = "This test does not work with sydbox"
++ TunTests.skip = "This test does not work with sydbox"
++ TunnelAddressEqualityTests.skip = "This test does not work with sydbox"
++ TunnelAddressTests.skip = "This test does not work with sydbox"
++ TuntapPortTests.skip = "This test does not work with sydbox"
++ TunnelTests.skip = "This test does not work with sydbox"
++ FakeTapDeviceTests.skip = "This test does not work with sydbox"
++ FakeTapDeviceWithPITests.skip = "This test does not work with sydbox"
++ FakeTunDeviceTests.skip = "This test does not work with sydbox"
++ RealDeviceWithProtocolInformationTests.skip = "This test does not work with sydbox"
++ RealDeviceWithoutProtocolInformationTests.skip = "This test does not work with sydbox"
+diff --git a/src/twisted/python/test/test_dist3.py b/src/twisted/python/test/test_dist3.py
+index 3ce2bdd60..494674bc7 100644
+--- a/src/twisted/python/test/test_dist3.py
++++ b/src/twisted/python/test/test_dist3.py
+@@ -53,3 +53,5 @@ class ModulesToInstallTests(TestCase):
+ test_exist.skip = "Only on Python 2"
+ else:
+ test_notexist.skip = "Only on Python 3"
++
++ModulesToInstallTests.skip = "This is an upstream distribution test only"
+diff --git a/src/twisted/test/test_ident.py b/src/twisted/test/test_ident.py
+index d86b840e5..3cc40261f 100644
+--- a/src/twisted/test/test_ident.py
++++ b/src/twisted/test/test_ident.py
+@@ -12,7 +12,7 @@ from twisted.protocols import ident
+ from twisted.python import failure
+ from twisted.internet import error
+ from twisted.internet import defer
+-from twisted.python.compat import NativeStringIO
++from twisted.python.compat import NativeStringIO, _PY3
+
+ from twisted.trial import unittest
+ from twisted.test.proto_helpers import StringTransport
+@@ -216,6 +216,9 @@ class ProcMixinTests(unittest.TestCase):
+ """
+ L{ident.ProcServerMixin.lookup} uses the Linux TCP process table.
+ """
++ if not _PY3:
++ # test is broken in py2.7
++ return
+ open_calls = []
+
+ def mocked_open(*args, **kwargs):
+diff --git a/src/twisted/test/test_plugin.py b/src/twisted/test/test_plugin.py
+index a23caa72b..a6d61858c 100644
+--- a/src/twisted/test/test_plugin.py
++++ b/src/twisted/test/test_plugin.py
+@@ -29,6 +29,8 @@ else:
+ On python 2, import caches don't need to be invalidated.
+ """
+
++TEST_OVERRIDE = os.environ.get("TEST_OVERRIDE", False)
++
+
+
+ class ITestPlugin(Interface):
+@@ -327,6 +329,8 @@ class PluginTests(unittest.TestCase):
+ attainable, but an error should be logged to show that the cache
+ couldn't be updated.
+ """
++ if TEST_OVERRIDE:
++ return
+ # Generate the cache
+ plugin.getCache(self.module)
+
+@@ -580,6 +584,8 @@ class DeveloperSetupTests(unittest.TestCase):
+ provide useful coverage on Windows due to the different meaning of
+ "read-only directory".
+ """
++ if TEST_OVERRIDE:
++ return
+ self.unlockSystem()
+ self.sysplug.child('newstuff.py').setContent(pluginFileContents('one'))
+ self.lockSystem()
+diff --git a/src/twisted/test/test_policies.py b/src/twisted/test/test_policies.py
+index 3d92633d6..c08809a66 100644
+--- a/src/twisted/test/test_policies.py
++++ b/src/twisted/test/test_policies.py
+@@ -7,6 +7,8 @@ Test code for policies.
+
+ from __future__ import division, absolute_import
+
++import os
++
+ from zope.interface import Interface, implementer, implementedBy
+
+ from twisted.python.compat import NativeStringIO
+@@ -23,6 +25,7 @@ try:
+ except ImportError:
+ import __builtin__ as builtins
+
++TEST_OVERRIDE = os.environ.get("TEST_OVERRIDE", False)
+
+
+ class SimpleProtocol(protocol.Protocol):
+@@ -883,6 +886,8 @@ class LoggingFactoryTests(unittest.TestCase):
+ automatically opens a unique log file for that protocol and attaches
+ the logfile to the built protocol.
+ """
++ if TEST_OVERRIDE:
++ return
+ open_calls = []
+ open_rvalues = []
+
+diff --git a/src/twisted/test/test_udp.py b/src/twisted/test/test_udp.py
+index 6cf4583b2..86b513704 100644
+--- a/src/twisted/test/test_udp.py
++++ b/src/twisted/test/test_udp.py
+@@ -8,6 +8,8 @@ Tests for implementations of L{IReactorUDP} and L{IReactorMulticast}.
+
+ from __future__ import division, absolute_import
+
++import os
++
+ from twisted.trial import unittest
+
+ from twisted.python.compat import intToBytes
+@@ -15,6 +17,8 @@ from twisted.internet.defer import Deferred, gatherResults, maybeDeferred
+ from twisted.internet import protocol, reactor, error, defer, interfaces, udp
+ from twisted.python import runtime
+
++TEST_OVERRIDE = os.environ.get("TEST_OVERRIDE", False)
++
+
+ class Mixin:
+
+@@ -699,3 +703,5 @@ if not interfaces.IReactorUDP(reactor, None):
+ ReactorShutdownInteractionTests.skip = "This reactor does not support UDP"
+ if not interfaces.IReactorMulticast(reactor, None):
+ MulticastTests.skip = "This reactor does not support multicast"
++elif TEST_OVERRIDE:
++ MulticastTests.skip = "This reactor test does not work via FEATURES=test emerge twisted"
+--
+2.12.1
+