1{ lib, fetchPypi, fetchpatch, buildPythonPackage,
2 setuptools_scm, toml, six, astroid, pytest
3}:
4
5buildPythonPackage rec {
6 pname = "asttokens";
7 version = "2.0.4";
8
9 src = fetchPypi {
10 inherit pname version;
11 sha256 = "0a2ixiz04aw4p0aivxh47k3fa9ql804l3y5iv5gcih9aizi5fbm4";
12 };
13
14 patches = [
15 # Fixes compatibility with python 3.9, will be included in the next release
16 # after 2.0.4
17 (fetchpatch {
18 url = "https://github.com/gristlabs/asttokens/commit/d8ff80ee7d2e64c5e1daf50cc38eb99663f1b1ac.patch";
19 sha256 = "19y8n8vpzr2ijldbq5rh19sf0vz5azqqpkb9bx0ljjg98h6k7kjj";
20 excludes = [ "setup.cfg" ];
21 })
22 ];
23
24 propagatedBuildInputs = [ setuptools_scm toml six astroid ];
25
26 checkInputs = [ pytest ];
27
28 meta = with lib; {
29 homepage = "https://github.com/gristlabs/asttokens";
30 description = "Annotate Python AST trees with source text and token information";
31 license = licenses.asl20;
32 platforms = platforms.all;
33 maintainers = with maintainers; [ leenaars ];
34 };
35}