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 = "executing";
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 ]
43 ++ lib.optionals (pythonAtLeast "3.11") [ rich ];
44
45 disabledTests = [
46 # requires ipython, which causes a circular dependency
47 "test_two_statement_lookups"
48
49 # Asserts against time passed using time.time() to estimate
50 # if the test runs fast enough. That makes the test flaky when
51 # running on slow systems or cross- / emulated building
52 "test_many_source_for_filename_calls"
53
54 # https://github.com/alexmojaki/executing/issues/91
55 "test_exception_catching"
56 ];
57
58 pythonImportsCheck = [ "executing" ];
59
60 meta = with lib; {
61 description = "Get information about what a frame is currently doing, particularly the AST node being executed";
62 homepage = "https://github.com/alexmojaki/executing";
63 license = licenses.mit;
64 maintainers = with maintainers; [ renatoGarcia ];
65 };
66}