git.iko.soy/typeable/nixpkgs
on master help sign in
trollius: fix tests
commit3a33ed7c46909a0a37bd5e12edfd896350be1f6c authorSamuel Leathers <sam@appliedtrust.com> dateFri 15 Sep 2017, 19:16 (9 years ago) parent28a9f74
3 files changed+63−59
pkgs/development/python-modules/trollius/default.nix+49 pkgs/development/python-modules/trollius/tests.patch+13 pkgs/top-level/python-packages.nix+1−59
pkgs/development/python-modules/trollius/default.nixnew file+49
@@ -0,0 +1,49 @@
1+{ lib, stdenv, buildPythonPackage, fetchPypi, isPy27, isPy26, isPyPy, mock, futures }:
2+buildPythonPackage rec {
3+ pname = "trollius";
4+ version = "1.0.4";
5+ name = "${pname}-${version}";
6+
7+ disabled = isPy26;
8+
9+ src = fetchPypi {
10+ inherit pname version;
11+ sha256 = "0xny8y12x3wrflmyn6xi8a7n3m3ac80fgmgzphx5jbbaxkjcm148";
12+ };
13+
14+ buildInputs = [ mock ];
15+
16+ propagatedBuildInputs = lib.optional (isPy27 || isPyPy) [ futures ];
17+
18+ patches = [
19+ ./tests.patch
20+ ];
21+
22+ # Some of the tests fail on darwin with `error: AF_UNIX path too long'
23+ # because of the *long* path names for sockets
24+ patchPhase = lib.optionalString stdenv.isDarwin ''
25+ sed -i -e "s|test_create_ssl_unix_connection|skip_test_create_ssl_unix_connection|g" tests/test_events.py
26+ sed -i -e "s|test_create_unix_connection|skip_test_create_unix_connection|g" tests/test_events.py
27+ sed -i -e "s|test_create_unix_server_existing_path_nonsock|skip_test_create_unix_server_existing_path_nonsock|g" tests/test_unix_events.py
28+ sed -i -e "s|test_create_unix_server_existing_path_sock|skip_test_create_unix_server_existing_path_sock|g" tests/test_unix_events.py
29+ sed -i -e "s|test_create_unix_server_ssl_verified|skip_test_create_unix_server_ssl_verified|g" tests/test_events.py
30+ sed -i -e "s|test_create_unix_server_ssl_verify_failed|skip_test_create_unix_server_ssl_verify_failed|g" tests/test_events.py
31+ sed -i -e "s|test_create_unix_server_ssl|skip_test_create_unix_server_ssl|g" tests/test_events.py
32+ sed -i -e "s|test_create_unix_server|skip_test_create_unix_server|g" tests/test_events.py
33+ sed -i -e "s|test_open_unix_connection_error|skip_test_open_unix_connection_error|g" tests/test_streams.py
34+ sed -i -e "s|test_open_unix_connection_no_loop_ssl|skip_test_open_unix_connection_no_loop_ssl|g" tests/test_streams.py
35+ sed -i -e "s|test_open_unix_connection|skip_test_open_unix_connection|g" tests/test_streams.py
36+ sed -i -e "s|test_pause_reading|skip_test_pause_reading|g" tests/test_subprocess.py
37+ sed -i -e "s|test_read_pty_output|skip_test_read_pty_output|g" tests/test_events.py
38+ sed -i -e "s|test_start_unix_server|skip_test_start_unix_server|g" tests/test_streams.py
39+ sed -i -e "s|test_unix_sock_client_ops|skip_test_unix_sock_client_ops|g" tests/test_events.py
40+ sed -i -e "s|test_write_pty|skip_test_write_pty|g" tests/test_events.py
41+ '';
42+
43+ meta = with stdenv.lib; {
44+ description = "Port of the Tulip project (asyncio module, PEP 3156) on Python 2";
45+ homepage = "https://bitbucket.org/enovance/trollius";
46+ license = licenses.asl20;
47+ maintainers = with maintainers; [ garbas ];
48+ };
49+}
pkgs/development/python-modules/trollius/tests.patchnew file+13
@@ -0,0 +1,13 @@
1+diff --git i/tests/test_asyncio.py w/tests/test_asyncio.py
2+index 39d9e1a..05b7e6f 100644
3+--- i/tests/test_asyncio.py
4++++ w/tests/test_asyncio.py
5+@@ -69,7 +69,7 @@ class AsyncioTests(test_utils.TestCase):
6+ def step_future():
7+ future = asyncio.Future()
8+ self.loop.call_soon(future.set_result, "asyncio.Future")
9+- return (yield from future)
10++ return (yield From(future))
11+
12+ # test in release mode
13+ trollius.coroutines._DEBUG = False
pkgs/top-level/python-packages.nix+1−59
@@ -25130,65 +25130,7 @@ EOF
2513025130 };
2513125131 };
2513225132
25133− trollius = buildPythonPackage rec {
25134− version = "1.0.4";
25135− name = "trollius-${version}";
25136− disabled = isPy34;
25137−
25138− src = pkgs.fetchurl {
25139− url = "mirror://pypi/t/trollius/${name}.tar.gz";
25140− sha256 = "8884cae4ec6a2d593abcffd5e700626ad4618f42b11beb2b75998f2e8247de76";
25141− };
25142−
25143− buildInputs = with self; [ mock ]
25144− ++ optional isPy26 unittest2;
25145−
25146− propagatedBuildInputs = with self; []
25147− ++ optional isPy26 ordereddict
25148− ++ optional (isPy26 || isPy27 || isPyPy) futures;
25149−
25150− # Some of the tests fail on darwin with `error: AF_UNIX path too long'
25151− # because of the *long* path names for sockets
25152− patchPhase = optionalString stdenv.isDarwin ''
25153− sed -i -e "s|test_create_ssl_unix_connection|skip_test_create_ssl_unix_connection|" tests/test_events.py
25154− sed -i -e "s|test_create_unix_connection|skip_test_create_unix_connection|" tests/test_events.py
25155− sed -i -e "s|test_create_unix_connection|skip_test_create_unix_connection|" tests/test_events.py
25156− sed -i -e "s|test_create_unix_connection|skip_test_create_unix_connection|" tests/test_events.py
25157− sed -i -e "s|test_create_unix_server_existing_path_nonsock|skip_test_create_unix_server_existing_path_nonsock|" tests/test_unix_events.py
25158− sed -i -e "s|test_create_unix_server_existing_path_sock|skip_test_create_unix_server_existing_path_sock|" tests/test_unix_events.py
25159− sed -i -e "s|test_create_unix_server_ssl_verified|skip_test_create_unix_server_ssl_verified|" tests/test_events.py
25160− sed -i -e "s|test_create_unix_server_ssl_verified|skip_test_create_unix_server_ssl_verified|" tests/test_events.py
25161− sed -i -e "s|test_create_unix_server_ssl_verified|skip_test_create_unix_server_ssl_verified|" tests/test_events.py
25162− sed -i -e "s|test_create_unix_server_ssl_verify_failed|skip_test_create_unix_server_ssl_verify_failed|" tests/test_events.py
25163− sed -i -e "s|test_create_unix_server_ssl_verify_failed|skip_test_create_unix_server_ssl_verify_failed|" tests/test_events.py
25164− sed -i -e "s|test_create_unix_server_ssl_verify_failed|skip_test_create_unix_server_ssl_verify_failed|" tests/test_events.py
25165− sed -i -e "s|test_create_unix_server_ssl|skip_test_create_unix_server_ssl|" tests/test_events.py
25166− sed -i -e "s|test_create_unix_server_ssl|skip_test_create_unix_server_ssl|" tests/test_events.py
25167− sed -i -e "s|test_create_unix_server_ssl|skip_test_create_unix_server_ssl|" tests/test_events.py
25168− sed -i -e "s|test_create_unix_server|skip_test_create_unix_server|" tests/test_events.py
25169− sed -i -e "s|test_create_unix_server|skip_test_create_unix_server|" tests/test_events.py
25170− sed -i -e "s|test_create_unix_server|skip_test_create_unix_server|" tests/test_events.py
25171− sed -i -e "s|test_open_unix_connection_error|skip_test_open_unix_connection_error|" tests/test_streams.py
25172− sed -i -e "s|test_open_unix_connection_no_loop_ssl|skip_test_open_unix_connection_no_loop_ssl|" tests/test_streams.py
25173− sed -i -e "s|test_open_unix_connection|skip_test_open_unix_connection|" tests/test_streams.py
25174− sed -i -e "s|test_pause_reading|skip_test_pause_reading|" tests/test_subprocess.py
25175− sed -i -e "s|test_read_pty_output|skip_test_read_pty_output|" tests/test_events.py
25176− sed -i -e "s|test_start_unix_server|skip_test_start_unix_server|" tests/test_streams.py
25177− sed -i -e "s|test_unix_sock_client_ops|skip_test_unix_sock_client_ops|" tests/test_events.py
25178− sed -i -e "s|test_unix_sock_client_ops|skip_test_unix_sock_client_ops|" tests/test_events.py
25179− sed -i -e "s|test_unix_sock_client_ops|skip_test_unix_sock_client_ops|" tests/test_events.py
25180− sed -i -e "s|test_write_pty|skip_test_write_pty|" tests/test_events.py
25181− '' + optionalString isPy26 ''
25182− sed -i -e "s|test_env_var_debug|skip_test_env_var_debug|" tests/test_tasks.py
25183− '';
25184−
25185− meta = {
25186− description = "Port of the Tulip project (asyncio module, PEP 3156) on Python 2";
25187− homepage = "https://bitbucket.org/enovance/trollius";
25188− license = licenses.asl20;
25189− maintainers = with maintainers; [ garbas ];
25190− };
25191− };
25133+ trollius = callPackage ../development/python-modules/trollius {};
2519225134
2519325135 neovim = buildPythonPackage rec {
2519425136 version = "0.1.13";