1{ stdenv, lib, buildPythonPackage, fetchPypi
2, nose, psutil, mock }:
3
4buildPythonPackage rec {
5 version = "2.0.2";
6 pname = "selectors2";
7
8 src = fetchPypi {
9 inherit pname version;
10 sha256 = "1f1bbaac203a23fbc851dc1b5a6e92c50698cc8cefa5873eb5b89eef53d1d82b";
11 };
12
13 patches = [
14 ./mapping-import.patch
15 ];
16
17 nativeCheckInputs = [ nose psutil mock ];
18
19 checkPhase = ''
20 # https://github.com/NixOS/nixpkgs/pull/46186#issuecomment-419450064
21 # Trick to disable certain tests that depend on timing which
22 # will always fail on hydra
23 export TRAVIS=""
24 nosetests tests/test_selectors2.py \
25 --exclude=test_above_fd_setsize
26 '';
27
28 meta = with lib; {
29 broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
30 homepage = "https://www.github.com/SethMichaelLarson/selectors2";
31 description = "Back-ported, durable, and portable selectors";
32 license = licenses.mit;
33 maintainers = [ ];
34 };
35}