Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 564d9c03b3b8
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3cd943704e17
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Apr 4, 2020

  1. 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 (MagicStack/uvloop#284)
    for full details. Don't know why this test isn't properly skipped.
    
    (cherry picked from commit 364909d)
    drewrisinger committed Apr 4, 2020
    Copy the full SHA
    6118f04 View commit details
  2. Merge pull request #84224 from drewrisinger/dr-pr-backport-20.03-84223

    [20.03]: python38Packages.uvloop: enable build
    bhipple authored Apr 4, 2020
    Copy the full SHA
    3cd9437 View commit details
Showing with 35 additions and 10 deletions.
  1. +35 −10 pkgs/development/python-modules/uvloop/default.nix
45 changes: 35 additions & 10 deletions pkgs/development/python-modules/uvloop/default.nix
Original file line number Diff line number Diff line change
@@ -6,16 +6,17 @@
, libuv
, psutil
, isPy27
, pythonAtLeast
, CoreServices
, ApplicationServices
# Check Inputs
, pytestCheckHook
# , pytest-asyncio
}:

buildPythonPackage rec {
pname = "uvloop";
version = "0.14.0";
# python 3.8 hangs on tests, assuming it's subtly broken with race condition
disabled = isPy27 || pythonAtLeast "3.8";
disabled = isPy27;

src = fetchPypi {
inherit pname version;
@@ -28,20 +29,44 @@ buildPythonPackage rec {
libuv
] ++ lib.optionals stdenv.isDarwin [ CoreServices ApplicationServices ];

postPatch = ''
# Removing code linting tests, which we don't care about
rm tests/test_sourcecode.py
'';
pythonImportsCheck = [
"uvloop"
"uvloop.loop"
];

dontUseSetuptoolsCheck = true;
checkInputs = [ pytestCheckHook pyopenssl psutil ];

pytestFlagsArray = [
# from pytest.ini, these are NECESSARY to prevent failures
"--capture=no"
"--assert=plain"
"--tb=native"
# ignore code linting tests
"--ignore=tests/test_sourcecode.py"
];

checkInputs = [ pyopenssl psutil ];
disabledTests = [
"test_sock_cancel_add_reader_race" # asyncio version of test is supposed to be skipped but skip doesn't happen. uvloop version runs fine
];

# force using installed/compiled uvloop vs source by moving tests to temp dir
preCheck = ''
export TEST_DIR=$(mktemp -d)
cp -r $TMP/$sourceRoot/tests $TEST_DIR
pushd $TEST_DIR
'';
postCheck = ''
popd
'';

# Some of the tests use localhost networking.
__darwinAllowLocalNetworking = true;

meta = with lib; {
description = "Fast implementation of asyncio event loop on top of libuv";
homepage = https://github.com/MagicStack/uvloop;
homepage = "https://github.com/MagicStack/uvloop";
license = licenses.mit;
maintainers = [ maintainers.costrouc ];
maintainers = with maintainers; [ costrouc ];
};
}