You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the setup.py AST parser will look for matches by name when matching assignments in setup.py. If a name has been assigned multiple times, however, the first assignment is chosen instead of the most recent assignment, which can cause major problems for the parser which will be working with an incomplete / unparsed object.
For example, when unparsing the following ast.BinOp instance:
the first assignment of matches is chosen, causing the following exception:
File "<stdin>", line 1, in <module> File "/home/techalchemy/git/requirementslib/src/requirementslib/models/setup_info.py", line 1201, in ast_parse_setup_py ast_analyzer.unmap_binops() File "/home/techalchemy/git/requirementslib/src/requirementslib/models/setup_info.py", line 729, in unmap_binops self.binOps_map[binop] = ast_unparse(binop, analyzer=self) File "/home/techalchemy/git/requirementslib/src/requirementslib/models/setup_info.py", line 1017, in ast_unparse left_item = unparse(item.left) File "/home/techalchemy/git/requirementslib/src/requirementslib/models/setup_info.py", line 1040, in ast_unparse items = unparse(analyzer.assignments[assignment]) File "/home/techalchemy/git/requirementslib/src/requirementslib/models/setup_info.py", line 1140, in ast_unparse val = unparse(item.value, recurse=False) File "/home/techalchemy/git/requirementslib/src/requirementslib/models/setup_info.py", line 1000, in ast_unparse unparsed = unparse(item.value) File "/home/techalchemy/git/requirementslib/src/requirementslib/models/setup_info.py", line 1000, in ast_unparse unparsed = unparse(item.value) File "/home/techalchemy/git/requirementslib/src/requirementslib/models/setup_info.py", line 1004, in ast_unparse unparsed = unparsed[unparse(item.slice.value)]TypeError: string indices must be integersstring indices must be integers
The text was updated successfully, but these errors were encountered:
Currently, the
setup.py
AST parser will look for matches by name when matching assignments insetup.py
. If a name has been assigned multiple times, however, the first assignment is chosen instead of the most recent assignment, which can cause major problems for the parser which will be working with an incomplete / unparsed object.For example, when unparsing the following
ast.BinOp
instance:the first assignment of
matches
is chosen, causing the following exception:The text was updated successfully, but these errors were encountered: