at 25.11-pre 1.5 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 fetchpatch, 6 mock, 7 pytest-asyncio, 8 pytestCheckHook, 9 pythonOlder, 10 six, 11}: 12 13buildPythonPackage rec { 14 pname = "promise"; 15 version = "2.3.0"; 16 format = "setuptools"; 17 18 disabled = pythonOlder "3.7"; 19 20 src = fetchFromGitHub { 21 owner = "syrusakbary"; 22 repo = "promise"; 23 tag = "v${version}"; 24 hash = "sha256-5s6GMANSO4UpLOP/HAQxuNFSBSjPgvJCB9R1dOoKuJ4="; 25 }; 26 27 patches = [ 28 # Convert @asyncio.coroutine to async def, https://github.com/syrusakbary/promise/pull/99 29 (fetchpatch { 30 name = "use-async-def.patch"; 31 url = "https://github.com/syrusakbary/promise/commit/3cde549d30b38dcff81b308e18c7f61783003791.patch"; 32 hash = "sha256-XCbTo6RCv75nNrpbK3TFdV0h7tBJ0QK+WOAR8S8w9as="; 33 }) 34 ]; 35 36 postPatch = '' 37 substituteInPlace tests/test_extra.py \ 38 --replace "assert_exc.traceback[-1].path.strpath" "str(assert_exc.traceback[-1].path)" 39 ''; 40 41 propagatedBuildInputs = [ six ]; 42 43 nativeCheckInputs = [ 44 mock 45 pytest-asyncio 46 pytestCheckHook 47 ]; 48 49 disabledTestPaths = [ "tests/test_benchmark.py" ]; 50 51 pythonImportsCheck = [ "promise" ]; 52 53 meta = with lib; { 54 description = "Ultra-performant Promise implementation in Python"; 55 homepage = "https://github.com/syrusakbary/promise"; 56 changelog = "https://github.com/syrusakbary/promise/releases/tag/v${version}"; 57 license = licenses.mit; 58 maintainers = with maintainers; [ kamadorueda ]; 59 }; 60}