Return a mapping of setuptools.setup() call argument found in a setup.py file at ``location`` or an empty mapping.
(location)
| 70 | |
| 71 | |
| 72 | def parse_setup_py(location): |
| 73 | """ |
| 74 | Return a mapping of setuptools.setup() call argument found in a setup.py |
| 75 | file at ``location`` or an empty mapping. |
| 76 | """ |
| 77 | path = Path(location) |
| 78 | tree = tuple(ast.parse(path.read_text(encoding='utf8')).body) |
| 79 | body = tuple(get_body(tree)) |
| 80 | |
| 81 | call = get_setup_call(tree) |
| 82 | result = get_call_kwargs(call, body) |
| 83 | |
| 84 | return clean_setup(result) |
| 85 | |
| 86 | |
| 87 | def get_body(elements): |
no test coverage detected