2020-11-24 20:58:05 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2020-11-03 02:18:15 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2022-04-15 01:41:22 +00:00
|
|
|
, fetchpatch
|
2020-11-03 02:18:15 +00:00
|
|
|
, pythonOlder
|
2022-06-16 17:23:12 +00:00
|
|
|
, setuptools
|
2021-06-28 23:13:55 +00:00
|
|
|
, setuptools-scm
|
2020-11-03 02:18:15 +00:00
|
|
|
, idna
|
|
|
|
, sniffio
|
|
|
|
, typing-extensions
|
|
|
|
, curio
|
|
|
|
, hypothesis
|
2021-06-28 23:13:55 +00:00
|
|
|
, mock
|
|
|
|
, pytest-mock
|
2020-11-03 02:18:15 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, trio
|
|
|
|
, trustme
|
|
|
|
, uvloop
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "anyio";
|
2022-04-15 01:41:22 +00:00
|
|
|
version = "3.5.0";
|
2020-11-03 02:18:15 +00:00
|
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "agronholm";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-04-15 01:41:22 +00:00
|
|
|
sha256 = "sha256-AZ9M/NBCBlMIUpRJgKbJRL/oReZDUh2Jhwtoxoo0tMs=";
|
2020-11-03 02:18:15 +00:00
|
|
|
};
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# Pytest 7.0 compatibility
|
|
|
|
url = "https://github.com/agronholm/anyio/commit/fed7cc4f95e196f68251bcb9253da3b143ea8e7e.patch";
|
|
|
|
sha256 = "sha256-VmZmiQEmWJ4aPz0Wx+GTMZo7jXRDScnRYf2Hu2hiRVw=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
preBuild = ''
|
|
|
|
export SETUPTOOLS_SCM_PRETEND_VERSION=${version}
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2022-06-16 17:23:12 +00:00
|
|
|
setuptools
|
2021-06-28 23:13:55 +00:00
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
idna
|
|
|
|
sniffio
|
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
# trustme uses pyopenssl
|
|
|
|
doCheck = !(stdenv.isDarwin && stdenv.isAarch64);
|
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
checkInputs = [
|
|
|
|
curio
|
|
|
|
hypothesis
|
2021-06-28 23:13:55 +00:00
|
|
|
pytest-mock
|
2020-11-03 02:18:15 +00:00
|
|
|
pytestCheckHook
|
|
|
|
trio
|
|
|
|
trustme
|
|
|
|
uvloop
|
2021-06-28 23:13:55 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
mock
|
2020-11-03 02:18:15 +00:00
|
|
|
];
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
disabledTests = [
|
|
|
|
# block devices access
|
|
|
|
"test_is_block_device"
|
|
|
|
];
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
disabledTestPaths = [
|
2021-08-05 21:33:18 +00:00
|
|
|
# lots of DNS lookups
|
2021-06-28 23:13:55 +00:00
|
|
|
"tests/test_sockets.py"
|
2020-11-24 20:58:05 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
# darwin sandboxing limitations
|
2021-06-28 23:13:55 +00:00
|
|
|
"tests/streams/test_tls.py"
|
2020-11-03 02:18:15 +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 ];
|
|
|
|
};
|
|
|
|
}
|