nixpkgs/pkgs/development/python-modules/aiohttp/default.nix
Martin Weinelt af84578114 python3Packages.aiohttp: remove pytest-xdist
Fails reproducible on hydra like this:

```
        try:
            # set_wakeup_fd() raises ValueError if this is not the
            # main thread.  By calling it early we ensure that an
            # event loop running in another thread cannot add a signal
            # handler.
>           signal.set_wakeup_fd(self._csock.fileno())
E           ValueError: set_wakeup_fd only works in main thread of the main interpreter
```

And was remove from upstreams tests due to 10-15% error rate way back
in 2018.
2021-06-22 13:42:53 +02:00

84 lines
1.6 KiB
Nix

{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, pythonOlder
, async-timeout
, attrs
, chardet
, idna-ssl
, multidict
, typing-extensions
, yarl
, async_generator
, brotlipy
, freezegun
, gunicorn
, pytest-mock
, pytestCheckHook
, re-assert
, trustme
}:
buildPythonPackage rec {
pname = "aiohttp";
version = "3.7.4.post0";
disabled = pythonOlder "3.6";
src = fetchPypi {
inherit pname version;
sha256 = "493d3299ebe5f5a7c66b9819eacdcfbbaaf1a8e84911ddffcdc48888497afecf";
};
postPatch = ''
substituteInPlace setup.cfg --replace " --cov=aiohttp" ""
'';
propagatedBuildInputs = [
async-timeout
attrs
chardet
multidict
typing-extensions
yarl
] ++ lib.optionals (pythonOlder "3.7") [
idna-ssl
];
checkInputs = [
async_generator
brotlipy
freezegun
gunicorn
pytest-mock
pytestCheckHook
re-assert
trustme
];
disabledTests = [
# Disable tests that require network access
"test_mark_formdata_as_processed"
] ++ lib.optionals stdenv.is32bit [
"test_cookiejar"
] ++ lib.optionals stdenv.isDarwin [
"test_addresses" # https://github.com/aio-libs/aiohttp/issues/3572, remove >= v4.0.0
"test_close"
];
__darwinAllowLocalNetworking = true;
# aiohttp in current folder shadows installed version
# Probably because we run `python -m pytest` instead of `pytest` in the hook.
preCheck = ''
cd tests
'';
meta = with lib; {
description = "Asynchronous HTTP Client/Server for Python and asyncio";
license = licenses.asl20;
homepage = "https://github.com/aio-libs/aiohttp";
maintainers = with maintainers; [ dotlambda ];
};
}