2020-11-24 20:58:05 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2020-11-03 02:18:15 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
# build-system
|
2022-06-16 17:23:12 +00:00
|
|
|
, setuptools
|
2021-06-28 23:13:55 +00:00
|
|
|
, setuptools-scm
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
# dependencies
|
|
|
|
, exceptiongroup
|
2020-11-03 02:18:15 +00:00
|
|
|
, idna
|
|
|
|
, sniffio
|
2024-02-29 20:09:43 +00:00
|
|
|
, typing-extensions
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
# optionals
|
|
|
|
, trio
|
|
|
|
|
|
|
|
# tests
|
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
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "anyio";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "4.2.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-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-9BxzdeQ5Yh4FDXGNVx9kiy7/fBmn8esvZkrK4wW4oGA=";
|
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
|
|
|
|
];
|
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
idna
|
|
|
|
sniffio
|
2023-07-15 17:15:38 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.11") [
|
|
|
|
exceptiongroup
|
2024-02-29 20:09:43 +00:00
|
|
|
typing-extensions
|
2020-11-03 02:18:15 +00:00
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
trio = [
|
|
|
|
trio
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
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 = [
|
|
|
|
"-W" "ignore::trio.TrioDeprecationWarning"
|
2023-07-15 17:15:38 +00:00
|
|
|
"-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-02-29 20:09:43 +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 ];
|
|
|
|
};
|
|
|
|
}
|