46 buildPythonPackage rec {
49 format = "setuptools";
51 disabled = pythonOlder "3.6";
57 hash = "sha256-5bYN458tHaFT++GHTYhf4/y9sh/MRG+nWaU+j8NRO+0=";
62 name = "fix-test_openFileDescriptors.patch";
63 url = "https://github.com/twisted/twisted/commit/47f47634940141466177261b20bb43c300531e38.patch";
64 hash = "sha256-wacnF166PnZHXJEqTlPZUdDILJIVHOcnC2a34SQumvs=";
68 __darwinAllowLocalNetworking = true;
70 propagatedBuildInputs = [
82 echo 'ListingTests.test_localeIndependent.skip = "Timezone issue"'>> src/twisted/conch/test/test_cftp.py
83 echo 'ListingTests.test_newFile.skip = "Timezone issue"'>> src/twisted/conch/test/test_cftp.py
84 echo 'ListingTests.test_newSingleDigitDayOfMonth.skip = "Timezone issue"'>> src/twisted/conch/test/test_cftp.py
85 echo 'ListingTests.test_oldFile.skip = "Timezone issue"'>> src/twisted/conch/test/test_cftp.py
86 echo 'ListingTests.test_oldSingleDigitDayOfMonth.skip = "Timezone issue"'>> src/twisted/conch/test/test_cftp.py
88 echo 'UNIXTestsBuilder_AsyncioSelectorReactorTests.test_sendFileDescriptorTriggersPauseProducing.skip = "sendFileDescriptor producer was not paused"'>> src/twisted/internet/test/test_unix.py
89 echo 'UNIXTestsBuilder_SelectReactorTests.test_sendFileDescriptorTriggersPauseProducing.skip = "sendFileDescriptor producer was not paused"'>> src/twisted/internet/test/test_unix.py
91 echo 'FileObserverTests.test_getTimezoneOffsetEastOfUTC.skip = "mktime argument out of range"'>> src/twisted/test/test_log.py
92 echo 'FileObserverTests.test_getTimezoneOffsetWestOfUTC.skip = "mktime argument out of range"'>> src/twisted/test/test_log.py
93 echo 'FileObserverTests.test_getTimezoneOffsetWithoutDaylightSavingTime.skip = "tuple differs, values not"'>> src/twisted/test/test_log.py
95 echo 'MulticastTests.test_joinLeave.skip = "No such device"'>> src/twisted/test/test_udp.py
96 echo 'MulticastTests.test_loopback.skip = "No such device"'>> src/twisted/test/test_udp.py
97 echo 'MulticastTests.test_multicast.skip = "Reactor was unclean"'>> src/twisted/test/test_udp.py
98 echo 'MulticastTests.test_multiListen.skip = "No such device"'>> src/twisted/test/test_udp.py
100 # fails since migrating to libxcrypt
101 echo 'HelperTests.test_refuteCryptedPassword.skip = "OSError: Invalid argument"' >> src/twisted/conch/test/test_checkers.py
104 substituteInPlace src/twisted/test/test_failure.py \
105 --replace "from cython_test_exception_raiser import raiser # type: ignore[import]" "raiser = None"
106 '' + lib.optionalString stdenv.isLinux ''
107 echo 'PTYProcessTestsBuilder_EPollReactorTests.test_openFileDescriptors.skip = "invalid syntax"'>> src/twisted/internet/test/test_process.py
108 echo 'PTYProcessTestsBuilder_PollReactorTests.test_openFileDescriptors.skip = "invalid syntax"'>> src/twisted/internet/test/test_process.py
109 echo 'UNIXTestsBuilder_EPollReactorTests.test_sendFileDescriptorTriggersPauseProducing.skip = "sendFileDescriptor producer was not paused"'>> src/twisted/internet/test/test_unix.py
110 echo 'UNIXTestsBuilder_PollReactorTests.test_sendFileDescriptorTriggersPauseProducing.skip = "sendFileDescriptor producer was not paused"'>> src/twisted/internet/test/test_unix.py
112 # Patch t.p._inotify to point to libc. Without this,
113 # twisted.python.runtime.platform.supportsINotify() == False
114 substituteInPlace src/twisted/python/_inotify.py --replace \
115 "ctypes.util.find_library(\"c\")" "'${stdenv.cc.libc}/lib/libc.so.6'"
116 '' + lib.optionalString (stdenv.isAarch64 && stdenv.isDarwin) ''
117 echo 'AbortConnectionTests_AsyncioSelectorReactorTests.test_fullWriteBufferAfterByteExchange.skip = "Timeout after 120 seconds"' >> src/twisted/internet/test/test_tcp.py
118 echo 'AbortConnectionTests_AsyncioSelectorReactorTests.test_resumeProducingAbort.skip = "Timeout after 120 seconds"' >> src/twisted/internet/test/test_tcp.py
121 # Generate Twisted's plug-in cache. Twisted users must do it as well. See
122 # http://twistedmatrix.com/documents/current/core/howto/plugin.html#auto3
123 # and http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=477103 for details.
125 $out/bin/twistd --help > /dev/null
133 ++ passthru.optional-dependencies.conch
134 # not supported on aarch64-darwin: https://github.com/pyca/pyopenssl/issues/873
135 ++ lib.optionals (!(stdenv.isDarwin && stdenv.isAarch64)) passthru.optional-dependencies.tls;
138 export SOURCE_DATE_EPOCH=315532800
139 export PATH=$out/bin:$PATH
140 # race conditions when running in paralell
141 ${python.interpreter} -m twisted.trial twisted
145 optional-dependencies = rec {
146 conch = [ appdirs bcrypt cryptography pyasn1 ];
147 conch_nacl = conch ++ [ pynacl ];
148 contextvars = lib.optionals (pythonOlder "3.7") [ contextvars ];
149 http2 = [ h2 priority ];
150 serial = [ pyserial ];
151 tls = [ idna pyopenssl service-identity ];
166 inherit (nixosTests) buildbot matrix-synapse;
171 homepage = "https://github.com/twisted/twisted";
172 description = "Twisted, an event-driven networking engine written in Python";
174 Twisted is an event-driven networking engine written in Python
175 and licensed under the MIT license.
177 license = licenses.mit;
178 maintainers = with maintainers; [ SuperSandro2000 ];