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.

97 lines
2.0 KiB
Nix
Raw Normal View History

{ stdenv
, lib
2020-10-03 23:34:35 +00:00
, buildPythonPackage
, fetchFromGitHub
2022-03-03 14:27:25 +00:00
, fetchpatch
2020-10-03 23:34:35 +00:00
, pythonOlder
2022-06-13 04:37:23 +00:00
, setuptools
, setuptools-scm
2020-10-03 23:34:35 +00:00
, idna
, sniffio
, typing-extensions
, curio
, hypothesis
2021-06-12 20:20:06 +00:00
, mock
, pytest-mock
2020-10-03 23:34:35 +00:00
, pytestCheckHook
, trio
, trustme
, uvloop
}:
buildPythonPackage rec {
pname = "anyio";
version = "3.6.2";
2020-10-03 23:34:35 +00:00
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "agronholm";
repo = pname;
rev = version;
hash = "sha256-bootaulvx9zmobQGDirsMz5uxuLeCD9ggAvYkPaKnWo=";
2020-10-03 23:34:35 +00:00
};
preBuild = ''
export SETUPTOOLS_SCM_PRETEND_VERSION=${version}
'';
nativeBuildInputs = [
2022-06-13 04:37:23 +00:00
setuptools
setuptools-scm
];
2020-10-03 23:34:35 +00:00
propagatedBuildInputs = [
idna
sniffio
] ++ lib.optionals (pythonOlder "3.8") [
typing-extensions
];
# trustme uses pyopenssl
doCheck = !(stdenv.isDarwin && stdenv.isAarch64);
nativeCheckInputs = [
2020-10-03 23:34:35 +00:00
curio
hypothesis
2021-06-12 20:20:06 +00:00
pytest-mock
2020-10-03 23:34:35 +00:00
pytestCheckHook
trio
trustme
uvloop
2021-06-12 20:20:06 +00:00
] ++ lib.optionals (pythonOlder "3.8") [
mock
2020-10-03 23:34:35 +00:00
];
pytestFlagsArray = [
"-W" "ignore::trio.TrioDeprecationWarning"
];
2021-07-27 09:06:25 +00:00
disabledTests = [
# block devices access
"test_is_block_device"
# INTERNALERROR> AttributeError: 'NonBaseMultiError' object has no attribute '_exceptions'. Did you mean: 'exceptions'?
"test_exception_group_children"
"test_exception_group_host"
"test_exception_group_filtering"
2021-07-27 09:06:25 +00:00
];
2021-06-12 20:20:06 +00:00
disabledTestPaths = [
2021-07-27 09:06:25 +00:00
# lots of DNS lookups
2021-06-12 20:20:06 +00:00
"tests/test_sockets.py"
] ++ lib.optionals stdenv.isDarwin [
# darwin sandboxing limitations
2021-06-12 20:20:06 +00:00
"tests/streams/test_tls.py"
2020-10-03 23:34:35 +00:00
];
pythonImportsCheck = [ "anyio" ];
meta = with lib; {
changelog = "https://github.com/agronholm/anyio/blob/${src.rev}/docs/versionhistory.rst";
2020-10-03 23:34:35 +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 ];
};
}