Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various pyflakes issues #1499

Closed
juliantaylor opened this issue Mar 15, 2012 · 2 comments · Fixed by #1502
Closed

various pyflakes issues #1499

juliantaylor opened this issue Mar 15, 2012 · 2 comments · Fixed by #1502
Milestone

Comments

@juliantaylor
Copy link
Contributor

I tried out a new debian package qc tool which runs pyflakes, and it reported many issues.
I filtered out a bunch of false positives, I think the remaining should be fixed, even though not all are real errors:

Ran on today's daily build (~3912ea7cf62)

w: ipython: pyflakes-redefined-function IPython/config/loader.py:654: _convert_to_config line 621
e: ipython: pyflakes-undefined-name IPython/core/debugger.py:107: get_ipython
e: ipython: pyflakes-undefined-name IPython/core/magic.py:942: Numeric
e: ipython: pyflakes-undefined-name IPython/core/magic.py:2324: parameter_s
e: ipython: pyflakes-undefined-name IPython/frontend/terminal/interactiveshell.py:113: UsageError
e: ipython: pyflakes-undefined-name IPython/frontend/terminal/interactiveshell.py:115: UsageError
e: ipython: pyflakes-undefined-name IPython/lib/backgroundjobs.py:394: get_ipython
e: ipython: pyflakes-undefined-name IPython/lib/demo.py:246: get_ipython
e: ipython: pyflakes-undefined-name IPython/parallel/client/view.py:781: get_ipython
e: ipython: pyflakes-undefined-name IPython/parallel/controller/scheduler.py:515: blacklist
e: ipython: pyflakes-undefined-name IPython/parallel/engine/kernelstarter.py:83: LOCAL_IPS
e: ipython: pyflakes-undefined-name IPython/parallel/engine/kernelstarter.py:96: Process
e: ipython: pyflakes-undefined-name IPython/parallel/engine/kernelstarter.py:96: make_kernel
e: ipython: pyflakes-undefined-name IPython/parallel/engine/kernelstarter.py:104: sys
e: ipython: pyflakes-undefined-name IPython/parallel/engine/kernelstarter.py:114: time
e: ipython: pyflakes-undefined-name IPython/parallel/engine/kernelstarter.py:150: sys
e: ipython: pyflakes-undefined-name IPython/parallel/engine/kernelstarter.py:151: time
e: ipython: pyflakes-undefined-name IPython/parallel/engine/kernelstarter.py:173: sys
e: ipython: pyflakes-undefined-name IPython/parallel/engine/kernelstarter.py:184: sys
e: ipython: pyflakes-undefined-name IPython/parallel/engine/kernelstarter.py:188: signal
e: ipython: pyflakes-undefined-name IPython/parallel/engine/kernelstarter.py:220: zmq
e: ipython: pyflakes-undefined-name IPython/parallel/engine/kernelstarter.py:222: zmqstream
e: ipython: pyflakes-undefined-name IPython/parallel/engine/kernelstarter.py:222: zmq
e: ipython: pyflakes-undefined-name IPython/parallel/engine/kernelstarter.py:224: zmqstream
e: ipython: pyflakes-undefined-name IPython/parallel/engine/kernelstarter.py:224: zmq
e: ipython: pyflakes-undefined-name IPython/testing/plugin/ipdoctest.py:275: _ip
e: ipython: pyflakes-undefined-name IPython/testing/plugin/ipdoctest.py:276: _ip
e: ipython: pyflakes-undefined-name IPython/testing/plugin/ipdoctest.py:277: _ip
e: ipython: pyflakes-undefined-name IPython/testing/plugin/ipdoctest.py:281: _ip
e: ipython: pyflakes-undefined-name IPython/testing/plugin/ipdoctest.py:291: _ip
e: ipython: pyflakes-undefined-name IPython/testing/plugin/ipdoctest.py:292: _ip
e: ipython: pyflakes-undefined-name IPython/testing/plugin/ipdoctest.py:295: _ip
e: ipython: pyflakes-undefined-name IPython/testing/plugin/ipdoctest.py:393: _ip
e: ipython: pyflakes-undefined-name IPython/testing/plugin/ipdoctest.py:588: _ip
e: ipython: pyflakes-undefined-name IPython/testing/tools.py:211: get_ipython
e: ipython: pyflakes-undefined-name IPython/utils/pickleshare.py:194: keys
e: ipython: pyflakes-undefined-name IPython/utils/pickleshare.py:197: keys
e: ipython: pyflakes-undefined-name IPython/zmq/completer.py:62: Message
e: ipython: pyflakes-undefined-name IPython/zmq/frontend.py:98: Message
e: ipython: pyflakes-undefined-name IPython/zmq/frontend.py:118: Message
e: ipython: pyflakes-undefined-name IPython/zmq/pylab/backend_inline.py:159: get_ipython
e: ipython: pyflakes-undefined-name IPython/zmq/pylab/backend_inline.py:163: get_ipython
e: ipython: pyflakes-undefined-name IPython/zmq/pylab/backend_inline.py:174: get_ipython
e: ipython: pyflakes-undefined-name IPython/zmq/pylab/backend_inline.py:178: get_ipython

For the vim users I highly recommend vim's pyflakes plugin, it really helps a lot and is very fast.

@minrk
Copy link
Member

minrk commented Mar 15, 2012

The get_ipython and _ip reports are all almost certainly incorrect, because these are names we inject into builtins. The kernelstarter file is an incomplete implementation of the nanny process watching engines and isn't yet used (and probably shouldn't be in the repo). The same goes for zmq.frontend and zmq.completer.ClientCompleter, which is really example code more than anything, and not used anywhere. I'll check out the others.

@minrk
Copy link
Member

minrk commented Mar 15, 2012

By the way, here's a bash function that runs pyflakes on a dir, excluding all of the unhelpful/uninteresting stuff (including various names we inject into the namespace):

flakes(){
    pyflakes $1 | grep -v "never used" | grep -v "undefined name 'get_ipython'" | grep -v "undefined name '_ip'" | grep -v "undefined name '__IPYTHON__'" | grep -v "undefined name 'get_config'" | grep -v "undefined name 'load_subconfig'" | grep -v "but unused" | grep -v ": redefinition" | grep -v "^IPython/quarantine" | grep -v "^IPython/deathrow" | grep -v "unable to detect undefined names"
}

See PR #1502 for what should be a fix of all the real issues revealed here.

@fperez fperez closed this as completed in d13bbaf Apr 14, 2012
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
small changes in response to pyflakes pass

Only significant change: removes incomplete kernelstarter file, which shouldn't have been in the repo at all.

closes ipython#1499
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants