From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- dev-python/twisted/Manifest | 17 ++ dev-python/twisted/files/test_main.patch | 73 ++++++ dev-python/twisted/files/trial | 22 ++ dev-python/twisted/files/twistd.conf | 7 + dev-python/twisted/files/twistd.init | 25 ++ ...t_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch | 11 + .../twisted/files/twisted-16.6.0-test-fixes.patch | 282 +++++++++++++++++++++ dev-python/twisted/files/utf8_overrides.patch | 64 +++++ dev-python/twisted/metadata.xml | 36 +++ dev-python/twisted/twisted-16.6.0-r1.ebuild | 164 ++++++++++++ dev-python/twisted/twisted-16.6.0-r3.ebuild | 183 +++++++++++++ dev-python/twisted/twisted-17.1.0-r2.ebuild | 184 ++++++++++++++ dev-python/twisted/twisted-17.5.0-r1.ebuild | 186 ++++++++++++++ 13 files changed, 1254 insertions(+) create mode 100644 dev-python/twisted/Manifest create mode 100644 dev-python/twisted/files/test_main.patch create mode 100755 dev-python/twisted/files/trial create mode 100644 dev-python/twisted/files/twistd.conf create mode 100644 dev-python/twisted/files/twistd.init create mode 100644 dev-python/twisted/files/twisted-16.5.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch create mode 100644 dev-python/twisted/files/twisted-16.6.0-test-fixes.patch create mode 100644 dev-python/twisted/files/utf8_overrides.patch create mode 100644 dev-python/twisted/metadata.xml create mode 100644 dev-python/twisted/twisted-16.6.0-r1.ebuild create mode 100644 dev-python/twisted/twisted-16.6.0-r3.ebuild create mode 100644 dev-python/twisted/twisted-17.1.0-r2.ebuild create mode 100644 dev-python/twisted/twisted-17.5.0-r1.ebuild (limited to 'dev-python/twisted') diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest new file mode 100644 index 000000000000..53687f4091a0 --- /dev/null +++ b/dev-python/twisted/Manifest @@ -0,0 +1,17 @@ +AUX test_main.patch 3035 SHA256 0bfa9be1cc8c9c3fbca73e4bce4744a2b1a0efcb72ec4dc9f39fd7863bb8bfd3 SHA512 8e85a2aeb934f9a85bce223e50bae62e63188b4a75f6ef9e67badd040a6018075e7c777683106cf160d65383351d2d6ce02d3bc9a57e434e6e120ac8b669b147 WHIRLPOOL 83044025411aab4c16bdae727233f830568f53a77dd2ca4d62c84afe043919175ef4294bf8fd5bf4f1e752226e36449e883a44d0756a211ee97521d512b00744 +AUX trial 485 SHA256 e306d051d88242d109d39fceaa49271e4fd5823edc1a5d2d260faeadb104d2a6 SHA512 b6a58da5281e18306d558fd665acfff02e2478e4f692661a3ed0fc0b01e6e13794a8d2b56ac3f2790a0cdd83a882f37a247f5083ceaf6ed6686fb69bd87853ce WHIRLPOOL 07e6cc21f1e5ea43a9cd1a83e917490d996ed460dcd0e1d6ff69376f995f88028d405ba6f64e8e055594b6767f013cb6ea9c89f35e7524a16745123ef1e3e9eb +AUX twistd.conf 277 SHA256 aa2ffa5b128973bc0c58a1251b8bbb56f6f890728bc902805ea2db7606416119 SHA512 76d44caebab8404f16937c2515ad9ae8236732a48c7127366f7fa22c6ed3d88ace2d33b832a6d95f775973d41b7caf75344805fe5b01e964c04eb710bf3c89fb WHIRLPOOL 89223406ed730b82c5bf7b8d62bd0f12dbe1a1ab0ac69943fb0192970ea98870d369397a0dccbf0952d9e44abfaf2e897063c6e398efc6b4a7050fbf01593289 +AUX twistd.init 563 SHA256 cb0ee0ff81d50f673b4359b1329e72352e6f5d32f061aba5f8d1f9806f0ec217 SHA512 7860601beba1efda2b0a045b2a044ec33caff9ee915d45225c05e281760a68da349b4c45080600177aab32aa806714327acf3cf5dda92be0874f781f129bb129 WHIRLPOOL bbf71d8496a67e7d9da08a3958ae02be96c86894a665462af899bc551e9e823f65963fcf797fa53571c56b76bdb229c3ee1de51845600ee2ebb312c9bc681fa0 +AUX twisted-16.5.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch 427 SHA256 a2ac4339a844b762cda9fbd8fd37205dd418ce9c303f8d7249ae4b43d20cbf3a SHA512 d14b4941c3a13c59dfe0599a3eb73b9b0d5bde8e7c26033848ac920da8e8c63a0290d7f4d711cab16a17ba55a2e13830ab02bbd0db38f0757768cb973000064c WHIRLPOOL e059394c92abcd9eb27d19a7cff297422080e0ac89a3432fdd879905bc8b5cd7f312862dd6a2c2494a1654528a882f9318e1549e4af649357e7281f257e3c700 +AUX twisted-16.6.0-test-fixes.patch 10591 SHA256 270293351eef926a18a4db99bef30ab1795727d0df0edb95c8c8335054421291 SHA512 5071ffe30d1911ab4eb301403542f34198cbb3e09137d6260125fa61f702a0ce10e5c11c7967c10841a9d1b62f2eaf44e04119182a108cfbb7046622ddbdbcf2 WHIRLPOOL 06d3d49ce1359a669bc7b250b82d615408f97a78392893df0bb97f3783a53a3cb1eb60bea19f97b87fd6f21a6c2efa381250615c5b0dcdbcec321bfcf0f3c88e +AUX utf8_overrides.patch 2288 SHA256 dd2c9220dc7aecc15ed9c55a804b8512d75e90af9a1022e364ea58ec04101fae SHA512 b495268282e0233c570655b2b3d42ecc90116b22c36cdec4ebf581ce1019abedb7ee301d860ec161b4b5e691d1b747ad45257966b5f510de8dcce8271021e7e8 WHIRLPOOL be3f1998cbc8553606ccec61040dd97bf3f91af249073dd4c261043163780d5142fa9c966ffc803b30ff590b1de9cb7e5b82e2265cb2bde413881eea2f11ee25 +DIST Twisted-16.6.0.tar.bz2 2979747 SHA256 d0fe115ea7ef8cf632d05103de60356c6e992b2153d6830bdc4476f8accb1fca SHA512 0b8de0ec7f64457f76c396fced64b366b8e63c6e000a5edc6c6388cd917fb2f95711918cd8edda39e0aa77e2cd32b5d775d23630a5ad10fc013c18f8316300cf WHIRLPOOL a09a8747312580e3b27d222bf0942b714ad041044a817876e1731c5fa2ae3d11e4d5a45221d2e7d126ebb664730d15c886d5ae164841c7a8f0acd6e12c4691a9 +DIST Twisted-17.1.0.tar.bz2 2997334 SHA256 dbf211d70afe5b4442e3933ff01859533eba9f13d8b3e2e1b97dc2125e2d44dc SHA512 e5eedc9a70b7e4d0ec18dddaa82aa9a784e96fd517db65c278d822d15e8bdc65a35307a5a0474eb68dcb73fcd5508086bec605580a9f2f767bcbe27d714b4966 WHIRLPOOL 828a939134df47950a285c732867b3d4172e5e86a75fbdc1cc4365b5a24699a0b3fcb573b7e3d389eea591fc9fc79456c09f2d2c8f08d7e1215dc5761e88ed8e +DIST Twisted-17.5.0.tar.bz2 2993816 SHA256 f198a494f0df2482f7c5f99d7f3eef33d22763ffc76641b36fec476b878002ea SHA512 0fd10e5db7c87daf0d2225cec9929f1040f0c67e9605bfb1a5bc84db8b825e943cfa08e094c32c25c680bddc6587bfdc525a994ad7b785396e5ddb2621649379 WHIRLPOOL 28a0578545d525b5239a897229904489c38fa1e7148f374c96e66d3071f8dcd861aa5b772b338e5aaa9e92cc4d0f19a1598136bc2f9a9173b2489f6ec7fb391d +DIST twisted-regen-cache.gz 911 SHA256 e88fb326c0e24506d59afa3a4113e63c3e496fa1114156db6521f84fbce41652 SHA512 95a9b931c73017d16d1b5e6b41345dddffe62b6af1a8e93b5e40d06d3d15be17b0dd0181c767ffeeb791534d463764ef9e066fa6c2ee2ac4b53c86d1da8fce03 WHIRLPOOL 8077fc4d102bb8071e3163c386edf10c14a2cf0c8bbbf57c66787bdeb9b5f21115bcb022a770fe72b48914d829ff69384684f50928700f83547702d6a0d35423 +EBUILD twisted-16.6.0-r1.ebuild 5382 SHA256 a3bbba4fdaa36f7b36c1381109a50deaa2795800c8729707f14ac84e191257f7 SHA512 025fd917940cd45b678c0f964ce7621689d7ba8b545f248ddb54f56be04157062151da0a40ee152ec0b6321de03c5b77eca28a5f92ac4dba944818b49c5aeff6 WHIRLPOOL 02ea0018abd1ccf572699c1fc7b11087b359e1057d89bebac6788170180b3f88dc66c910d82238dc8d44aa09c33ef05ea88b622e69d2cd558b8bbb5dfcf6d78e +EBUILD twisted-16.6.0-r3.ebuild 5706 SHA256 3266ede871aebdf46aaf368892cc75c0cd1dabd04f715be704898d364c71e4b8 SHA512 76f2c1d0970b1bf0696f2ad53643cb4a06e5397586dbd7e2c31143b06e526ce3fae5c6753e4e053818e522d1d11dca950eb7a39dc53cb65f1ec7d8ce5c33906c WHIRLPOOL f6bfd174da82333da9156f26675d480e88395ed8057f42a2cc5cee57ea91334e04d1c9286a946f75a019c541e99ac4b5d2891a7a829a7cdfde057ee9a7066962 +EBUILD twisted-17.1.0-r2.ebuild 5740 SHA256 e66df58898543dd2d0eee3c78a76e7d2094870245c4a8709af72d5e3737dd995 SHA512 7262676cea7fcb550f60c856ff0a1e864a9f6f3eb913d6b8f7d0ef1267bcd3973101cc531237e4de458152140878618dbce3837aa9129b4571ad9f5fd6851b65 WHIRLPOOL 4c0f55250490e8352d8e0591a6f155e6e9375ed67dd38998c800ca06b498795a37f35b84d66bc9515433ba10652bc8045eec326bfc19fe39d844dae6ea0a0e88 +EBUILD twisted-17.5.0-r1.ebuild 5841 SHA256 f721ec90c26be1b6a46c6a7ff84a74d6f933395fd8cc6d3418629c1a662f9fba SHA512 7a016a43d9d5c19707d63ab75783f9e6959b938ffb1e24c9bec9304ddb2b971b8737cba2c4ecabfd0b47fe08708e880b3205f8ddfbb182c5527624b39d123fe0 WHIRLPOOL 4cd35bea4f9b665442938ca98debee1ee88d40bbd5e5d1a90adabeaca53fc3b7fc6bc1bd0d563d79cdb51767db54b0bb03022270e869afa99537f8a3324a943c +MISC ChangeLog 1173 SHA256 5917245364842babd165f6775b8d54d235a3e91c6b81659eac72ca7c2d2f3834 SHA512 e921d93be93d72161a3db1d9f1fdd514936e2528ea37b18c51c7ec26f410cbe7d5893a4aaf9dcb8a8a5a9994a1b3664c8eb6619d5a11b798e9de8b329fd65134 WHIRLPOOL 7cee46e51f6fe487b420207cbc6317246fa456f8d173ff2b40d7ec143d4bd30638516cf2457a87b4f1a38b2ec52dc9f74bf175ce5df4acdbcb258b9910e0619b +MISC metadata.xml 1469 SHA256 4c80465f66f66f4149f9c356f65fef4db81cd7947043e91c9f45f50567acdb96 SHA512 05a554323d1806d5643e33a8958fc1d4e3e18da112d47ef458721318b41619b977463bae77308d05ea485a0bba93f75e648ea949e1b1d00eb679989b8fc39fe0 WHIRLPOOL cf388df70f9c894078c0b598bf72860af111bfad10759173155cf20eec53d9545df8d3b60253a1eeeca0f35609545ebd2f0098e5a67a90d86bd897355a5f6ef6 diff --git a/dev-python/twisted/files/test_main.patch b/dev-python/twisted/files/test_main.patch new file mode 100644 index 000000000000..bfef40450d52 --- /dev/null +++ b/dev-python/twisted/files/test_main.patch @@ -0,0 +1,73 @@ +From 2c3c28f5dbbd61bcfa5c548d1d423fffbaf2132d Mon Sep 17 00:00:00 2001 +From: Brian Dolbec +Date: Fri, 31 Mar 2017 09:32:18 -0700 +Subject: [PATCH] tests/test_main.py: Fix test_twisted to handle differntly + sorted options + +Some systems retuned the usage with '__main__.py' instead of the command 'trial' +So, substitute that out if it exists. +The options returned via python can be a different sort order than is output via the +command --help. So break up the lines into a list and check equality, lines are neither +missing or extra. +--- + src/twisted/test/test_main.py | 34 ++++++++++++++++++++++++++++++++-- + 1 file changed, 32 insertions(+), 2 deletions(-) + +diff --git a/src/twisted/test/test_main.py b/src/twisted/test/test_main.py +index 572769018..b010a389e 100644 +--- a/src/twisted/test/test_main.py ++++ b/src/twisted/test/test_main.py +@@ -18,6 +18,10 @@ from twisted.trial.unittest import TestCase + + class MainTests(TestCase): + """Test that twisted scripts can be invoked as modules.""" ++ # this test just does not work correctly on Gentoo ++ # the output has '__main__.py' instead of 'trial' ++ # I have only been able to get 2.7 working correctly ++ # with replacing the value with what is expected. + def test_twisted(self): + """Invoking python -m twisted should execute twist.""" + cmd = sys.executable +@@ -28,11 +32,37 @@ class MainTests(TestCase): + + def processEnded(ign): + f = p.outF +- output = f.getvalue().replace(b'\r\n', b'\n') ++ # Some systems may return __main__.py instead of the command name expected ++ output = f.getvalue().replace(b'\r\n', b'\n').replace(b"__main__.py", b"trial") + + options = TwistOptions() + message = '{}\n'.format(options).encode('utf-8') +- self.assertEqual(output, message) ++ # NOTE: python may return the options in a different order ++ # than is output via the command --help option ++ # so we must break up the text and compare that lines ++ # are not missing or extra from what is expected ++ a = output.split(b'\n') ++ b = message.split(b'\n') ++ extras = [] ++ missing = [] ++ equal_len = (len(a) == len(b)) ++ for i in a: ++ if i not in b: ++ extras.append(i) ++ for i in b: ++ if i not in a: ++ missing.append(i) ++ ++ self.assertTrue(equal_len, ++ msg="Usage reported a different number of lines than expected") ++ self.assertTrue(extras == [], ++ msg="Usage returned these extra lines not expected: %s" ++ % '\n'.join(extras) ++ ) ++ self.assertTrue(missing == [], ++ msg="Usage was missing these expected lines: %s" ++ % '\n'.join(missing) ++ ) + return d.addCallback(processEnded) + + def test_twisted_import(self): +-- +2.12.1 + diff --git a/dev-python/twisted/files/trial b/dev-python/twisted/files/trial new file mode 100755 index 000000000000..8da58861abf6 --- /dev/null +++ b/dev-python/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/dev-python/twisted/files/twistd.conf b/dev-python/twisted/files/twistd.conf new file mode 100644 index 000000000000..53788cd0017e --- /dev/null +++ b/dev-python/twisted/files/twistd.conf @@ -0,0 +1,7 @@ + +# These are passed to twistd. +# TWISTD_OPTS="--no_save --logfile=/var/log/twistd -y /etc/twistd.tac" +# TWISTD_OPTS="--no_save --logfile=/var/log/twistd -f /etc/twistd.tap" + +# Make any additions to PYTHONPATH the twistd needs here. +# PYTHONPATH="/path/to/extra/python/modules" diff --git a/dev-python/twisted/files/twistd.init b/dev-python/twisted/files/twistd.init new file mode 100644 index 000000000000..b031b0020c6e --- /dev/null +++ b/dev-python/twisted/files/twistd.init @@ -0,0 +1,25 @@ +#!/sbin/openrc-run + +depend() { + need net +} + +start() { + if [ -z "${TWISTD_OPTS}" ]; then + eerror "TWISTD_OPTS is not set!" + eerror "You need to configure twistd in /etc/conf.d/twistd." + return 1 + fi + export PYTHONPATH + ebegin "Starting twistd" + start-stop-daemon --start --quiet --pidfile /var/run/twistd.pid \ + --exec /usr/bin/twistd -- --pidfile /var/run/twistd.pid \ + ${TWISTD_OPTS} + eend $? "Failed to start twistd" +} + +stop() { + ebegin "Stopping twistd" + start-stop-daemon --stop --quiet --pidfile /var/run/twistd.pid + eend $? "Failed to stop twistd" +} diff --git a/dev-python/twisted/files/twisted-16.5.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch b/dev-python/twisted/files/twisted-16.5.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch new file mode 100644 index 000000000000..ed1a46840678 --- /dev/null +++ b/dev-python/twisted/files/twisted-16.5.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch @@ -0,0 +1,11 @@ +--- src/twisted/plugin.py ++++ src/twisted/plugin.py +@@ -180,7 +180,7 @@ + if pluginKey not in existingKeys: + del dropinDotCache[pluginKey] + needsWrite = True +- if needsWrite: ++ if needsWrite and os.environ.get("TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE") is None: + try: + dropinPath.setContent(pickle.dumps(dropinDotCache)) + except: diff --git a/dev-python/twisted/files/twisted-16.6.0-test-fixes.patch b/dev-python/twisted/files/twisted-16.6.0-test-fixes.patch new file mode 100644 index 000000000000..3ce04aa3f684 --- /dev/null +++ b/dev-python/twisted/files/twisted-16.6.0-test-fixes.patch @@ -0,0 +1,282 @@ +From 91b6d8b5b9d602152fb7148c6e2921463b93a8a5 Mon Sep 17 00:00:00 2001 +From: Brian Dolbec +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" + ++EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_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 EMERGE_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 + ++EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_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 EMERGE_TEST_OVERRIDE: ++ EthernetTests.skip = "This test does not work via FEATURES=test emerge twisted" +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 + ++EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_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 EMERGE_TEST_OVERRIDE: ++ IPTests.skip = "This test does not work via FEATURES=test emerge twisted" +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 + ++EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_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 EMERGE_TEST_OVERRIDE: ++ RawUDPTests.skip = "This test does not work via FEATURES=test emerge twisted" +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 + ++EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_TEST_OVERRIDE", False) + + + @implementer(IReactorFDSet) +@@ -1417,3 +1418,18 @@ class RealIOSystemTests(IOSystemTestsMixin, SynchronousTestCase, + """ + General L{_IInputOutputSystem} tests applied to L{_RealSystem}. + """ ++ ++if EMERGE_TEST_OVERRIDE: ++ RealIOSystemTests.skip = "This test does not work via FEATURES=test emerge twisted" ++ MemoryIOSystemTests.skip = "This test does not work via FEATURES=test emerge twisted" ++ TapTests.skip = "This test does not work via FEATURES=test emerge twisted" ++ TunTests.skip = "This test does not work via FEATURES=test emerge twisted" ++ TunnelAddressEqualityTests.skip = "This test does not work via FEATURES=test emerge twisted" ++ TunnelAddressTests.skip = "This test does not work via FEATURES=test emerge twisted" ++ TuntapPortTests.skip = "This test does not work via FEATURES=test emerge twisted" ++ TunnelTests.skip = "This test does not work via FEATURES=test emerge twisted" ++ FakeTapDeviceTests.skip = "This test does not work via FEATURES=test emerge twisted" ++ FakeTapDeviceWithPITests.skip = "This test does not work via FEATURES=test emerge twisted" ++ FakeTunDeviceTests.skip = "This test does not work via FEATURES=test emerge twisted" ++ RealDeviceWithProtocolInformationTests.skip = "This test does not work via FEATURES=test emerge twisted" ++ RealDeviceWithoutProtocolInformationTests.skip = "This test does not work via FEATURES=test emerge twisted" +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. + """ + ++EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_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 EMERGE_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 EMERGE_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 + ++EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_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 EMERGE_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 + ++EMERGE_TEST_OVERRIDE = os.environ.get("EMERGE_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 EMERGE_TEST_OVERRIDE: ++ MulticastTests.skip = "This reactor test does not work via FEATURES=test emerge twisted" +-- +2.12.1 + diff --git a/dev-python/twisted/files/utf8_overrides.patch b/dev-python/twisted/files/utf8_overrides.patch new file mode 100644 index 000000000000..41f48cebfd84 --- /dev/null +++ b/dev-python/twisted/files/utf8_overrides.patch @@ -0,0 +1,64 @@ +From f8b2e95cc9bd1cbae565e1b4d576950961edc9a7 Mon Sep 17 00:00:00 2001 +From: Brian Dolbec +Date: Fri, 31 Mar 2017 09:40:16 -0700 +Subject: [PATCH] UTF8 test overrides: The DaemonizeTests SafeStrTests tests + may need to be run independantly + +Some other tests may leave python in a state that returns a different form of the b'\\u2022' +bytestring (b'\xe2\x80\xa2') which causes the tests to fail. +In StafeStrTests, the returned 't\\xfcst' != 't\xc3\xbcst' originally sent, but is just +the unicode equivalent. + +This adds an environment override which can be used to skip these test during a full +"trial twisted" run. The DaemonizeTests, SafeStrTests can then be run independantly +with a clean python interpreter. +--- + src/twisted/test/test_reflect.py | 6 ++++++ + src/twisted/test/test_twistd.py | 3 +++ + 2 files changed, 9 insertions(+) + +diff --git a/src/twisted/test/test_reflect.py b/src/twisted/test/test_reflect.py +index ff0c7fc9e..0c13b949b 100644 +--- a/src/twisted/test/test_reflect.py ++++ b/src/twisted/test/test_reflect.py +@@ -19,6 +19,9 @@ from twisted.python.reflect import ( + accumulateMethods, prefixedMethods, prefixedMethodNames, + addMethodNamesToDict, fullyQualifiedName) + ++UTF8_OVERRIDES = os.environ.get("UTF8_OVERRIDES", False) ++ ++ + + class Base(object): + """ +@@ -553,6 +556,9 @@ class SafeStrTests(TestCase): + x = b't\xc3\xbcst' + self.assertEqual(reflect.safe_str(x), x) + ++ if UTF8_OVERRIDES: ++ test_workingUtf8_2.skip = "test_workingUtf8_2 requires to be run independantly of other tests" ++ + + def test_workingUtf8_3(self): + """ +diff --git a/src/twisted/test/test_twistd.py b/src/twisted/test/test_twistd.py +index b74fe4a08..d55be16b9 100644 +--- a/src/twisted/test/test_twistd.py ++++ b/src/twisted/test/test_twistd.py +@@ -78,6 +78,7 @@ if getattr(os, 'setuid', None) is None: + else: + setuidSkip = None + ++UTF8_OVERRIDES = os.environ.get("UTF8_OVERRIDES", False) + + + def patchUserDatabase(patch, user, uid, group, gid): +@@ -1913,3 +1914,5 @@ class DaemonizeTests(unittest.TestCase): + + if _twistd_unix is None: + DaemonizeTests.skip = "twistd unix support not available" ++elif UTF8_OVERRIDES: ++ DaemonizeTests.skip = "twistd.DaemonizeTests testing needs to be run separately" +-- +2.12.1 + diff --git a/dev-python/twisted/metadata.xml b/dev-python/twisted/metadata.xml new file mode 100644 index 000000000000..4114ac037ce8 --- /dev/null +++ b/dev-python/twisted/metadata.xml @@ -0,0 +1,36 @@ + + + + + python@gentoo.org + Python + + + dolsen@gentoo.org + maintainer + + + + twisted-python@twistedmatrix.com + Twisted Matrix Laboratories + + Twisted + + + include Twisted SSHv2 implementation + include http2 support + include serial port support + + 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. + + diff --git a/dev-python/twisted/twisted-16.6.0-r1.ebuild b/dev-python/twisted/twisted-16.6.0-r1.ebuild new file mode 100644 index 000000000000..8851aa261252 --- /dev/null +++ b/dev-python/twisted/twisted-16.6.0-r1.ebuild @@ -0,0 +1,164 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 +PYTHON_COMPAT=( python2_7 python3_{4,5,6}) +PYTHON_REQ_USE="threads(+)" +TWISTED_PN="Twisted" +#DISTUTILS_IN_SOURCE_BUILD="yes" + +inherit eutils flag-o-matic twisted-r1 + +DESCRIPTION="An asynchronous networking framework written in Python" +SRC_URI="http://twistedmatrix.com/Releases/${TWISTED_PN}" +SRC_URI="${SRC_URI}/${TWISTED_RELEASE}/${TWISTED_P}.tar.bz2" + +# Dropped keywords due to new deps not keyworded +#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~x86 ~x86-fbsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~x86" +IUSE="conch crypt http2 serial +soap test" + +RDEPEND=">=dev-python/zope-interface-4.0.2[${PYTHON_USEDEP}] + conch? ( + dev-python/pyasn1[${PYTHON_USEDEP}] + >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}] + >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}] + ) + crypt? ( + >=dev-python/pyopenssl-16.0.0[${PYTHON_USEDEP}] + dev-python/service_identity[${PYTHON_USEDEP}] + >=dev-python/idna-0.6[${PYTHON_USEDEP}] + ) + serial? ( dev-python/pyserial[${PYTHON_USEDEP}] ) + soap? ( $(python_gen_cond_dep 'dev-python/soappy[${PYTHON_USEDEP}]' python2_7) ) + http2? ( + >=dev-python/hyper-h2-2.5.0[${PYTHON_USEDEP}] + =dev-python/priority-1.1.0[${PYTHON_USEDEP}] + =dev-python/constantly-15.1.0[${PYTHON_USEDEP}] + !dev-python/twisted-core + !dev-python/twisted-conch + !dev-python/twisted-lore + !dev-python/twisted-mail + !dev-python/twisted-names + !dev-python/twisted-news + !dev-python/twisted-pair + !dev-python/twisted-runner + !dev-python/twisted-words + !dev-python/twisted-web +" +DEPEND=" + >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}] + test? ( + dev-python/gmpy[${PYTHON_USEDEP}] + dev-python/pyasn1[${PYTHON_USEDEP}] + >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}] + >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}] + >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}] + dev-python/service_identity[${PYTHON_USEDEP}] + dev-python/idna[${PYTHON_USEDEP}] + dev-python/pyserial[${PYTHON_USEDEP}] + >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}] + ) +" + +PATCHES=( + # Respect TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE variable. + "${FILESDIR}/${PN}-16.5.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch" + "${FILESDIR}/test_main.patch" + "${FILESDIR}/utf8_overrides.patch" + "${FILESDIR}/${PN}-16.6.0-test-fixes.patch" +) + +python_prepare_all() { + # disable tests that don't work in our sandbox + # and other test failures due to our conditions + if use test ; then + # Remove since this is an upstream distribution test for making releases + rm src/twisted/python/test/test_release.py || die "rm src/twisted/python/test/test_release.py FAILED" + fi + distutils-r1_python_prepare_all +} + +python_compile() { + if ! python_is_python3; then + # Needed to make the sendmsg extension work + # (see http://twistedmatrix.com/trac/ticket/5701 ) + local -x CFLAGS="${CFLAGS} -fno-strict-aliasing" + local -x CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing" + fi + + distutils-r1_python_compile +} + +python_test() { + distutils_install_for_testing + + export EMERGE_TEST_OVERRIDE=1 + export UTF8_OVERRIDES=1 + # workaround for the eclass not installing the entry points + # in the test environment. copy the old 16.3.2 start script + # to run the tests with + cp "${FILESDIR}"/trial "${TEST_DIR}" + + pushd "${TEST_DIR}" > /dev/null || die + + if ! "${TEST_DIR}"/trial twisted; then + die "Tests failed with ${EPYTHON}" + fi + # due to an anomoly in the tests, python doesn't return the correct form + # of the escape sequence. So run those test separately with a clean python interpreter + export UTF8_OVERRIDES=0 + if ! "${TEST_DIR}"/trial twisted.test.test_twistd.DaemonizeTests; then + die "DaemonizeTests failed with ${EPYTHON}" + fi + if ! "${TEST_DIR}"/trial twisted.test.test_reflect.SafeStrTests; then + die "SafeStrTests failed with ${EPYTHON}" + fi + + popd > /dev/null || die +} + +python_install() { + distutils-r1_python_install + + cd "${D%/}$(python_get_sitedir)" || die + + # create 'Twisted' egg wrt bug #299736 + #local egg=( Twisted_Core*.egg-info ) + #[[ -f ${egg[0]} ]] || die "Twisted_Core*.egg-info not found" + #ln -s "${egg[0]}" "${egg[0]/_Core/}" || die + + # own the dropin.cache so we don't leave orphans + touch twisted/plugins/dropin.cache || die +} + +python_install_all() { + distutils-r1_python_install_all + + newconfd "${FILESDIR}/twistd.conf" twistd + newinitd "${FILESDIR}/twistd.init" twistd +} + +pkg_postinst() { + einfo "Install complete" + if use test ; then + einfo "" + einfo "Some tests have been disabled during testing due to" + einfo "known incompatibilities with the emerge sandboxes and/or" + einfo "not runnable as the root user." + einfo "For a complete test suite run on the code." + einfo "Run the tests as a normal user for each python it is installed to." + einfo " ie: $ python3.6 /usr/bin/trial twisted" + einfo "There are a few known python-2.7 errors due to some unicode issues" + einfo "which are different in Gentoo installed python-2.7" + fi +} + +pkg_postrm(){ + # pre portage-2.3.2 release workaround for bug 595028 + cd "${HOME}" + _distutils-r1_run_foreach_impl twisted-r1_update_plugin_cache +} diff --git a/dev-python/twisted/twisted-16.6.0-r3.ebuild b/dev-python/twisted/twisted-16.6.0-r3.ebuild new file mode 100644 index 000000000000..a7c293332815 --- /dev/null +++ b/dev-python/twisted/twisted-16.6.0-r3.ebuild @@ -0,0 +1,183 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 +PYTHON_COMPAT=( python2_7 python3_{4,5,6}) +PYTHON_REQ_USE="threads(+)" + +inherit eutils flag-o-matic distutils-r1 versionator + +TWISTED_PN="Twisted" +TWISTED_P="${TWISTED_PN}-${PV}" +TWISTED_RELEASE=$(get_version_component_range 1-2 "${PV}") + +DESCRIPTION="An asynchronous networking framework written in Python" +HOMEPAGE="http://www.twistedmatrix.com/" +SRC_URI="http://twistedmatrix.com/Releases/${TWISTED_PN}" +SRC_URI="${SRC_URI}/${TWISTED_RELEASE}/${TWISTED_P}.tar.bz2 + https://dev.gentoo.org/~mgorny/dist/twisted-regen-cache.gz" + +# Dropped keywords due to new deps not keyworded +#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~x86 ~x86-fbsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +KEYWORDS="alpha amd64 arm ~arm64 ~hppa ~mips ppc ppc64 x86" + +LICENSE="MIT" +SLOT="0" +IUSE="conch crypt http2 serial +soap test" + +RDEPEND=" + >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}] + >=dev-python/zope-interface-4.0.2[${PYTHON_USEDEP}] + conch? ( + dev-python/pyasn1[${PYTHON_USEDEP}] + >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}] + >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}] + ) + crypt? ( + >=dev-python/pyopenssl-16.0.0[${PYTHON_USEDEP}] + dev-python/service_identity[${PYTHON_USEDEP}] + >=dev-python/idna-0.6[${PYTHON_USEDEP}] + ) + serial? ( dev-python/pyserial[${PYTHON_USEDEP}] ) + soap? ( $(python_gen_cond_dep 'dev-python/soappy[${PYTHON_USEDEP}]' python2_7) ) + http2? ( + >=dev-python/hyper-h2-2.5.0[${PYTHON_USEDEP}] + =dev-python/priority-1.1.0[${PYTHON_USEDEP}] + =dev-python/constantly-15.1.0[${PYTHON_USEDEP}] + !dev-python/twisted-core + !dev-python/twisted-conch + !dev-python/twisted-lore + !dev-python/twisted-mail + !dev-python/twisted-names + !dev-python/twisted-news + !dev-python/twisted-pair + !dev-python/twisted-runner + !dev-python/twisted-words + !dev-python/twisted-web +" +DEPEND=" + >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}] + test? ( + dev-python/gmpy[${PYTHON_USEDEP}] + dev-python/pyasn1[${PYTHON_USEDEP}] + >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}] + >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}] + >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}] + dev-python/service_identity[${PYTHON_USEDEP}] + dev-python/idna[${PYTHON_USEDEP}] + dev-python/pyserial[${PYTHON_USEDEP}] + >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}] + ) +" + +PATCHES=( + # Respect TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE variable. + "${FILESDIR}/${PN}-16.5.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch" + "${FILESDIR}/test_main.patch" + "${FILESDIR}/utf8_overrides.patch" + "${FILESDIR}/${PN}-16.6.0-test-fixes.patch" +) + +S=${WORKDIR}/${TWISTED_P} + +python_prepare_all() { + # disable tests that don't work in our sandbox + # and other test failures due to our conditions + if use test ; then + # Remove since this is an upstream distribution test for making releases + rm src/twisted/python/test/test_release.py || die "rm src/twisted/python/test/test_release.py FAILED" + fi + distutils-r1_python_prepare_all +} + +python_compile() { + if ! python_is_python3; then + # Needed to make the sendmsg extension work + # (see http://twistedmatrix.com/trac/ticket/5701 ) + local -x CFLAGS="${CFLAGS} -fno-strict-aliasing" + local -x CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing" + fi + + distutils-r1_python_compile +} + +python_test() { + distutils_install_for_testing + + export EMERGE_TEST_OVERRIDE=1 + export UTF8_OVERRIDES=1 + # workaround for the eclass not installing the entry points + # in the test environment. copy the old 16.3.2 start script + # to run the tests with + cp "${FILESDIR}"/trial "${TEST_DIR}" + + pushd "${TEST_DIR}" > /dev/null || die + + if ! "${TEST_DIR}"/trial twisted; then + die "Tests failed with ${EPYTHON}" + fi + # due to an anomoly in the tests, python doesn't return the correct form + # of the escape sequence. So run those test separately with a clean python interpreter + export UTF8_OVERRIDES=0 + if ! "${TEST_DIR}"/trial twisted.test.test_twistd.DaemonizeTests; then + die "DaemonizeTests failed with ${EPYTHON}" + fi + if ! "${TEST_DIR}"/trial twisted.test.test_reflect.SafeStrTests; then + die "SafeStrTests failed with ${EPYTHON}" + fi + + popd > /dev/null || die +} + +python_install() { + distutils-r1_python_install + + cd "${D%/}$(python_get_sitedir)" || die + + # own the dropin.cache so we don't leave orphans + touch twisted/plugins/dropin.cache || die + + python_doscript "${WORKDIR}"/twisted-regen-cache +} + +python_install_all() { + distutils-r1_python_install_all + + newconfd "${FILESDIR}/twistd.conf" twistd + newinitd "${FILESDIR}/twistd.init" twistd +} + +python_postinst() { + twisted-regen-cache || die +} + +pkg_postinst() { + python_foreach_impl python_postinst + + einfo "Install complete" + if use test ; then + einfo "" + einfo "Some tests have been disabled during testing due to" + einfo "known incompatibilities with the emerge sandboxes and/or" + einfo "not runnable as the root user." + einfo "For a complete test suite run on the code." + einfo "Run the tests as a normal user for each python it is installed to." + einfo " ie: $ python3.6 /usr/bin/trial twisted" + einfo "There are a few known python-2.7 errors due to some unicode issues" + einfo "which are different in Gentoo installed python-2.7" + fi +} + +python_postrm() { + rm -f "${ROOT%/}$(python_get_sitedir)/twisted/plugins/dropin.cache" || die +} + +pkg_postrm(){ + # if we're removing the last version, remove the cache file + if [[ ! ${REPLACING_VERSIONS} ]]; then + python_foreach_impl python_postrm + fi +} diff --git a/dev-python/twisted/twisted-17.1.0-r2.ebuild b/dev-python/twisted/twisted-17.1.0-r2.ebuild new file mode 100644 index 000000000000..13b750e8a743 --- /dev/null +++ b/dev-python/twisted/twisted-17.1.0-r2.ebuild @@ -0,0 +1,184 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 +PYTHON_COMPAT=( python2_7 python3_{4,5,6}) +PYTHON_REQ_USE="threads(+)" + +inherit eutils flag-o-matic distutils-r1 versionator + +TWISTED_PN="Twisted" +TWISTED_P="${TWISTED_PN}-${PV}" +TWISTED_RELEASE=$(get_version_component_range 1-2 "${PV}") + +DESCRIPTION="An asynchronous networking framework written in Python" +HOMEPAGE="http://www.twistedmatrix.com/" +SRC_URI="http://twistedmatrix.com/Releases/${TWISTED_PN}" +SRC_URI="${SRC_URI}/${TWISTED_RELEASE}/${TWISTED_P}.tar.bz2 + https://dev.gentoo.org/~mgorny/dist/twisted-regen-cache.gz" + +# Dropped keywords due to new deps not keyworded +#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~x86 ~x86-fbsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc64 ~x86" + +LICENSE="MIT" +SLOT="0" +IUSE="conch crypt http2 serial +soap test" + +RDEPEND=" + >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}] + >=dev-python/zope-interface-4.0.2[${PYTHON_USEDEP}] + conch? ( + dev-python/pyasn1[${PYTHON_USEDEP}] + >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}] + >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}] + ) + crypt? ( + >=dev-python/pyopenssl-16.0.0[${PYTHON_USEDEP}] + dev-python/service_identity[${PYTHON_USEDEP}] + >=dev-python/idna-0.6[${PYTHON_USEDEP}] + ) + serial? ( dev-python/pyserial[${PYTHON_USEDEP}] ) + soap? ( $(python_gen_cond_dep 'dev-python/soappy[${PYTHON_USEDEP}]' python2_7) ) + http2? ( + >=dev-python/hyper-h2-2.5.0[${PYTHON_USEDEP}] + =dev-python/priority-1.1.0[${PYTHON_USEDEP}] + =dev-python/constantly-15.1.0[${PYTHON_USEDEP}] + >=dev-python/automat-0.3.0[${PYTHON_USEDEP}] + !dev-python/twisted-core + !dev-python/twisted-conch + !dev-python/twisted-lore + !dev-python/twisted-mail + !dev-python/twisted-names + !dev-python/twisted-news + !dev-python/twisted-pair + !dev-python/twisted-runner + !dev-python/twisted-words + !dev-python/twisted-web +" +DEPEND=" + >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}] + test? ( + dev-python/gmpy[${PYTHON_USEDEP}] + dev-python/pyasn1[${PYTHON_USEDEP}] + >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}] + >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}] + >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}] + dev-python/service_identity[${PYTHON_USEDEP}] + dev-python/idna[${PYTHON_USEDEP}] + dev-python/pyserial[${PYTHON_USEDEP}] + >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}] + ) +" + +PATCHES=( + # Respect TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE variable. + "${FILESDIR}/${PN}-16.5.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch" + "${FILESDIR}/test_main.patch" + "${FILESDIR}/utf8_overrides.patch" + "${FILESDIR}/${PN}-16.6.0-test-fixes.patch" +) + +S=${WORKDIR}/${TWISTED_P} + +python_prepare_all() { + # disable tests that don't work in our sandbox + # and other test failures due to our conditions + if use test ; then + # Remove since this is an upstream distribution test for making releases + rm src/twisted/python/test/test_release.py || die "rm src/twisted/python/test/test_release.py FAILED" + fi + distutils-r1_python_prepare_all +} + +python_compile() { + if ! python_is_python3; then + # Needed to make the sendmsg extension work + # (see http://twistedmatrix.com/trac/ticket/5701 ) + local -x CFLAGS="${CFLAGS} -fno-strict-aliasing" + local -x CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing" + fi + + distutils-r1_python_compile +} + +python_test() { + distutils_install_for_testing + + export EMERGE_TEST_OVERRIDE=1 + export UTF8_OVERRIDES=1 + # workaround for the eclass not installing the entry points + # in the test environment. copy the old 16.3.2 start script + # to run the tests with + cp "${FILESDIR}"/trial "${TEST_DIR}" + + pushd "${TEST_DIR}" > /dev/null || die + + if ! "${TEST_DIR}"/trial twisted; then + die "Tests failed with ${EPYTHON}" + fi + # due to an anomoly in the tests, python doesn't return the correct form + # of the escape sequence. So run those test separately with a clean python interpreter + export UTF8_OVERRIDES=0 + if ! "${TEST_DIR}"/trial twisted.test.test_twistd.DaemonizeTests; then + die "DaemonizeTests failed with ${EPYTHON}" + fi + if ! "${TEST_DIR}"/trial twisted.test.test_reflect.SafeStrTests; then + die "SafeStrTests failed with ${EPYTHON}" + fi + + popd > /dev/null || die +} + +python_install() { + distutils-r1_python_install + + cd "${D%/}$(python_get_sitedir)" || die + + # own the dropin.cache so we don't leave orphans + touch twisted/plugins/dropin.cache || die + + python_doscript "${WORKDIR}"/twisted-regen-cache +} + +python_install_all() { + distutils-r1_python_install_all + + newconfd "${FILESDIR}/twistd.conf" twistd + newinitd "${FILESDIR}/twistd.init" twistd +} + +python_postinst() { + twisted-regen-cache || die +} + +pkg_postinst() { + python_foreach_impl python_postinst + + einfo "Install complete" + if use test ; then + einfo "" + einfo "Some tests have been disabled during testing due to" + einfo "known incompatibilities with the emerge sandboxes and/or" + einfo "not runnable as the root user." + einfo "For a complete test suite run on the code." + einfo "Run the tests as a normal user for each python it is installed to." + einfo " ie: $ python3.6 /usr/bin/trial twisted" + einfo "There are a few known python-2.7 errors due to some unicode issues" + einfo "which are different in Gentoo installed python-2.7" + fi +} + +python_postrm() { + rm -f "${ROOT%/}$(python_get_sitedir)/twisted/plugins/dropin.cache" || die +} + +pkg_postrm(){ + # if we're removing the last version, remove the cache file + if [[ ! ${REPLACING_VERSIONS} ]]; then + python_foreach_impl python_postrm + fi +} diff --git a/dev-python/twisted/twisted-17.5.0-r1.ebuild b/dev-python/twisted/twisted-17.5.0-r1.ebuild new file mode 100644 index 000000000000..78bd82450ae2 --- /dev/null +++ b/dev-python/twisted/twisted-17.5.0-r1.ebuild @@ -0,0 +1,186 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 +PYTHON_COMPAT=( python2_7 python3_{4,5,6}) +PYTHON_REQ_USE="threads(+)" + +inherit eutils flag-o-matic distutils-r1 versionator + +TWISTED_PN="Twisted" +TWISTED_P="${TWISTED_PN}-${PV}" +TWISTED_RELEASE=$(get_version_component_range 1-2 "${PV}") + +DESCRIPTION="An asynchronous networking framework written in Python" +HOMEPAGE="http://www.twistedmatrix.com/" +SRC_URI="http://twistedmatrix.com/Releases/${TWISTED_PN}" +SRC_URI="${SRC_URI}/${TWISTED_RELEASE}/${TWISTED_P}.tar.bz2 + https://dev.gentoo.org/~mgorny/dist/twisted-regen-cache.gz" + +# Dropped keywords due to new deps not keyworded +#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~x86 ~x86-fbsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~x86" + +LICENSE="MIT" +SLOT="0" +IUSE="conch crypt http2 serial +soap test" + +RDEPEND=" + >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}] + >=dev-python/zope-interface-4.0.2[${PYTHON_USEDEP}] + conch? ( + dev-python/pyasn1[${PYTHON_USEDEP}] + >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}] + >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}] + ) + crypt? ( + >=dev-python/pyopenssl-16.0.0[${PYTHON_USEDEP}] + dev-python/service_identity[${PYTHON_USEDEP}] + >=dev-python/idna-0.6[${PYTHON_USEDEP}] + ) + serial? ( dev-python/pyserial[${PYTHON_USEDEP}] ) + soap? ( $(python_gen_cond_dep 'dev-python/soappy[${PYTHON_USEDEP}]' python2_7) ) + http2? ( + >=dev-python/hyper-h2-3.0.0[${PYTHON_USEDEP}] + =dev-python/priority-1.1.0[${PYTHON_USEDEP}] + =dev-python/constantly-15.1.0[${PYTHON_USEDEP}] + >=dev-python/automat-0.3.0[${PYTHON_USEDEP}] + >=dev-python/hyperlink-17.1.1[${PYTHON_USEDEP}] + !dev-python/twisted-core + !dev-python/twisted-conch + !dev-python/twisted-lore + !dev-python/twisted-mail + !dev-python/twisted-names + !dev-python/twisted-news + !dev-python/twisted-pair + !dev-python/twisted-runner + !dev-python/twisted-words + !dev-python/twisted-web +" +DEPEND=" + >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}] + test? ( + dev-python/gmpy[${PYTHON_USEDEP}] + dev-python/pyasn1[${PYTHON_USEDEP}] + >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}] + >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}] + >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}] + dev-python/service_identity[${PYTHON_USEDEP}] + dev-python/idna[${PYTHON_USEDEP}] + dev-python/pyserial[${PYTHON_USEDEP}] + >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}] + ) +" + +PATCHES=( + # Respect TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE variable. + "${FILESDIR}/${PN}-16.5.0-respect_TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE.patch" + "${FILESDIR}/test_main.patch" + "${FILESDIR}/utf8_overrides.patch" + "${FILESDIR}/${PN}-16.6.0-test-fixes.patch" +) + +S=${WORKDIR}/${TWISTED_P} + +python_prepare_all() { + # disable tests that don't work in our sandbox + # and other test failures due to our conditions + if use test ; then + # Remove since this is an upstream distribution test for making releases + rm src/twisted/python/test/test_release.py || die "rm src/twisted/python/test/test_release.py FAILED" + fi + distutils-r1_python_prepare_all +} + +python_compile() { + if ! python_is_python3; then + # Needed to make the sendmsg extension work + # (see http://twistedmatrix.com/trac/ticket/5701 ) + local -x CFLAGS="${CFLAGS} -fno-strict-aliasing" + local -x CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing" + fi + + distutils-r1_python_compile +} + +python_test() { + distutils_install_for_testing + + export EMERGE_TEST_OVERRIDE=1 + export UTF8_OVERRIDES=1 + unset TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE + # workaround for the eclass not installing the entry points + # in the test environment. copy the old 16.3.2 start script + # to run the tests with + cp "${FILESDIR}"/trial "${TEST_DIR}" + + pushd "${TEST_DIR}" > /dev/null || die + + if ! "${TEST_DIR}"/trial twisted; then + die "Tests failed with ${EPYTHON}" + fi + # due to an anomoly in the tests, python doesn't return the correct form + # of the escape sequence. So run those test separately with a clean python interpreter + export UTF8_OVERRIDES=0 + if ! "${TEST_DIR}"/trial twisted.test.test_twistd.DaemonizeTests; then + die "DaemonizeTests failed with ${EPYTHON}" + fi + if ! "${TEST_DIR}"/trial twisted.test.test_reflect.SafeStrTests; then + die "SafeStrTests failed with ${EPYTHON}" + fi + + popd > /dev/null || die +} + +python_install() { + distutils-r1_python_install + + cd "${D%/}$(python_get_sitedir)" || die + + # own the dropin.cache so we don't leave orphans + touch twisted/plugins/dropin.cache || die + + python_doscript "${WORKDIR}"/twisted-regen-cache +} + +python_install_all() { + distutils-r1_python_install_all + + newconfd "${FILESDIR}/twistd.conf" twistd + newinitd "${FILESDIR}/twistd.init" twistd +} + +python_postinst() { + twisted-regen-cache || die +} + +pkg_postinst() { + python_foreach_impl python_postinst + + einfo "Install complete" + if use test ; then + einfo "" + einfo "Some tests have been disabled during testing due to" + einfo "known incompatibilities with the emerge sandboxes and/or" + einfo "not runnable as the root user." + einfo "For a complete test suite run on the code." + einfo "Run the tests as a normal user for each python it is installed to." + einfo " ie: $ python3.6 /usr/bin/trial twisted" + einfo "There are a few known python-2.7 errors due to some unicode issues" + einfo "which are different in Gentoo installed python-2.7" + fi +} + +python_postrm() { + rm -f "${ROOT%/}$(python_get_sitedir)/twisted/plugins/dropin.cache" || die +} + +pkg_postrm(){ + # if we're removing the last version, remove the cache file + if [[ ! ${REPLACING_VERSIONS} ]]; then + python_foreach_impl python_postrm + fi +} -- cgit v1.2.3