question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Unparsable" NotImplemementedError when getting values from variables

See original GitHub issue

If setup.py gets setup() values from variables, the script blows up with a NotImplementedError:

Traceback (most recent call last):
  File "site-packages/setup_py_upgrade.py", line 125, in visit_Call
    value = ast.literal_eval(kwd.value)
  File "ast.py", line 85, in literal_eval
    return _convert(node_or_string)
  File "ast.py", line 84, in _convert
    raise ValueError('malformed node or string: ' + repr(node))
ValueError: malformed node or string: <_ast.Name object at 0x7fdf99964e10>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "setup-py-upgrade", line 8, in <module>
    sys.exit(main())
  File "site-packages/setup_py_upgrade.py", line 167, in main
    visitor.visit(tree)
  File "ast.py", line 253, in visit
    return visitor(node)
  File "ast.py", line 261, in generic_visit
    self.visit(item)
  File "ast.py", line 253, in visit
    return visitor(node)
  File "ast.py", line 263, in generic_visit
    self.visit(value)
  File "ast.py", line 253, in visit
    return visitor(node)
  File "setup_py_upgrade.py", line 127, in visit_Call
    raise NotImplementedError(f'unparsable: {kwd.arg}=')
NotImplementedError: unparsable: version=

This probably isn’t fully fixable as the variable could be a constant, or it might come from a separate python file, or even from reading some data from an external file.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
asottilecommented, Jan 13, 2021

note that in the general case you’re asking setup-py-upgrade to solve the halting problem, which is intractable

1reaction
asottilecommented, Jan 13, 2021

there’s no reason to write a setup py like that, inline it and it’ll get converted – see above

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to define lazy variable in Python which will raise ...
With this code, accessing self.variable raises the exception with a very informative message: NotImplementedError: <__main__.
Read more >
Not Implemented Error when trying to set initial variable values
I am doing an optimization problem in which the output is based on all the variables, but where PuLP only modifies/sets some of...
Read more >
Unparsable date using Tmap - Talend Community
Hello guys,. How you are ? I'm facing a issue when i trying to parse a String column to Date. The error name...
Read more >
ODI 11.1.1 - Problem setting Date Variable — oracle-tech
i have a problem setting a date-variable in my package. i'm getting error ODI-1237 when using the dateformat stated in the help-documentation.
Read more >
set new constraint but got NotImplementedError
variable to 1, I said that because I've read the data, the model should be fine if it just build more launch station,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found