git.iko.soy/typeable/nixpkgs
on master help sign in
python3Packages.uvloop: enable on python3.8

Allow build pass by disabling test. Isolated issue to test_sockets.py::TestAIOSockets::test_sock_close_add_reader_race. This test is supposed to be skipped, but it isn't for some reason, so we disable it instead. See uvloop#284 (https://github.com/MagicStack/uvloop/pull/284) for full details. Don't know why this test isn't properly skipped.

commit364909d53558ccd6adb5cf135992c6f318d6e80a authorDrew Risinger <drewrisinger@users.noreply.github.com> dateFri 3 Apr 2020, 16:22 (7 years ago) parent7f20da7
1 file changed+35−10
pkgs/development/python-modules/uvloop/default.nix+35−10
pkgs/development/python-modules/uvloop/default.nix+35−10
@@ -6,16 +6,17 @@
66, libuv
77, psutil
88, isPy27
9−, pythonAtLeast
109, CoreServices
1110, ApplicationServices
11+# Check Inputs
12+, pytestCheckHook
13+# , pytest-asyncio
1214}:
1315
1416buildPythonPackage rec {
1517 pname = "uvloop";
1618 version = "0.14.0";
17− # python 3.8 hangs on tests, assuming it's subtly broken with race condition
18− disabled = isPy27 || pythonAtLeast "3.8";
19+ disabled = isPy27;
1920
2021 src = fetchPypi {
2122 inherit pname version;
@@ -28,20 +29,44 @@ buildPythonPackage rec {
2829 libuv
2930 ] ++ lib.optionals stdenv.isDarwin [ CoreServices ApplicationServices ];
3031
31− postPatch = ''
32− # Removing code linting tests, which we don't care about
33− rm tests/test_sourcecode.py
34− '';
32+ pythonImportsCheck = [
33+ "uvloop"
34+ "uvloop.loop"
35+ ];
36+
37+ dontUseSetuptoolsCheck = true;
38+ checkInputs = [ pytestCheckHook pyopenssl psutil ];
39+
40+ pytestFlagsArray = [
41+ # from pytest.ini, these are NECESSARY to prevent failures
42+ "--capture=no"
43+ "--assert=plain"
44+ "--tb=native"
45+ # ignore code linting tests
46+ "--ignore=tests/test_sourcecode.py"
47+ ];
3548
36− checkInputs = [ pyopenssl psutil ];
49+ disabledTests = [
50+ "test_sock_cancel_add_reader_race" # asyncio version of test is supposed to be skipped but skip doesn't happen. uvloop version runs fine
51+ ];
52+
53+ # force using installed/compiled uvloop vs source by moving tests to temp dir
54+ preCheck = ''
55+ export TEST_DIR=$(mktemp -d)
56+ cp -r tests $TEST_DIR
57+ pushd $TEST_DIR
58+ '';
59+ postCheck = ''
60+ popd
61+ '';
3762
3863 # Some of the tests use localhost networking.
3964 __darwinAllowLocalNetworking = true;
4065
4166 meta = with lib; {
4267 description = "Fast implementation of asyncio event loop on top of libuv";
43− homepage = https://github.com/MagicStack/uvloop;
68+ homepage = "https://github.com/MagicStack/uvloop";
4469 license = licenses.mit;
45− maintainers = [ maintainers.costrouc ];
70+ maintainers = with maintainers; [ costrouc ];
4671 };
4772}