2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, pythonOlder
|
2021-12-06 16:07:01 +00:00
|
|
|
# install_requires
|
2020-04-24 23:36:52 +00:00
|
|
|
, attrs
|
2021-12-06 16:07:01 +00:00
|
|
|
, charset-normalizer
|
2021-03-19 17:17:44 +00:00
|
|
|
, multidict
|
2021-12-06 16:07:01 +00:00
|
|
|
, async-timeout
|
2021-03-19 17:17:44 +00:00
|
|
|
, yarl
|
2021-12-06 16:07:01 +00:00
|
|
|
, frozenlist
|
|
|
|
, aiosignal
|
|
|
|
, aiodns
|
|
|
|
, brotli
|
|
|
|
, cchardet
|
|
|
|
, asynctest
|
|
|
|
, typing-extensions
|
|
|
|
, idna-ssl
|
|
|
|
# tests_require
|
2020-04-24 23:36:52 +00:00
|
|
|
, async_generator
|
|
|
|
, freezegun
|
2021-03-19 17:17:44 +00:00
|
|
|
, gunicorn
|
|
|
|
, pytest-mock
|
|
|
|
, pytestCheckHook
|
2020-12-07 07:45:13 +00:00
|
|
|
, re-assert
|
2021-03-19 17:17:44 +00:00
|
|
|
, trustme
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "aiohttp";
|
2021-12-26 17:43:05 +00:00
|
|
|
version = "3.8.1";
|
2021-03-19 17:17:44 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-12-26 17:43:05 +00:00
|
|
|
sha256 = "fc5471e1a54de15ef71c1bc6ebe80d4dc681ea600e68bfd1cbce40427f0b7578";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
postPatch = ''
|
2021-12-06 16:07:01 +00:00
|
|
|
sed -i '/--cov/d' setup.cfg
|
2021-03-19 17:17:44 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-12-07 07:45:13 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
attrs
|
2021-12-06 16:07:01 +00:00
|
|
|
charset-normalizer
|
2020-12-07 07:45:13 +00:00
|
|
|
multidict
|
2021-12-06 16:07:01 +00:00
|
|
|
async-timeout
|
2020-12-07 07:45:13 +00:00
|
|
|
yarl
|
2021-12-06 16:07:01 +00:00
|
|
|
typing-extensions
|
|
|
|
frozenlist
|
|
|
|
aiosignal
|
|
|
|
aiodns
|
|
|
|
brotli
|
|
|
|
cchardet
|
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
asynctest
|
|
|
|
typing-extensions
|
2020-12-07 07:45:13 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.7") [
|
|
|
|
idna-ssl
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
checkInputs = [
|
|
|
|
async_generator
|
|
|
|
freezegun
|
|
|
|
gunicorn
|
|
|
|
pytest-mock
|
|
|
|
pytestCheckHook
|
|
|
|
re-assert
|
|
|
|
trustme
|
|
|
|
];
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
disabledTests = [
|
2021-03-19 17:17:44 +00:00
|
|
|
# Disable tests that require network access
|
2021-12-06 16:07:01 +00:00
|
|
|
"test_client_session_timeout_zero"
|
2020-12-07 07:45:13 +00:00
|
|
|
"test_mark_formdata_as_processed"
|
2021-12-06 16:07:01 +00:00
|
|
|
"test_requote_redirect_url_default"
|
2020-06-18 07:06:33 +00:00
|
|
|
] ++ lib.optionals stdenv.is32bit [
|
|
|
|
"test_cookiejar"
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2021-03-19 17:17:44 +00:00
|
|
|
"test_addresses" # https://github.com/aio-libs/aiohttp/issues/3572, remove >= v4.0.0
|
2020-06-18 07:06:33 +00:00
|
|
|
"test_close"
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
"test_proxy_functional.py" # FIXME package proxy.py
|
|
|
|
];
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
# aiohttp in current folder shadows installed version
|
|
|
|
# Probably because we run `python -m pytest` instead of `pytest` in the hook.
|
|
|
|
preCheck = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|