MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / get_call_kwargs

Function get_call_kwargs

src/packagedcode/pypi_setup_py.py:163–181  ·  view source on GitHub ↗

Return a mapping of setup() method call keyword arguments.

(node: ast.Call, body)

Source from the content-addressed store, hash-verified

161
162
163def get_call_kwargs(node: ast.Call, body):
164 """
165 Return a mapping of setup() method call keyword arguments.
166 """
167 result = {}
168 keywords = getattr(node, 'keywords', []) or []
169 for keyword in keywords:
170 # dict unpacking
171 if keyword.arg is None:
172 value = node_to_value(keyword.value, body)
173 if isinstance(value, dict):
174 result.update(value)
175 continue
176 # keyword argument
177 value = node_to_value(keyword.value, body)
178 if value is None:
179 continue
180 result[keyword.arg] = value
181 return result
182
183
184def clean_setup(data):

Callers 2

parse_setup_pyFunction · 0.85
node_to_valueFunction · 0.85

Calls 2

node_to_valueFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected