8000 Formatting bug with snakefood 1.4 · Issue #1 · blais/snakefood · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Formatting bug with snakefood 1.4 #1
Open
@blais

Description

@blais

Original report by Martin Blais (Bitbucket: blais, GitHub: blais).


Gaikokujin Kun gaikokujinkun@gmail.com

Bonjour Martin,

while I was playing with snakefood 1.4, I hit an error:

$ sfood WebAPI -e | sfood-graph -p | dot -Tsvg > ~/Desktop/script.external.svg
[...]
WARNING : Line 17: Could not import module 'flask'
WARNING : Line 19: Could not import module 'sqlalchemy.ext.declarative'
Traceback (most recent call last):
File "/usr/bin/sfood", line 6, in
main()
File "/usr/lib64/python2.7/site-packages/snakefood/gendeps.py", line
235, in main
gendeps()
File "/usr/lib64/python2.7/site-packages/snakefood/gendeps.py", line
142, in gendeps
fn, opts.verbose, opts.do_pragmas, opts.ignore_unused)
File "/usr/lib64/python2.7/site-packages/snakefood/find.py", line
33, in find_dependencies
ast, _ = parse_python_source(fn)
File "/usr/lib64/python2.7/site-packages/snakefood/find.py", line
240, in parse_python_source
err = '%s:%d: %s' % (fn, e.lineno, e.msg)
TypeError: %d format: a number is required, not NoneType

By applying one of the following patch, I was able to continue:
[...]
WARNING : Line 19: Could not import module 'sqlalchemy.ext.declarative'
ERROR : Error processing file src/WebAPI/v0.py':
WebAPI/v0.py:-1: generator expression needs parenthesis
WARNING : Line 4: Could not import module 'flask.ext.cache'
[...]

Weird because v0.py is executing correctly and pyflakes does not
report any error.
Well, the patch can definitively be improved, but for now it does not
break in the way.

If Node.lineno is not expected to start at 0, the non-zero.patch
should be good (unsure while reading the compiler documentation).

Regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingminor

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0