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.

106 lines
1.9 KiB
Nix
Raw Normal View History

{ stdenv
, lib
2020-10-04 02:34:35 +03:00
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
# build-system
2022-06-13 07:37:23 +03:00
, setuptools
, setuptools-scm
# dependencies
, exceptiongroup
2020-10-04 02:34:35 +03:00
, idna
, sniffio
, typing-extensions
# optionals
, trio
# tests
2020-10-04 02:34:35 +03:00
, hypothesis
, psutil
2021-06-12 23:20:06 +03:00
, pytest-mock
, pytest-xdist
2020-10-04 02:34:35 +03:00
, pytestCheckHook
, trustme
, uvloop
}:
buildPythonPackage rec {
pname = "anyio";
version = "4.3.0";
pyproject = true;
disabled = pythonOlder "3.8";
2020-10-04 02:34:35 +03:00
src = fetchFromGitHub {
owner = "agronholm";
repo = pname;
2023-09-15 15:05:45 +03:00
rev = "refs/tags/${version}";
hash = "sha256-y58DQiTD0ZKaBNf0cA3MFE+7F68Svrl+Idz6BZY7HWQ=";
2020-10-04 02:34:35 +03:00
};
nativeBuildInputs = [
2022-06-13 07:37:23 +03:00
setuptools
setuptools-scm
];
2020-10-04 02:34:35 +03:00
propagatedBuildInputs = [
idna
sniffio
] ++ lib.optionals (pythonOlder "3.11") [
exceptiongroup
typing-extensions
2020-10-04 02:34:35 +03:00
];
passthru.optional-dependencies = {
trio = [
trio
];
};
# trustme uses pyopenssl
doCheck = !(stdenv.isDarwin && stdenv.isAarch64);
nativeCheckInputs = [
exceptiongroup
2020-10-04 02:34:35 +03:00
hypothesis
psutil
2021-06-12 23:20:06 +03:00
pytest-mock
pytest-xdist
2020-10-04 02:34:35 +03:00
pytestCheckHook
trustme
uvloop
] ++ passthru.optional-dependencies.trio;
2020-10-04 02:34:35 +03:00
pytestFlagsArray = [
"-W" "ignore::trio.TrioDeprecationWarning"
"-m" "'not network'"
];
disabledTests = lib.optionals (stdenv.isx86_64 && stdenv.isDarwin) [
# PermissionError: [Errno 1] Operation not permitted: '/dev/console'
"test_is_block_device"
2021-07-27 12:06:25 +03:00
];
2021-06-12 23:20:06 +03:00
disabledTestPaths = [
2021-07-27 12:06:25 +03:00
# lots of DNS lookups
2021-06-12 23:20:06 +03:00
"tests/test_sockets.py"
2020-10-04 02:34:35 +03:00
];
__darwinAllowLocalNetworking = true;
pythonImportsCheck = [
"anyio"
];
2020-10-04 02:34:35 +03:00
meta = with lib; {
changelog = "https://github.com/agronholm/anyio/blob/${src.rev}/docs/versionhistory.rst";
2020-10-04 02:34:35 +03: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 ];
};
}