summarylogtreecommitdiffstats
path: root/get-extras.py
blob: 3d0ea8c7714dd32c3f0815cf331b666270bcb7d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/python

from ast import Call, Name, parse, walk

with open("setup.py") as f:
    setup = f.read()
    tree = parse(setup)
    for parent in walk(tree):
        if isinstance(parent, Call) and isinstance(parent.func, Name) and parent.func.id == "setup":
            for child in parent.keywords:
                if child.arg == "extras_require":
                    print(",".join(key.value for key in child.value.keys))