2020-04-24 23:36:52 +00:00
|
|
|
|
{ lib
|
|
|
|
|
, stdenv
|
|
|
|
|
, buildPythonPackage
|
|
|
|
|
, fetchPypi
|
2023-03-04 12:14:45 +00:00
|
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, pythonOlder
|
2023-05-24 13:37:59 +00:00
|
|
|
|
# build_requires
|
|
|
|
|
, setuptools
|
2023-08-22 20:05:09 +00:00
|
|
|
|
, wheel
|
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
|
2023-03-15 16:39:30 +00:00
|
|
|
|
, faust-cchardet
|
2021-12-06 16:07:01 +00:00
|
|
|
|
, asynctest
|
|
|
|
|
, typing-extensions
|
|
|
|
|
, idna-ssl
|
|
|
|
|
# tests_require
|
2023-08-10 07:59:29 +00:00
|
|
|
|
, async-generator
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, 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";
|
2023-08-10 07:59:29 +00:00
|
|
|
|
version = "3.8.5";
|
2023-01-20 10:41:00 +00:00
|
|
|
|
format = "pyproject";
|
|
|
|
|
|
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;
|
2023-08-10 07:59:29 +00:00
|
|
|
|
hash = "sha256-uVUuxSzBR9vxlErHrJivdgLlHqLc0HbtGUyjwNHH0Lw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
|
patches = [
|
2023-08-04 22:07:22 +00:00
|
|
|
|
(fetchpatch {
|
|
|
|
|
# https://github.com/aio-libs/aiohttp/pull/7260
|
2023-08-10 07:59:29 +00:00
|
|
|
|
# Merged upstream, should likely be dropped post-3.8.5
|
2023-08-04 22:07:22 +00:00
|
|
|
|
url = "https://github.com/aio-libs/aiohttp/commit/7dcc235cafe0c4521bbbf92f76aecc82fee33e8b.patch";
|
|
|
|
|
hash = "sha256-ZzhlE50bmA+e2XX2RH1FuWQHZIAa6Dk/hZjxPoX5t4g=";
|
|
|
|
|
})
|
2023-08-22 20:05:09 +00:00
|
|
|
|
# https://github.com/aio-libs/aiohttp/pull/7454 but does not merge cleanly
|
|
|
|
|
./setuptools-67.5.0-compatibility.diff
|
2023-03-04 12:14:45 +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
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
|
nativeBuildInputs = [
|
|
|
|
|
setuptools
|
2023-08-22 20:05:09 +00:00
|
|
|
|
wheel
|
2023-05-24 13:37:59 +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
|
2023-03-15 16:39:30 +00:00
|
|
|
|
faust-cchardet
|
2021-12-06 16:07:01 +00:00
|
|
|
|
] ++ 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
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
|
# NOTE: pytest-xdist cannot be added because it is flaky. See https://github.com/NixOS/nixpkgs/issues/230597 for more info.
|
2023-02-02 18:25:31 +00:00
|
|
|
|
nativeCheckInputs = [
|
2023-08-10 07:59:29 +00:00
|
|
|
|
async-generator
|
2021-03-19 17:17:44 +00:00
|
|
|
|
freezegun
|
|
|
|
|
gunicorn
|
|
|
|
|
pytest-mock
|
|
|
|
|
pytestCheckHook
|
|
|
|
|
re-assert
|
2022-06-16 17:23:12 +00:00
|
|
|
|
] ++ lib.optionals (!(stdenv.isDarwin && stdenv.isAarch64)) [
|
|
|
|
|
# Optional test dependency. Depends indirectly on pyopenssl, which is
|
|
|
|
|
# broken on aarch64-darwin.
|
2021-03-19 17:17:44 +00:00
|
|
|
|
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"
|
2022-04-15 01:41:22 +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"
|
2023-08-10 07:59:29 +00:00
|
|
|
|
# https://github.com/aio-libs/aiohttp/issues/7130
|
|
|
|
|
"test_static_file_if_none_match"
|
|
|
|
|
"test_static_file_if_match"
|
|
|
|
|
"test_static_file_if_modified_since_past_date"
|
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
|
2022-03-30 09:31:56 +00:00
|
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
|
# Work around "OSError: AF_UNIX path too long"
|
|
|
|
|
export TMPDIR="/tmp"
|
2023-04-29 16:46:19 +00:00
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
meta = with lib; {
|
2023-03-15 16:39:30 +00:00
|
|
|
|
changelog = "https://github.com/aio-libs/aiohttp/blob/v${version}/CHANGES.rst";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
description = "Asynchronous HTTP Client/Server for Python and asyncio";
|
|
|
|
|
license = licenses.asl20;
|
|
|
|
|
homepage = "https://github.com/aio-libs/aiohttp";
|
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
|
};
|
|
|
|
|
}
|