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