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.1.0";
23 format = "pyproject";
24
25 disabled = pythonOlder "3.7";
26
27 src = fetchFromGitHub {
28 owner = "alexmojaki";
29 repo = pname;
30 rev = "v${version}";
31 hash = "sha256-epgKMPOvPdkpRp0n5A22gZ5DeXLyI60bqzLTx5JFlLk=";
32 };
33
34 patches = [
35 (fetchpatch {
36 name = "python-3.12.6.patch";
37 url = "https://github.com/alexmojaki/executing/commit/3f11fdcd7a017fbdca8a3a9de23dab18d3ba2100.patch";
38 hash = "sha256-ZnTO9lT+bj4nekPx4D0DxjhJOCkZn6lDm5xdLrziB+4=";
39 })
40 ];
41
42 nativeBuildInputs = [
43 setuptools
44 setuptools-scm
45 ];
46
47 nativeCheckInputs = [
48 asttokens
49 littleutils
50 pytestCheckHook
51 ] ++ lib.optionals (pythonAtLeast "3.11") [ rich ];
52
53 disabledTests = [
54 # requires ipython, which causes a circular dependency
55 "test_two_statement_lookups"
56
57 # Asserts against time passed using time.time() to estimate
58 # if the test runs fast enough. That makes the test flaky when
59 # running on slow systems or cross- / emulated building
60 "test_many_source_for_filename_calls"
61 ];
62
63 pythonImportsCheck = [ "executing" ];
64
65 meta = with lib; {
66 description = "Get information about what a frame is currently doing, particularly the AST node being executed";
67 homepage = "https://github.com/alexmojaki/executing";
68 license = licenses.mit;
69 maintainers = with maintainers; [ renatoGarcia ];
70 };
71}