1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 pythonAtLeast, 6 pythonOlder, 7 8 # build-system 9 setuptools, 10 setuptools-scm, 11 12 # tests 13 asttokens, 14 littleutils, 15 rich, 16 pytestCheckHook, 17}: 18 19buildPythonPackage rec { 20 pname = "executing"; 21 version = "2.2.0"; 22 pyproject = true; 23 24 disabled = pythonOlder "3.7"; 25 26 src = fetchFromGitHub { 27 owner = "alexmojaki"; 28 repo = pname; 29 rev = "v${version}"; 30 hash = "sha256-2BT4VTZBAJx8Gk4qTTyhSoBMjJvKzmL4PO8IfTpN+2g="; 31 }; 32 33 build-system = [ 34 setuptools 35 setuptools-scm 36 ]; 37 38 nativeCheckInputs = [ 39 asttokens 40 littleutils 41 pytestCheckHook 42 ] ++ lib.optionals (pythonAtLeast "3.11") [ rich ]; 43 44 disabledTests = [ 45 # requires ipython, which causes a circular dependency 46 "test_two_statement_lookups" 47 48 # Asserts against time passed using time.time() to estimate 49 # if the test runs fast enough. That makes the test flaky when 50 # running on slow systems or cross- / emulated building 51 "test_many_source_for_filename_calls" 52 53 # https://github.com/alexmojaki/executing/issues/91 54 "test_exception_catching" 55 ]; 56 57 pythonImportsCheck = [ "executing" ]; 58 59 meta = with lib; { 60 description = "Get information about what a frame is currently doing, particularly the AST node being executed"; 61 homepage = "https://github.com/alexmojaki/executing"; 62 license = licenses.mit; 63 maintainers = with maintainers; [ renatoGarcia ]; 64 }; 65}