2020-10-30 22:40:36 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2020-10-03 23:34:35 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2022-03-03 14:27:25 +00:00
|
|
|
, fetchpatch
|
2020-10-03 23:34:35 +00:00
|
|
|
, pythonOlder
|
2021-06-21 11:43:55 +00:00
|
|
|
, setuptools-scm
|
2020-10-03 23:34:35 +00:00
|
|
|
, idna
|
|
|
|
, sniffio
|
|
|
|
, typing-extensions
|
|
|
|
, curio
|
|
|
|
, hypothesis
|
2021-06-12 20:20:06 +00:00
|
|
|
, mock
|
|
|
|
, pytest-mock
|
2020-10-03 23:34:35 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, trio
|
|
|
|
, trustme
|
|
|
|
, uvloop
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "anyio";
|
2022-03-03 14:27:25 +00:00
|
|
|
version = "3.5.0";
|
2020-10-03 23:34:35 +00:00
|
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "agronholm";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-03-03 14:27:25 +00:00
|
|
|
sha256 = "sha256-AZ9M/NBCBlMIUpRJgKbJRL/oReZDUh2Jhwtoxoo0tMs=";
|
2020-10-03 23:34:35 +00:00
|
|
|
};
|
|
|
|
|
2022-03-03 14:27:25 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# Pytest 7.0 compatibility
|
|
|
|
url = "https://github.com/agronholm/anyio/commit/fed7cc4f95e196f68251bcb9253da3b143ea8e7e.patch";
|
|
|
|
sha256 = "sha256-VmZmiQEmWJ4aPz0Wx+GTMZo7jXRDScnRYf2Hu2hiRVw=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-06-21 11:43:55 +00:00
|
|
|
preBuild = ''
|
|
|
|
export SETUPTOOLS_SCM_PRETEND_VERSION=${version}
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
2020-10-03 23:34:35 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
idna
|
|
|
|
sniffio
|
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
curio
|
|
|
|
hypothesis
|
2021-06-12 20:20:06 +00:00
|
|
|
pytest-mock
|
2020-10-03 23:34:35 +00:00
|
|
|
pytestCheckHook
|
|
|
|
trio
|
|
|
|
trustme
|
|
|
|
uvloop
|
2021-06-12 20:20:06 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
mock
|
2020-10-03 23:34:35 +00:00
|
|
|
];
|
|
|
|
|
2021-07-27 09:06:25 +00:00
|
|
|
disabledTests = [
|
|
|
|
# block devices access
|
|
|
|
"test_is_block_device"
|
|
|
|
];
|
|
|
|
|
2021-06-12 20:20:06 +00:00
|
|
|
disabledTestPaths = [
|
2021-07-27 09:06:25 +00:00
|
|
|
# lots of DNS lookups
|
2021-06-12 20:20:06 +00:00
|
|
|
"tests/test_sockets.py"
|
2020-10-30 22:40:36 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
# darwin sandboxing limitations
|
2021-06-12 20:20:06 +00:00
|
|
|
"tests/streams/test_tls.py"
|
2020-10-03 23:34:35 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "anyio" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "High level compatibility layer for multiple asynchronous event loop implementations on Python";
|
|
|
|
homepage = "https://github.com/agronholm/anyio";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ hexa ];
|
|
|
|
};
|
|
|
|
}
|