2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonOlder,
|
|
|
|
|
|
|
|
# build-system
|
|
|
|
setuptools,
|
|
|
|
setuptools-scm,
|
|
|
|
|
|
|
|
# dependencies
|
|
|
|
exceptiongroup,
|
|
|
|
idna,
|
|
|
|
sniffio,
|
|
|
|
typing-extensions,
|
|
|
|
|
|
|
|
# optionals
|
|
|
|
trio,
|
|
|
|
|
|
|
|
# tests
|
|
|
|
hypothesis,
|
|
|
|
psutil,
|
|
|
|
pytest-mock,
|
|
|
|
pytest-xdist,
|
|
|
|
pytestCheckHook,
|
|
|
|
trustme,
|
|
|
|
uvloop,
|
2020-11-03 02:18:15 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "anyio";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "4.3.0";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2020-11-03 02:18:15 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "agronholm";
|
|
|
|
repo = pname;
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-y58DQiTD0ZKaBNf0cA3MFE+7F68Svrl+Idz6BZY7HWQ=";
|
2020-11-03 02:18:15 +00:00
|
|
|
};
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
nativeBuildInputs = [
|
2022-06-16 17:23:12 +00:00
|
|
|
setuptools
|
2021-06-28 23:13:55 +00:00
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs =
|
|
|
|
[
|
|
|
|
idna
|
|
|
|
sniffio
|
|
|
|
]
|
|
|
|
++ lib.optionals (pythonOlder "3.11") [
|
|
|
|
exceptiongroup
|
|
|
|
typing-extensions
|
|
|
|
];
|
2020-11-03 02:18:15 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
passthru.optional-dependencies = {
|
2024-06-05 15:53:02 +00:00
|
|
|
trio = [ trio ];
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
# trustme uses pyopenssl
|
|
|
|
doCheck = !(stdenv.isDarwin && stdenv.isAarch64);
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2024-01-13 08:15:51 +00:00
|
|
|
exceptiongroup
|
2020-11-03 02:18:15 +00:00
|
|
|
hypothesis
|
2023-07-15 17:15:38 +00:00
|
|
|
psutil
|
2021-06-28 23:13:55 +00:00
|
|
|
pytest-mock
|
2023-04-29 16:46:19 +00:00
|
|
|
pytest-xdist
|
2020-11-03 02:18:15 +00:00
|
|
|
pytestCheckHook
|
|
|
|
trustme
|
|
|
|
uvloop
|
2023-07-15 17:15:38 +00:00
|
|
|
] ++ passthru.optional-dependencies.trio;
|
2020-11-03 02:18:15 +00:00
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
pytestFlagsArray = [
|
2024-06-05 15:53:02 +00:00
|
|
|
"-W"
|
|
|
|
"ignore::trio.TrioDeprecationWarning"
|
|
|
|
"-m"
|
|
|
|
"'not network'"
|
2023-01-20 10:41:00 +00:00
|
|
|
];
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
disabledTests = lib.optionals (stdenv.isx86_64 && stdenv.isDarwin) [
|
2023-07-15 17:15:38 +00:00
|
|
|
# PermissionError: [Errno 1] Operation not permitted: '/dev/console'
|
|
|
|
"test_is_block_device"
|
2021-08-05 21:33:18 +00:00
|
|
|
];
|
|
|
|
|
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-03 02:18:15 +00:00
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "anyio" ];
|
2020-11-03 02:18:15 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2023-01-20 10:41:00 +00:00
|
|
|
changelog = "https://github.com/agronholm/anyio/blob/${src.rev}/docs/versionhistory.rst";
|
2020-11-03 02:18:15 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|