3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/python-modules/anyio/default.nix

82 lines
1.5 KiB
Nix
Raw Normal View History

{ stdenv
, lib
2020-10-04 00:34:35 +01:00
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, setuptools-scm
2020-10-04 00:34:35 +01:00
, idna
, sniffio
, typing-extensions
, curio
, hypothesis
2021-06-12 21:20:06 +01:00
, mock
, pytest-mock
2020-10-04 00:34:35 +01:00
, pytestCheckHook
, trio
, trustme
, uvloop
}:
buildPythonPackage rec {
pname = "anyio";
2021-09-09 19:14:14 +01:00
version = "3.3.1";
2020-10-04 00:34:35 +01:00
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "agronholm";
repo = pname;
rev = version;
2021-09-09 19:14:14 +01:00
sha256 = "sha256-JQf+OWHV2Vok5FmP7mlzeqbKUlxB+FC1c3ruX2aQEEs=";
2020-10-04 00:34:35 +01:00
};
preBuild = ''
export SETUPTOOLS_SCM_PRETEND_VERSION=${version}
'';
nativeBuildInputs = [
setuptools-scm
];
2020-10-04 00:34:35 +01:00
propagatedBuildInputs = [
idna
sniffio
] ++ lib.optionals (pythonOlder "3.8") [
typing-extensions
];
checkInputs = [
curio
hypothesis
2021-06-12 21:20:06 +01:00
pytest-mock
2020-10-04 00:34:35 +01:00
pytestCheckHook
trio
trustme
uvloop
2021-06-12 21:20:06 +01:00
] ++ lib.optionals (pythonOlder "3.8") [
mock
2020-10-04 00:34:35 +01:00
];
2021-07-27 10:06:25 +01:00
disabledTests = [
# block devices access
"test_is_block_device"
];
2021-06-12 21:20:06 +01:00
disabledTestPaths = [
2021-07-27 10:06:25 +01:00
# lots of DNS lookups
2021-06-12 21:20:06 +01:00
"tests/test_sockets.py"
] ++ lib.optionals stdenv.isDarwin [
# darwin sandboxing limitations
2021-06-12 21:20:06 +01:00
"tests/streams/test_tls.py"
2020-10-04 00:34:35 +01: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 ];
};
}