at 23.05-pre 1.9 kB view raw
1{ stdenv 2, lib 3, buildPythonPackage 4, fetchFromGitHub 5, fetchpatch 6, pythonOlder 7, setuptools 8, setuptools-scm 9, idna 10, sniffio 11, typing-extensions 12, curio 13, hypothesis 14, mock 15, pytest-mock 16, pytestCheckHook 17, trio 18, trustme 19, uvloop 20}: 21 22buildPythonPackage rec { 23 pname = "anyio"; 24 version = "3.5.0"; 25 format = "pyproject"; 26 disabled = pythonOlder "3.7"; 27 28 src = fetchFromGitHub { 29 owner = "agronholm"; 30 repo = pname; 31 rev = version; 32 sha256 = "sha256-AZ9M/NBCBlMIUpRJgKbJRL/oReZDUh2Jhwtoxoo0tMs="; 33 }; 34 35 patches = [ 36 (fetchpatch { 37 # Pytest 7.0 compatibility 38 url = "https://github.com/agronholm/anyio/commit/fed7cc4f95e196f68251bcb9253da3b143ea8e7e.patch"; 39 sha256 = "sha256-VmZmiQEmWJ4aPz0Wx+GTMZo7jXRDScnRYf2Hu2hiRVw="; 40 }) 41 ]; 42 43 preBuild = '' 44 export SETUPTOOLS_SCM_PRETEND_VERSION=${version} 45 ''; 46 47 nativeBuildInputs = [ 48 setuptools 49 setuptools-scm 50 ]; 51 52 propagatedBuildInputs = [ 53 idna 54 sniffio 55 ] ++ lib.optionals (pythonOlder "3.8") [ 56 typing-extensions 57 ]; 58 59 # trustme uses pyopenssl 60 doCheck = !(stdenv.isDarwin && stdenv.isAarch64); 61 62 checkInputs = [ 63 curio 64 hypothesis 65 pytest-mock 66 pytestCheckHook 67 trio 68 trustme 69 uvloop 70 ] ++ lib.optionals (pythonOlder "3.8") [ 71 mock 72 ]; 73 74 disabledTests = [ 75 # block devices access 76 "test_is_block_device" 77 ]; 78 79 disabledTestPaths = [ 80 # lots of DNS lookups 81 "tests/test_sockets.py" 82 ] ++ lib.optionals stdenv.isDarwin [ 83 # darwin sandboxing limitations 84 "tests/streams/test_tls.py" 85 ]; 86 87 pythonImportsCheck = [ "anyio" ]; 88 89 meta = with lib; { 90 description = "High level compatibility layer for multiple asynchronous event loop implementations on Python"; 91 homepage = "https://github.com/agronholm/anyio"; 92 license = licenses.mit; 93 maintainers = with maintainers; [ hexa ]; 94 }; 95}