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
|
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";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "3.7.0";
|
2020-11-03 02:18:15 +00:00
|
|
|
format = "pyproject";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "agronholm";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-uXPp2ycYl3T/ybZihDchImC/Yi4qgHI37ZeA+I6dg4c=";
|
2020-11-03 02:18:15 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
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
|
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 = [
|
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
|
2023-07-15 17:15:38 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.12") [
|
2020-11-03 02:18:15 +00:00
|
|
|
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
|
|
|
];
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
disabledTests = [
|
2023-01-20 10:41:00 +00:00
|
|
|
# INTERNALERROR> AttributeError: 'NonBaseMultiError' object has no attribute '_exceptions'. Did you mean: 'exceptions'?
|
|
|
|
"test_exception_group_children"
|
|
|
|
"test_exception_group_host"
|
|
|
|
"test_exception_group_filtering"
|
2023-07-15 17:15:38 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
# 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;
|
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
pythonImportsCheck = [ "anyio" ];
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|