2017-09-05 09:16:41 +00:00
|
|
|
|
{ lib
|
2020-02-17 23:52:55 +00:00
|
|
|
|
, stdenv
|
2017-09-05 09:16:41 +00:00
|
|
|
|
, buildPythonPackage
|
|
|
|
|
, fetchPypi
|
2023-02-18 15:05:29 +00:00
|
|
|
|
, fetchpatch
|
2017-09-05 09:16:41 +00:00
|
|
|
|
, pythonOlder
|
2021-11-12 08:04:33 +00:00
|
|
|
|
# install_requires
|
2018-02-12 11:05:12 +00:00
|
|
|
|
, attrs
|
2021-11-12 08:04:33 +00:00
|
|
|
|
, charset-normalizer
|
2021-02-27 12:05:52 +00:00
|
|
|
|
, multidict
|
2021-11-12 08:04:33 +00:00
|
|
|
|
, async-timeout
|
2021-02-27 12:05:52 +00:00
|
|
|
|
, yarl
|
2021-11-12 08:04:33 +00:00
|
|
|
|
, frozenlist
|
|
|
|
|
, aiosignal
|
|
|
|
|
, aiodns
|
|
|
|
|
, brotli
|
2023-03-02 14:17:40 +00:00
|
|
|
|
, faust-cchardet
|
2021-11-12 08:04:33 +00:00
|
|
|
|
, asynctest
|
|
|
|
|
, typing-extensions
|
|
|
|
|
, idna-ssl
|
|
|
|
|
# tests_require
|
2019-01-10 14:11:46 +00:00
|
|
|
|
, async_generator
|
2019-10-17 08:45:15 +00:00
|
|
|
|
, freezegun
|
2021-02-27 12:05:52 +00:00
|
|
|
|
, gunicorn
|
|
|
|
|
, pytest-mock
|
2023-03-26 20:24:55 +00:00
|
|
|
|
, pytest-xdist
|
2021-02-27 12:05:52 +00:00
|
|
|
|
, pytestCheckHook
|
2020-11-30 16:55:00 +00:00
|
|
|
|
, re-assert
|
2021-02-27 12:05:52 +00:00
|
|
|
|
, trustme
|
2017-09-05 09:16:41 +00:00
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
|
pname = "aiohttp";
|
2023-02-13 02:31:47 +00:00
|
|
|
|
version = "3.8.4";
|
2022-12-31 12:43:27 +00:00
|
|
|
|
format = "pyproject";
|
|
|
|
|
|
2021-02-27 12:05:52 +00:00
|
|
|
|
disabled = pythonOlder "3.6";
|
2017-09-05 09:16:41 +00:00
|
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
|
inherit pname version;
|
2023-02-13 02:31:47 +00:00
|
|
|
|
hash = "sha256-vy4akWLB5EG/gFof0WbiSdV0ygTgOzT5fikodp6Rq1w=";
|
2017-09-05 09:16:41 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-02-18 15:05:29 +00:00
|
|
|
|
patches = [
|
|
|
|
|
(fetchpatch {
|
|
|
|
|
# https://github.com/aio-libs/aiohttp/pull/7178
|
|
|
|
|
url = "https://github.com/aio-libs/aiohttp/commit/5718879cdb6a98bf48810a994b78bc02abaf3e07.patch";
|
|
|
|
|
hash = "sha256-4UynkTZOzWzusQ2+MPZszhFA8I/PJNLeT/hHF/fASy8=";
|
|
|
|
|
})
|
|
|
|
|
];
|
|
|
|
|
|
2021-02-27 12:05:52 +00:00
|
|
|
|
postPatch = ''
|
2021-11-12 08:04:33 +00:00
|
|
|
|
sed -i '/--cov/d' setup.cfg
|
2022-12-31 12:43:27 +00:00
|
|
|
|
|
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
|
--replace "charset-normalizer >=2.0, < 3.0" "charset-normalizer >=2.0, < 4.0"
|
2021-02-27 12:05:52 +00:00
|
|
|
|
'';
|
2017-09-05 09:16:41 +00:00
|
|
|
|
|
2020-11-30 16:55:00 +00:00
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
|
attrs
|
2021-11-12 08:04:33 +00:00
|
|
|
|
charset-normalizer
|
2020-11-30 16:55:00 +00:00
|
|
|
|
multidict
|
2021-11-12 08:04:33 +00:00
|
|
|
|
async-timeout
|
2020-11-30 16:55:00 +00:00
|
|
|
|
yarl
|
2021-11-12 08:04:33 +00:00
|
|
|
|
typing-extensions
|
|
|
|
|
frozenlist
|
|
|
|
|
aiosignal
|
|
|
|
|
aiodns
|
|
|
|
|
brotli
|
2023-03-02 14:17:40 +00:00
|
|
|
|
faust-cchardet
|
2021-11-12 08:04:33 +00:00
|
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
|
asynctest
|
|
|
|
|
typing-extensions
|
2020-11-30 16:55:00 +00:00
|
|
|
|
] ++ lib.optionals (pythonOlder "3.7") [
|
|
|
|
|
idna-ssl
|
|
|
|
|
];
|
2018-06-23 10:02:20 +00:00
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
|
nativeCheckInputs = [
|
2021-02-27 12:05:52 +00:00
|
|
|
|
async_generator
|
|
|
|
|
freezegun
|
|
|
|
|
gunicorn
|
|
|
|
|
pytest-mock
|
2023-03-26 20:24:55 +00:00
|
|
|
|
pytest-xdist
|
2021-02-27 12:05:52 +00:00
|
|
|
|
pytestCheckHook
|
|
|
|
|
re-assert
|
2022-05-25 16:14:26 +00:00
|
|
|
|
] ++ lib.optionals (!(stdenv.isDarwin && stdenv.isAarch64)) [
|
|
|
|
|
# Optional test dependency. Depends indirectly on pyopenssl, which is
|
|
|
|
|
# broken on aarch64-darwin.
|
2021-02-27 12:05:52 +00:00
|
|
|
|
trustme
|
|
|
|
|
];
|
|
|
|
|
|
2020-06-11 06:24:40 +00:00
|
|
|
|
disabledTests = [
|
2021-02-27 12:05:52 +00:00
|
|
|
|
# Disable tests that require network access
|
2021-11-12 08:04:33 +00:00
|
|
|
|
"test_client_session_timeout_zero"
|
2020-11-30 16:55:00 +00:00
|
|
|
|
"test_mark_formdata_as_processed"
|
2021-11-12 08:04:33 +00:00
|
|
|
|
"test_requote_redirect_url_default"
|
2022-03-03 12:35:01 +00:00
|
|
|
|
# Disable tests that trigger deprecation warnings in pytest
|
|
|
|
|
"test_async_with_session"
|
|
|
|
|
"test_session_close_awaitable"
|
|
|
|
|
"test_close_run_until_complete_not_deprecated"
|
2020-06-11 06:24:40 +00:00
|
|
|
|
] ++ lib.optionals stdenv.is32bit [
|
|
|
|
|
"test_cookiejar"
|
2020-06-16 04:23:23 +00:00
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2021-02-27 12:05:52 +00:00
|
|
|
|
"test_addresses" # https://github.com/aio-libs/aiohttp/issues/3572, remove >= v4.0.0
|
2020-06-16 04:23:23 +00:00
|
|
|
|
"test_close"
|
2020-06-11 06:24:40 +00:00
|
|
|
|
];
|
|
|
|
|
|
2021-11-12 08:04:33 +00:00
|
|
|
|
disabledTestPaths = [
|
|
|
|
|
"test_proxy_functional.py" # FIXME package proxy.py
|
|
|
|
|
];
|
|
|
|
|
|
2021-02-27 12:05:52 +00:00
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
|
2020-06-11 06:24:40 +00:00
|
|
|
|
# aiohttp in current folder shadows installed version
|
|
|
|
|
# Probably because we run `python -m pytest` instead of `pytest` in the hook.
|
|
|
|
|
preCheck = ''
|
2019-10-17 08:45:15 +00:00
|
|
|
|
cd tests
|
2022-02-19 21:39:12 +00:00
|
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
|
# Work around "OSError: AF_UNIX path too long"
|
|
|
|
|
export TMPDIR="/tmp"
|
2023-03-26 20:24:55 +00:00
|
|
|
|
'';
|
2019-06-15 06:42:51 +00:00
|
|
|
|
|
2018-02-02 14:13:31 +00:00
|
|
|
|
meta = with lib; {
|
2023-02-13 02:31:47 +00:00
|
|
|
|
changelog = "https://github.com/aio-libs/aiohttp/blob/v${version}/CHANGES.rst";
|
2018-02-02 14:13:31 +00:00
|
|
|
|
description = "Asynchronous HTTP Client/Server for Python and asyncio";
|
|
|
|
|
license = licenses.asl20;
|
2020-04-01 01:11:51 +00:00
|
|
|
|
homepage = "https://github.com/aio-libs/aiohttp";
|
2018-02-02 14:13:31 +00:00
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
2017-09-05 09:16:41 +00:00
|
|
|
|
};
|
2018-01-23 16:30:09 +00:00
|
|
|
|
}
|