2021-01-25 08:26:54 +00:00
|
|
|
{ lib, buildPythonPackage, fetchPypi
|
2018-09-06 19:50:50 +01:00
|
|
|
, nose, psutil, mock }:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2020-07-31 09:56:46 +01:00
|
|
|
version = "2.0.2";
|
2018-09-06 19:50:50 +01:00
|
|
|
pname = "selectors2";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-07-31 09:56:46 +01:00
|
|
|
sha256 = "1f1bbaac203a23fbc851dc1b5a6e92c50698cc8cefa5873eb5b89eef53d1d82b";
|
2018-09-06 19:50:50 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
checkInputs = [ nose psutil mock ];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/46186#issuecomment-419450064
|
|
|
|
# Trick to disable certain tests that depend on timing which
|
|
|
|
# will always fail on hydra
|
|
|
|
export TRAVIS=""
|
pythonPackages.selectors2: fix build by disabling failing test_above_fd_setsize
This fixes the following error in the `selectors2` test suite:
```
======================================================================
ERROR: test_above_fd_setsize (tests.test_selectors2.PollSelectorTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/private/var/folders/5h/b11m6fxj2tqgbxwz5bgjy42c0000gn/T/nix-build-python3.8-selectors2-2.0.1.drv-0/selectors2-2.0.1/tests/test_selectors2.py", line 530, in test_above_fd_setsize
self.assertEqual(limit_nofile // 2, len(s.select()))
File "/private/var/folders/5h/b11m6fxj2tqgbxwz5bgjy42c0000gn/T/nix-build-python3.8-selectors2-2.0.1.drv-0/selectors2-2.0.1/selectors2.py", line 402, in select
fd_events = _syscall_wrapper(self._wrap_poll, True, timeout=timeout)
File "/private/var/folders/5h/b11m6fxj2tqgbxwz5bgjy42c0000gn/T/nix-build-python3.8-selectors2-2.0.1.drv-0/selectors2-2.0.1/selectors2.py", line 662, in _syscall_wrapper
return func(*args, **kwargs)
File "/private/var/folders/5h/b11m6fxj2tqgbxwz5bgjy42c0000gn/T/nix-build-python3.8-selectors2-2.0.1.drv-0/selectors2-2.0.1/selectors2.py", line 397, in _wrap_poll
result = self._poll.poll(timeout)
OSError: [Errno 22] Invalid argument
----------------------------------------------------------------------
```
2020-06-30 14:29:54 +01:00
|
|
|
nosetests tests/test_selectors2.py \
|
|
|
|
--exclude=test_above_fd_setsize
|
2018-09-06 19:50:50 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.github.com/SethMichaelLarson/selectors2";
|
2018-09-06 19:50:50 +01:00
|
|
|
description = "Back-ported, durable, and portable selectors";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.costrouc ];
|
|
|
|
};
|
|
|
|
}
|