11 , hatch-fancy-pypi-readme
22 # optional-dependencies
35 , cython-test-exception-raiser
55 buildPythonPackage rec {
60 disabled = pythonOlder "3.6";
63 inherit pname version;
65 hash = "sha256-azi27Ocpa14SLJ6xfaLuqz2YoZj1DKnv0A+wPltP1K4=";
70 # Conditionally skip tests that require METHOD_CRYPT
71 # https://github.com/twisted/twisted/pull/11827
72 url = "https://github.com/mweinelt/twisted/commit/e69e652de671aac0abf5c7e6c662fc5172758c5a.patch";
73 hash = "sha256-LmvKUTViZoY/TPBmSlx4S9FbJNZfB5cxzn/YcciDmoI=";
77 __darwinAllowLocalNetworking = true;
81 hatch-fancy-pypi-readme
85 propagatedBuildInputs = [
96 echo 'ListingTests.test_localeIndependent.skip = "Timezone issue"'>> src/twisted/conch/test/test_cftp.py
97 echo 'ListingTests.test_newFile.skip = "Timezone issue"'>> src/twisted/conch/test/test_cftp.py
98 echo 'ListingTests.test_newSingleDigitDayOfMonth.skip = "Timezone issue"'>> src/twisted/conch/test/test_cftp.py
99 echo 'ListingTests.test_oldFile.skip = "Timezone issue"'>> src/twisted/conch/test/test_cftp.py
100 echo 'ListingTests.test_oldSingleDigitDayOfMonth.skip = "Timezone issue"'>> src/twisted/conch/test/test_cftp.py
102 echo 'WrapClientTLSParserTests.test_tls.skip = "pyopenssl update"' >> src/twisted/internet/test/test_endpoints.py
103 echo 'UNIXTestsBuilder_AsyncioSelectorReactorTests.test_sendFileDescriptorTriggersPauseProducing.skip = "sendFileDescriptor producer was not paused"'>> src/twisted/internet/test/test_unix.py
104 echo 'UNIXTestsBuilder_SelectReactorTests.test_sendFileDescriptorTriggersPauseProducing.skip = "sendFileDescriptor producer was not paused"'>> src/twisted/internet/test/test_unix.py
106 echo 'FileObserverTests.test_getTimezoneOffsetEastOfUTC.skip = "mktime argument out of range"'>> src/twisted/test/test_log.py
107 echo 'FileObserverTests.test_getTimezoneOffsetWestOfUTC.skip = "mktime argument out of range"'>> src/twisted/test/test_log.py
108 echo 'FileObserverTests.test_getTimezoneOffsetWithoutDaylightSavingTime.skip = "tuple differs, values not"'>> src/twisted/test/test_log.py
110 echo 'FileDescriptorTests.test_expectedFDs.skip = "Expected duplicate file descriptor to be greater than original"' >> src/twisted/internet/test/test_posixprocess.py
112 echo 'MulticastTests.test_joinLeave.skip = "No such device"'>> src/twisted/test/test_udp.py
113 echo 'MulticastTests.test_loopback.skip = "No such device"'>> src/twisted/test/test_udp.py
114 echo 'MulticastTests.test_multicast.skip = "Reactor was unclean"'>> src/twisted/test/test_udp.py
115 echo 'MulticastTests.test_multiListen.skip = "No such device"'>> src/twisted/test/test_udp.py
117 # fails since migrating to libxcrypt
118 echo 'HelperTests.test_refuteCryptedPassword.skip = "OSError: Invalid argument"' >> src/twisted/conch/test/test_checkers.py
120 # expectation mismatch with `python -m twisted --help` and `python -m twisted.trial --help` usage output
121 echo 'MainTests.test_twisted.skip = "Expectation Mismatch"' >> src/twisted/test/test_main.py
122 echo 'MainTests.test_trial.skip = "Expectation Mismatch"' >> src/twisted/test/test_main.py
124 # tests for missing https support in usage
125 echo 'ServiceTests.test_HTTPSFailureOnMissingSSL.skip = "Expectation Mismatch"' >> src/twisted/web/test/test_tap.py
127 # fail on Python 3.12
128 echo 'WorkerReporterTests.test_addSkipPyunit.skip = "'WorkerReporter' object has no attribute '_testStarted'"' >> src/twisted/trial/_dist/test/test_workerreporter.py
129 echo 'LocalWorkerAMPTests.test_runSkip.skip = "twisted.protocols.amp.UnknownRemoteError: Code<UNKNOWN>: Unknown Error"' >> src/twisted/trial/_dist/test/test_worker.py
132 substituteInPlace src/twisted/test/test_failure.py \
133 --replace "from cython_test_exception_raiser import raiser # type: ignore[import]" "raiser = None"
134 '' + lib.optionalString stdenv.isLinux ''
135 echo 'PTYProcessTestsBuilder_EPollReactorTests.test_openFileDescriptors.skip = "invalid syntax"'>> src/twisted/internet/test/test_process.py
136 echo 'PTYProcessTestsBuilder_PollReactorTests.test_openFileDescriptors.skip = "invalid syntax"'>> src/twisted/internet/test/test_process.py
137 echo 'UNIXTestsBuilder_EPollReactorTests.test_sendFileDescriptorTriggersPauseProducing.skip = "sendFileDescriptor producer was not paused"'>> src/twisted/internet/test/test_unix.py
138 echo 'UNIXTestsBuilder_PollReactorTests.test_sendFileDescriptorTriggersPauseProducing.skip = "sendFileDescriptor producer was not paused"'>> src/twisted/internet/test/test_unix.py
140 # Patch t.p._inotify to point to libc. Without this,
141 # twisted.python.runtime.platform.supportsINotify() == False
142 substituteInPlace src/twisted/python/_inotify.py --replace \
143 "ctypes.util.find_library(\"c\")" "'${stdenv.cc.libc}/lib/libc.so.6'"
144 '' + lib.optionalString stdenv.isDarwin ''
145 echo 'ProcessTestsBuilder_AsyncioSelectorReactorTests.test_openFileDescriptors.skip = "invalid syntax"'>> src/twisted/internet/test/test_process.py
146 echo 'ProcessTestsBuilder_SelectReactorTests.test_openFileDescriptors.skip = "invalid syntax"'>> src/twisted/internet/test/test_process.py
147 echo 'ProcessTestsBuilder_AsyncioSelectorReactorTests.test_processEnded.skip = "exit code 120"' >> src/twisted/internet/test/test_process.py
148 echo 'ProcessTestsBuilder_SelectReactorTests.test_processEnded.skip = "exit code 120"' >> src/twisted/internet/test/test_process.py
151 # Generate Twisted's plug-in cache. Twisted users must do it as well. See
152 # http://twistedmatrix.com/documents/current/core/howto/plugin.html#auto3
153 # and http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=477103 for details.
154 postFixup = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
155 $out/bin/twistd --help > /dev/null
158 nativeCheckInputs = [
159 cython-test-exception-raiser
165 ++ passthru.optional-dependencies.conch
166 ++ passthru.optional-dependencies.http2
167 ++ passthru.optional-dependencies.serial
168 # not supported on aarch64-darwin: https://github.com/pyca/pyopenssl/issues/873
169 ++ lib.optionals (!(stdenv.isDarwin && stdenv.isAarch64)) passthru.optional-dependencies.tls;
172 export SOURCE_DATE_EPOCH=315532800
173 export PATH=$out/bin:$PATH
174 # race conditions when running in paralell
175 ${python.interpreter} -m twisted.trial -j1 twisted
179 optional-dependencies = {
180 conch = [ appdirs bcrypt cryptography pyasn1 ];
181 http2 = [ h2 priority ];
182 serial = [ pyserial ];
183 tls = [ idna pyopenssl service-identity ];
198 inherit (nixosTests) buildbot matrix-synapse;
203 changelog = "https://github.com/twisted/twisted/blob/twisted-${version}/NEWS.rst";
204 homepage = "https://github.com/twisted/twisted";
205 description = "Asynchronous networking framework written in Python";
206 license = licenses.mit;
207 maintainers = with maintainers; [ ];