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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

91 lines
1.7 KiB
Nix
Raw Normal View History

{ stdenv
, lib
2020-10-04 00:34:35 +01:00
, buildPythonPackage
, fetchFromGitHub
2022-03-03 14:27:25 +00:00
, fetchpatch
2020-10-04 00:34:35 +01:00
, 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";
2022-03-03 14:27:25 +00:00
version = "3.5.0";
2020-10-04 00:34:35 +01:00
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "agronholm";
repo = pname;
rev = version;
2022-03-03 14:27:25 +00:00
sha256 = "sha256-AZ9M/NBCBlMIUpRJgKbJRL/oReZDUh2Jhwtoxoo0tMs=";
2020-10-04 00:34:35 +01:00
};
2022-03-03 14:27:25 +00:00
patches = [
(fetchpatch {
# Pytest 7.0 compatibility
url = "https://github.com/agronholm/anyio/commit/fed7cc4f95e196f68251bcb9253da3b143ea8e7e.patch";
sha256 = "sha256-VmZmiQEmWJ4aPz0Wx+GTMZo7jXRDScnRYf2Hu2hiRVw=";
})
];
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 ];
};
}