Giter VIP home page Giter VIP logo

elpy's Introduction

image

Documentation Status

image

image

image

Elpy, the Emacs Python IDE

Elpy is an Emacs package to bring powerful Python editing to Emacs. It combines and configures a number of other packages, both written in Emacs Lisp as well as Python. Elpy is fully documented at Readthedocs.

IMPORTANT NOTE: Looking for a maintainer

I find myself (@galaunay, current maintainer), unable to maintain Elpy at the moment, and probably for a while. If you are interested in getting involved in Elpy, please contact me by mail, the project definitely needs you !

In the meantime, I will keep an eye on the PRs to integrate any fix and/or new features proposed, but I will definitely not be able to treat the issues in a satisfying manner. If you are stuck with an issue, please have a look at the documentation, there is a lot of answers there. @gfederix also made some bug fixing in his fork, so you can try using this version of Elpy.

Features

Installation

Elpy is available on Melpa, the most straightforward way to install it is to use `use-package`:

(use-package elpy
  :ensure t
  :init
  (elpy-enable))

For other installation alternatives, see the documentation section Installation.

Quickstart

Once installed, Elpy will automatically provide code completion, syntax error highlighting and code hinting (in the modeline) for python files. Elpy offers a lot of features, but the following keybindings should be enough to get started:

  • C-c C-c evaluates the current python script (or region if something is selected) in an interactive python shell. The python shell is automatically displayed aside of your script.
  • C-RET evaluates the current statement (current line plus the following nested lines).
  • C-c C-z switches between your script and the interactive shell.
  • C-c C-d displays documentation for the thing under cursor. The documentation will pop in a different buffer, that can be closed with q.

Please have a look at the documentation at Readthedocs if you want to know more about what Elpy can do.

External resources

Contact

For questions regarding Elpy, do not hesitate to open an issue on github or visit us on IRC, channel #emacs-elpy on irc.freenode.net.

elpy's People

Contributors

abangfarhan avatar backwardspy avatar berhoel avatar birkenfeld avatar chillaranand avatar coroa avatar cpitclaudel avatar drgillis avatar fleimgruber avatar gaetano-guerriero avatar galaunay avatar georgek avatar gmlarumbe avatar gopar avatar gpapadok avatar jorgenschaefer avatar offby1 avatar ptrv avatar rgemulla avatar sam-s avatar steinitzu avatar sten0 avatar stepnem avatar stsquad avatar sww avatar teoric avatar thomasbucaioni avatar timgates42 avatar tommyx12 avatar xuhdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elpy's Issues

Automate installation of python packages

On an import error, instead of displaying installation instructions, offer to install things instead.

Options: abort, install, try again (so users can install themselves).

pyde-doc-rope does not find symbols correctly

If there is no documentation available at point, pyde-doc-rope should go to the beginning of the statement and try again, because the following does not work:

datetime.datetime.strptime(_|_

Better Python backend

RopeMacs, Pymacs, etc. is quite heavy, especially as I (personally) mainly use it to get possible completions. We could see if we can rewrite that part.

  • Define an RPC protocol between Python and Emacs we can use. Probably JSON-based.
  • Use available completion helpers (from rope, jedi, rlcompleter, own stuff?)

How to use Rope as a library:

http://rope.sourceforge.net/library.html

Especially the codehelper part is relevant.

TAB completion bound to yas/expand rather than ac-trigger-key

Installing elpy 0.8 and yasnippet 0.8.0 from marmalade, the TAB key is bound to yas/expand rather than ac-trigger-key. Furthermore, C-c C-i is bound to python-find-imports rather than yasnippet-expand.

I am using GNU Emacs 24.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.10) of 2012-11-08 on lakoocha, modified by Debian.

'pip install elpy' fails

I am trying to install elpy. Following the documentation, I started with pip install elpy

$ pip install elpy
Downloading/unpacking elpy
  Could not find any downloads that satisfy the requirement elpy
No distributions at all found for elpy
Storing complete log in /Users/xiao/.pip/pip.log

The log is gisted https://gist.github.com/4699824

Any ideas?

Refactoring option: Add imports

The refactoring option should walk through the current file and find undefined symbols, trying to see if they can be imported from known modules. Such symbols should be added as import statements.

Rope refactoring support

Elpy should provide an interface to the Rope refactoring interface.

Ideally, the Jedi backend would default to Rope for things it can't handle itself.

Better python-check support

Pyde should be smart about finding an appropriate check command, and also tell the user if none is found.

flymake throws errors for symlinked paths

When using heavily symlinked paths for a project, flymake can throw an error because the relative path generated does not work due to symlinks.

elpy-flymake-python-init probably can do without relative paths?

Provide "import" completion for rope

"import " and "from " should provide completions for Python modules and packages. The module list can be easily supplied using pkgutil.iter_modules.

This only really affects rope.

Autocompletion problem

I think there's a problem with the autocompletion feature. For example, after an 'import os' and typing 'os.' I get a popup with invalid values (e.g. nt, ce, os2, sep, ...). These items also don't have any help attached.

I can reproduce this on OS X and Ubuntu.

Define default virtual environment?

Hi,

is there any way to define a default virtual environment so I can use a custom installation without either meddling with the system paths or calling virtualenv-workon every time I fire up elpy?

best regards,
Sebastian

Performance issues

There's a very noticeable (order of magnitude a second, I'd guess) delay when typing.

I've tried the following things:

  • disabling python-check.sh
  • disabling flymake entirely
  • removing (elpy-use-ipython)
  • increasing ac delays ((setq ac-auto-show-menu 1.0) (setq ac-quick-help-delay 1.2) and also the same thing with 2.0 and 2.2 as delays)
  • moving the ropeproject to be inside my package instead of the repository toplevel directory (just in case it was accidentally trying to index the whole virtualenv)

... but so far nothing helps :(

Here's a video showing the issue writing a simple example class (a WTForms validator); my keyboard typing on the audio track so you can see the sync issue:

https://dl.dropbox.com/u/38476311/elpyperformanceissue.mov

(It's AAC/H.264; please let me know if you have issues viewing it and I'll convert it to something else.)

I'm running a fully updated current-generation Macbook Air with OS X 10.8 and Emacs for OS X. Any help is very appreciated :)

iedit integration

Elpy should depend on iedit, which is an awesome package.

We might hook this up to jedi.Script.related_names at some point, too.

Release 1.0

Remember the blog post and the champagne.

Completion sometimes causes an error

I'm not quite sure where this comes from. It looks like a bug in popup.el, but I'm not sure.

Debugger entered--Lisp error: (args-out-of-range 1 37)
  count-lines(37 1)
  popup-create(nil 0 20 :min-height 10 :around nil :margin-left nil :margin-right nil :scroll-bar nil :face popup-tip-face :parent [cl-struct-popup 36 3 22 20 10 nil 1 [#<overlay from 37 to 37 in foo.py> #<overlay from 57 to 57 in foo.py> #<overlay from 80 to 87 in foo.py> #<overlay from 106 to 106 in foo.py> #<overlay from 125 to 125 in foo.py> #<overlay from 148 to 148 in foo.py> #<overlay from 149 to 149 in foo.py> #<overlay from 172 to 176 in foo.py> #<overlay from 194 to 194 in foo.py> #<overlay from 212 to 212 in foo.py>] (keymap (mouse-5 . ac-mouse-5) (mouse-4 . ac-mouse-4) (down-mouse-1 . ac-ignore) (mouse-1 . ac-mouse-1) (16 . ac-previous) (14 . ac-next) keymap (C-up . ac-quick-help-scroll-up) (C-down . ac-quick-help-scroll-down) (67108927 . ac-help) (M-f1 . ac-persist-help) (f1 . ac-help) (up . ac-previous) (down . ac-next) (19 . ac-isearch) (27 keymap (57 . ac-complete-9) (56 . ac-complete-8) (55 . ac-complete-7) (54 . ac-complete-6) (53 . ac-complete-5) (52 . ac-complete-4) (51 . ac-complete-3) (50 . ac-complete-2) (49 . ac-complete-1) (16 . ac-quick-help-scroll-up) (14 . ac-quick-help-scroll-down) (67108927 . ac-persist-help) (112 . ac-previous) (110 . ac-next) (9 . auto-complete)) (return . ac-complete) (13 . ac-complete) (tab . ac-expand) (9 . ac-expand)) nil 0 ac-candidate-face ac-candidate-mouse-face ac-selection-face 1 0 nil t t 0 0 0 10 (#("util" 0 4 (document elpy--ac-document symbol "p")) #("pool" 0 4 (document elpy--ac-document symbol "p")) #("heap" 0 4 (document elpy--ac-document symbol "p")) #("dummy" 0 5 (document elpy--ac-document symbol "p")) #("queues" 0 6 (document elpy--ac-document symbol "p")) #("process" 0 7 (document elpy--ac-document symbol "p")) #("forking" 0 7 (document elpy--ac-document symbol "p")) #("managers" 0 8 (document elpy--ac-document symbol "p")) #("reduction" 0 9 (document elpy--ac-document symbol "p")) #("connection" 0 10 (document elpy--ac-document symbol "p")) #("synchronize" 0 11 (document elpy--ac-document symbol "p")) #("sharedctypes" 0 12 (document elpy--ac-document symbol "p"))) 0 nil (#("util" 0 4 (document elpy--ac-document symbol "p")) #("pool" 0 4 (document elpy--ac-document symbol "p")) #("heap" 0 4 (document elpy--ac-document symbol "p")) #("dummy" 0 5 (document elpy--ac-document symbol "p")) #("queues" 0 6 (document elpy--ac-document symbol "p")) #("process" 0 7 (document elpy--ac-document symbol "p")) #("forking" 0 7 (document elpy--ac-document symbol "p")) #("managers" 0 8 (document elpy--ac-document symbol "p")) #("reduction" 0 9 (document elpy--ac-document symbol "p")) #("connection" 0 10 (document elpy--ac-document symbol "p")) #("synchronize" 0 11 (document elpy--ac-document symbol "p")) #("sharedctypes" 0 12 (document elpy--ac-document symbol "p")))] :parent-offset 0)
  popup-tip("" :point nil :height 20 :min-height 10 :around nil :parent [cl-struct-popup 36 3 22 20 10 nil 1 [#<overlay from 37 to 37 in foo.py> #<overlay from 57 to 57 in foo.py> #<overlay from 80 to 87 in foo.py> #<overlay from 106 to 106 in foo.py> #<overlay from 125 to 125 in foo.py> #<overlay from 148 to 148 in foo.py> #<overlay from 149 to 149 in foo.py> #<overlay from 172 to 176 in foo.py> #<overlay from 194 to 194 in foo.py> #<overlay from 212 to 212 in foo.py>] (keymap (mouse-5 . ac-mouse-5) (mouse-4 . ac-mouse-4) (down-mouse-1 . ac-ignore) (mouse-1 . ac-mouse-1) (16 . ac-previous) (14 . ac-next) keymap (C-up . ac-quick-help-scroll-up) (C-down . ac-quick-help-scroll-down) (67108927 . ac-help) (M-f1 . ac-persist-help) (f1 . ac-help) (up . ac-previous) (down . ac-next) (19 . ac-isearch) (27 keymap (57 . ac-complete-9) (56 . ac-complete-8) (55 . ac-complete-7) (54 . ac-complete-6) (53 . ac-complete-5) (52 . ac-complete-4) (51 . ac-complete-3) (50 . ac-complete-2) (49 . ac-complete-1) (16 . ac-quick-help-scroll-up) (14 . ac-quick-help-scroll-down) (67108927 . ac-persist-help) (112 . ac-previous) (110 . ac-next) (9 . auto-complete)) (return . ac-complete) (13 . ac-complete) (tab . ac-expand) (9 . ac-expand)) nil 0 ac-candidate-face ac-candidate-mouse-face ac-selection-face 1 0 nil t t 0 0 0 10 (#("util" 0 4 (document elpy--ac-document symbol "p")) #("pool" 0 4 (document elpy--ac-document symbol "p")) #("heap" 0 4 (document elpy--ac-document symbol "p")) #("dummy" 0 5 (document elpy--ac-document symbol "p")) #("queues" 0 6 (document elpy--ac-document symbol "p")) #("process" 0 7 (document elpy--ac-document symbol "p")) #("forking" 0 7 (document elpy--ac-document symbol "p")) #("managers" 0 8 (document elpy--ac-document symbol "p")) #("reduction" 0 9 (document elpy--ac-document symbol "p")) #("connection" 0 10 (document elpy--ac-document symbol "p")) #("synchronize" 0 11 (document elpy--ac-document symbol "p")) #("sharedctypes" 0 12 (document elpy--ac-document symbol "p"))) 0 nil (#("util" 0 4 (document elpy--ac-document symbol "p")) #("pool" 0 4 (document elpy--ac-document symbol "p")) #("heap" 0 4 (document elpy--ac-document symbol "p")) #("dummy" 0 5 (document elpy--ac-document symbol "p")) #("queues" 0 6 (document elpy--ac-document symbol "p")) #("process" 0 7 (document elpy--ac-document symbol "p")) #("forking" 0 7 (document elpy--ac-document symbol "p")) #("managers" 0 8 (document elpy--ac-document symbol "p")) #("reduction" 0 9 (document elpy--ac-document symbol "p")) #("connection" 0 10 (document elpy--ac-document symbol "p")) #("synchronize" 0 11 (document elpy--ac-document symbol "p")) #("sharedctypes" 0 12 (document elpy--ac-document symbol "p")))] :parent-offset 0 :point 36 :height 20 :nowait t)
  apply(popup-tip "" :point nil :height 20 :min-height 10 :around nil :parent [cl-struct-popup 36 3 22 20 10 nil 1 [#<overlay from 37 to 37 in foo.py> #<overlay from 57 to 57 in foo.py> #<overlay from 80 to 87 in foo.py> #<overlay from 106 to 106 in foo.py> #<overlay from 125 to 125 in foo.py> #<overlay from 148 to 148 in foo.py> #<overlay from 149 to 149 in foo.py> #<overlay from 172 to 176 in foo.py> #<overlay from 194 to 194 in foo.py> #<overlay from 212 to 212 in foo.py>] (keymap (mouse-5 . ac-mouse-5) (mouse-4 . ac-mouse-4) (down-mouse-1 . ac-ignore) (mouse-1 . ac-mouse-1) (16 . ac-previous) (14 . ac-next) keymap (C-up . ac-quick-help-scroll-up) (C-down . ac-quick-help-scroll-down) (67108927 . ac-help) (M-f1 . ac-persist-help) (f1 . ac-help) (up . ac-previous) (down . ac-next) (19 . ac-isearch) (27 keymap (57 . ac-complete-9) (56 . ac-complete-8) (55 . ac-complete-7) (54 . ac-complete-6) (53 . ac-complete-5) (52 . ac-complete-4) (51 . ac-complete-3) (50 . ac-complete-2) (49 . ac-complete-1) (16 . ac-quick-help-scroll-up) (14 . ac-quick-help-scroll-down) (67108927 . ac-persist-help) (112 . ac-previous) (110 . ac-next) (9 . auto-complete)) (return . ac-complete) (13 . ac-complete) (tab . ac-expand) (9 . ac-expand)) nil 0 ac-candidate-face ac-candidate-mouse-face ac-selection-face 1 0 nil t t 0 0 0 10 (#("util" 0 4 (document elpy--ac-document symbol "p")) #("pool" 0 4 (document elpy--ac-document symbol "p")) #("heap" 0 4 (document elpy--ac-document symbol "p")) #("dummy" 0 5 (document elpy--ac-document symbol "p")) #("queues" 0 6 (document elpy--ac-document symbol "p")) #("process" 0 7 (document elpy--ac-document symbol "p")) #("forking" 0 7 (document elpy--ac-document symbol "p")) #("managers" 0 8 (document elpy--ac-document symbol "p")) #("reduction" 0 9 (document elpy--ac-document symbol "p")) #("connection" 0 10 (document elpy--ac-document symbol "p")) #("synchronize" 0 11 (document elpy--ac-document symbol "p")) #("sharedctypes" 0 12 (document elpy--ac-document symbol "p"))) 0 nil (#("util" 0 4 (document elpy--ac-document symbol "p")) #("pool" 0 4 (document elpy--ac-document symbol "p")) #("heap" 0 4 (document elpy--ac-document symbol "p")) #("dummy" 0 5 (document elpy--ac-document symbol "p")) #("queues" 0 6 (document elpy--ac-document symbol "p")) #("process" 0 7 (document elpy--ac-document symbol "p")) #("forking" 0 7 (document elpy--ac-document symbol "p")) #("managers" 0 8 (document elpy--ac-document symbol "p")) #("reduction" 0 9 (document elpy--ac-document symbol "p")) #("connection" 0 10 (document elpy--ac-document symbol "p")) #("synchronize" 0 11 (document elpy--ac-document symbol "p")) #("sharedctypes" 0 12 (document elpy--ac-document symbol "p")))] :parent-offset 0 (:point 36 :height 20 :nowait t))
  popup-menu-show-quick-help([cl-struct-popup 36 3 22 20 10 nil 1 [#<overlay from 37 to 37 in foo.py> #<overlay from 57 to 57 in foo.py> #<overlay from 80 to 87 in foo.py> #<overlay from 106 to 106 in foo.py> #<overlay from 125 to 125 in foo.py> #<overlay from 148 to 148 in foo.py> #<overlay from 149 to 149 in foo.py> #<overlay from 172 to 176 in foo.py> #<overlay from 194 to 194 in foo.py> #<overlay from 212 to 212 in foo.py>] (keymap (mouse-5 . ac-mouse-5) (mouse-4 . ac-mouse-4) (down-mouse-1 . ac-ignore) (mouse-1 . ac-mouse-1) (16 . ac-previous) (14 . ac-next) keymap (C-up . ac-quick-help-scroll-up) (C-down . ac-quick-help-scroll-down) (67108927 . ac-help) (M-f1 . ac-persist-help) (f1 . ac-help) (up . ac-previous) (down . ac-next) (19 . ac-isearch) (27 keymap (57 . ac-complete-9) (56 . ac-complete-8) (55 . ac-complete-7) (54 . ac-complete-6) (53 . ac-complete-5) (52 . ac-complete-4) (51 . ac-complete-3) (50 . ac-complete-2) (49 . ac-complete-1) (16 . ac-quick-help-scroll-up) (14 . ac-quick-help-scroll-down) (67108927 . ac-persist-help) (112 . ac-previous) (110 . ac-next) (9 . auto-complete)) (return . ac-complete) (13 . ac-complete) (tab . ac-expand) (9 . ac-expand)) nil 0 ac-candidate-face ac-candidate-mouse-face ac-selection-face 1 0 nil t t 0 0 0 10 (#("util" 0 4 (document elpy--ac-document symbol "p")) #("pool" 0 4 (document elpy--ac-document symbol "p")) #("heap" 0 4 (document elpy--ac-document symbol "p")) #("dummy" 0 5 (document elpy--ac-document symbol "p")) #("queues" 0 6 (document elpy--ac-document symbol "p")) #("process" 0 7 (document elpy--ac-document symbol "p")) #("forking" 0 7 (document elpy--ac-document symbol "p")) #("managers" 0 8 (document elpy--ac-document symbol "p")) #("reduction" 0 9 (document elpy--ac-document symbol "p")) #("connection" 0 10 (document elpy--ac-document symbol "p")) #("synchronize" 0 11 (document elpy--ac-document symbol "p")) #("sharedctypes" 0 12 (document elpy--ac-document symbol "p"))) 0 nil (#("util" 0 4 (document elpy--ac-document symbol "p")) #("pool" 0 4 (document elpy--ac-document symbol "p")) #("heap" 0 4 (document elpy--ac-document symbol "p")) #("dummy" 0 5 (document elpy--ac-document symbol "p")) #("queues" 0 6 (document elpy--ac-document symbol "p")) #("process" 0 7 (document elpy--ac-document symbol "p")) #("forking" 0 7 (document elpy--ac-document symbol "p")) #("managers" 0 8 (document elpy--ac-document symbol "p")) #("reduction" 0 9 (document elpy--ac-document symbol "p")) #("connection" 0 10 (document elpy--ac-document symbol "p")) #("synchronize" 0 11 (document elpy--ac-document symbol "p")) #("sharedctypes" 0 12 (document elpy--ac-document symbol "p")))] nil :point 36 :height 20 :nowait t)
  ac-quick-help()
  apply(ac-quick-help nil)
  byte-code("r\301�\302H�\303H\"\210)\301\207" [timer apply 5 6] 4)
  timer-event-handler([t 0 0 500000 0.5 ac-quick-help nil idle 0])
  accept-process-output()
  (while (not (progn (goto-char (point-min)) (re-search-forward "^\\(.*\\)\n" nil t))) (accept-process-output))
  (let ((inhibit-quit nil)) (while (not (progn (goto-char (point-min)) (re-search-forward "^\\(.*\\)\n" nil t))) (accept-process-output)))
  elpy-rpc--receive-line()
  (json-read-from-string (elpy-rpc--receive-line))
  (let ((json-array-type (quote list))) (json-read-from-string (elpy-rpc--receive-line)))
  elpy-rpc--receive-json()
  (let ((response (elpy-rpc--receive-json))) (cond ((not (= elpy-rpc-call-id (cdr (assq (quote id) response)))) (error "Protocol desynchronization, restart subprocess")) ((cdr (assq (quote error) response)) (error (cdr (assq (quote error) response)))) (t (cdr (assq (quote result) response)))))
  elpy-rpc-call("get_calltip" "/home/forcer/Projects/test/" "/home/forcer/Projects/test/foo.py" #("import bar\n\nimport multiprocessing.\n\nclass Test(object):\n    def __init__(self, a, b):\n        self.a = a\n        self.b = b\n        self.x = Foo()\n\n    def foo(self, argl=5):\n        a = 3 + 5\n        b = 3 + 5\n        return a + b\n\n    def bar(self, x, y):\n        c = 3 + 5\n        return x + y\n\n\ndef add(i, j):\n    return i + j\n\n\nclass Foo(object):\n    pass\n" 0 6 (fontified t face font-lock-keyword-face) 6 11 (fontified t) 11 12 (fontified t) 12 18 (fontified t face font-lock-keyword-face) 18 19 (fontified t) 19 35 (symbol "p" document elpy--ac-document fontified t) 35 36 (fontified t) 36 37 (fontified t) 37 42 (face font-lock-keyword-face) 43 47 (face font-lock-type-face) 48 54 (face font-lock-builtin-face) 57 58 (face highlight-indent-face) 61 64 (face font-lock-keyword-face) 65 73 (face font-lock-function-name-face) 74 78 (face font-lock-keyword-face) 87 88 (face highlight-indent-face) 91 92 (face highlight-indent-face) 95 99 (face font-lock-keyword-face) 106 107 (face highlight-indent-face) 110 111 (face highlight-indent-face) 114 118 (face font-lock-keyword-face) 125 126 (face highlight-indent-face) 129 130 (face highlight-indent-face) 133 137 (face font-lock-keyword-face) 149 150 (face highlight-indent-face) 153 156 (face font-lock-keyword-face) 157 160 (face font-lock-function-name-face) 161 165 (face font-lock-keyword-face) 176 177 (face highlight-indent-face) 180 181 (face highlight-indent-face) 184 185 (face font-lock-variable-name-face) 194 195 (face highlight-indent-face) 198 199 (face highlight-indent-face) 202 203 (face font-lock-variable-name-face) 212 213 (face highlight-indent-face) 216 217 (face highlight-indent-face) 220 226 (face font-lock-keyword-face) 234 235 (face highlight-indent-face) 238 241 (face font-lock-keyword-face) 242 245 (face font-lock-function-name-face) 246 250 (face font-lock-keyword-face) 259 260 (face highlight-indent-face) 263 264 (face highlight-indent-face) 267 268 (face font-lock-variable-name-face) 277 278 (face highlight-indent-face) 281 282 (face highlight-indent-face) 285 291 (face font-lock-keyword-face) 300 303 (face font-lock-keyword-face) 304 307 (face font-lock-function-name-face) 315 316 (face highlight-indent-face) 319 325 (face font-lock-keyword-face) 334 339 (face font-lock-keyword-face) 340 343 (face font-lock-type-face) 344 350 (face font-lock-builtin-face) 353 354 (face highlight-indent-face) 357 361 (face font-lock-keyword-face)) 35)
  apply(elpy-rpc-call "get_calltip" ("/home/forcer/Projects/test/" "/home/forcer/Projects/test/foo.py" #("import bar\n\nimport multiprocessing.\n\nclass Test(object):\n    def __init__(self, a, b):\n        self.a = a\n        self.b = b\n        self.x = Foo()\n\n    def foo(self, argl=5):\n        a = 3 + 5\n        b = 3 + 5\n        return a + b\n\n    def bar(self, x, y):\n        c = 3 + 5\n        return x + y\n\n\ndef add(i, j):\n    return i + j\n\n\nclass Foo(object):\n    pass\n" 0 6 (fontified t face font-lock-keyword-face) 6 11 (fontified t) 11 12 (fontified t) 12 18 (fontified t face font-lock-keyword-face) 18 19 (fontified t) 19 35 (symbol "p" document elpy--ac-document fontified t) 35 36 (fontified t) 36 37 (fontified t) 37 42 (face font-lock-keyword-face) 43 47 (face font-lock-type-face) 48 54 (face font-lock-builtin-face) 57 58 (face highlight-indent-face) 61 64 (face font-lock-keyword-face) 65 73 (face font-lock-function-name-face) 74 78 (face font-lock-keyword-face) 87 88 (face highlight-indent-face) 91 92 (face highlight-indent-face) 95 99 (face font-lock-keyword-face) 106 107 (face highlight-indent-face) 110 111 (face highlight-indent-face) 114 118 (face font-lock-keyword-face) 125 126 (face highlight-indent-face) 129 130 (face highlight-indent-face) 133 137 (face font-lock-keyword-face) 149 150 (face highlight-indent-face) 153 156 (face font-lock-keyword-face) 157 160 (face font-lock-function-name-face) 161 165 (face font-lock-keyword-face) 176 177 (face highlight-indent-face) 180 181 (face highlight-indent-face) 184 185 (face font-lock-variable-name-face) 194 195 (face highlight-indent-face) 198 199 (face highlight-indent-face) 202 203 (face font-lock-variable-name-face) 212 213 (face highlight-indent-face) 216 217 (face highlight-indent-face) 220 226 (face font-lock-keyword-face) 234 235 (face highlight-indent-face) 238 241 (face font-lock-keyword-face) 242 245 (face font-lock-function-name-face) 246 250 (face font-lock-keyword-face) 259 260 (face highlight-indent-face) 263 264 (face highlight-indent-face) 267 268 (face font-lock-variable-name-face) 277 278 (face highlight-indent-face) 281 282 (face highlight-indent-face) 285 291 (face font-lock-keyword-face) 300 303 (face font-lock-keyword-face) 304 307 (face font-lock-function-name-face) 315 316 (face highlight-indent-face) 319 325 (face font-lock-keyword-face) 334 339 (face font-lock-keyword-face) 340 343 (face font-lock-type-face) 344 350 (face font-lock-builtin-face) 353 354 (face highlight-indent-face) 357 361 (face font-lock-keyword-face)) 35))
  (save-current-buffer (set-buffer elpy-rpc-buffer) (apply (quote elpy-rpc-call) method-name params))
  elpy-rpc("get_calltip" "/home/forcer/Projects/test/" "/home/forcer/Projects/test/foo.py" #("import bar\n\nimport multiprocessing.\n\nclass Test(object):\n    def __init__(self, a, b):\n        self.a = a\n        self.b = b\n        self.x = Foo()\n\n    def foo(self, argl=5):\n        a = 3 + 5\n        b = 3 + 5\n        return a + b\n\n    def bar(self, x, y):\n        c = 3 + 5\n        return x + y\n\n\ndef add(i, j):\n    return i + j\n\n\nclass Foo(object):\n    pass\n" 0 6 (fontified t face font-lock-keyword-face) 6 11 (fontified t) 11 12 (fontified t) 12 18 (fontified t face font-lock-keyword-face) 18 19 (fontified t) 19 35 (symbol "p" document elpy--ac-document fontified t) 35 36 (fontified t) 36 37 (fontified t) 37 42 (face font-lock-keyword-face) 43 47 (face font-lock-type-face) 48 54 (face font-lock-builtin-face) 57 58 (face highlight-indent-face) 61 64 (face font-lock-keyword-face) 65 73 (face font-lock-function-name-face) 74 78 (face font-lock-keyword-face) 87 88 (face highlight-indent-face) 91 92 (face highlight-indent-face) 95 99 (face font-lock-keyword-face) 106 107 (face highlight-indent-face) 110 111 (face highlight-indent-face) 114 118 (face font-lock-keyword-face) 125 126 (face highlight-indent-face) 129 130 (face highlight-indent-face) 133 137 (face font-lock-keyword-face) 149 150 (face highlight-indent-face) 153 156 (face font-lock-keyword-face) 157 160 (face font-lock-function-name-face) 161 165 (face font-lock-keyword-face) 176 177 (face highlight-indent-face) 180 181 (face highlight-indent-face) 184 185 (face font-lock-variable-name-face) 194 195 (face highlight-indent-face) 198 199 (face highlight-indent-face) 202 203 (face font-lock-variable-name-face) 212 213 (face highlight-indent-face) 216 217 (face highlight-indent-face) 220 226 (face font-lock-keyword-face) 234 235 (face highlight-indent-face) 238 241 (face font-lock-keyword-face) 242 245 (face font-lock-function-name-face) 246 250 (face font-lock-keyword-face) 259 260 (face highlight-indent-face) 263 264 (face highlight-indent-face) 267 268 (face font-lock-variable-name-face) 277 278 (face highlight-indent-face) 281 282 (face highlight-indent-face) 285 291 (face font-lock-keyword-face) 300 303 (face font-lock-keyword-face) 304 307 (face font-lock-function-name-face) 315 316 (face highlight-indent-face) 319 325 (face font-lock-keyword-face) 334 339 (face font-lock-keyword-face) 340 343 (face font-lock-type-face) 344 350 (face font-lock-builtin-face) 353 354 (face highlight-indent-face) 357 361 (face font-lock-keyword-face)) 35)
  elpy-rpc-get-calltip()
  (let ((calltip (elpy-rpc-get-calltip))) (if calltip (progn (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert calltip) (goto-char ...) (while ... nil) (if ... ...) (if ... ...) (goto-char ...) (buffer-string)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))))
  elpy-eldoc-documentation()
  byte-code("\304 \205?��\203��\305� !\207\306 �\307 \211�\204��\310\202:�  \n@=\2030�\311\312\n\"\206:�\313    !\202:�\313   !\206:�\311\312\n\"�\305�!+\207" [eldoc-documentation-function current-symbol current-fnsym doc eldoc-display-message-p eldoc-message eldoc-current-symbol eldoc-fnsym-in-current-sexp nil apply eldoc-get-fnsym-args-string eldoc-get-var-docstring] 4)
  eldoc-print-current-symbol-info()
  apply(eldoc-print-current-symbol-info nil)
  byte-code("r\301�\302H�\303H\"\210)\301\207" [timer apply 5 6] 4)
  timer-event-handler([t 0 0 500000 t eldoc-print-current-symbol-info nil idle 0])

elpy

Just installed elpy, haven't run it yet.

Got an error starting emacs, claimed that highlight-indentation wasn't available.

I installed highlight-indentation from package-list-packages and restarted, which fixed the problem.

Thanks,
-dms

Asynchronous auto-complete

AC does call the candidate function for every character typed. We can improve interactive speed by doing an asynchronous call and only wait at most a very small amount of time for a response. If we cache the response appropriately, typing further characters would give more results.

It might even be possible to call auto-complete again on a callback if point hasn't moved...

Native backend should auto-import modules

The native backend's completion is very limited at the moment, as it does not import modules at all. Auto-importing modules has problems, though, as it can trigger code execution that's not intended.

namespace = dict(sys.modules["__main__"].__dict__)
namespace['multiprocessing'] = __import__("multiprocessing")
c = rlcompleter.Completer(namespace)

Rework keybindings

The current elpy keymap is very much "organically grown". Should be reworked completely.

Flymake support

Pyde should integrate with Flymake by default as with the other packages.

python-check-command not set by elpy to python-checker.sh; uses python.el default

C-h v python-check-command gives me:

python-check-command is a variable defined in `python.el'.
Its value is "pychecker --stdlib"

  This variable is potentially risky when used as a file local variable.

Documentation:
Command used to check a Python file.

I was expecting the python-check.sh, now shipped with elpy, and set by elpy.

Am I still supposed to set this variable in Git HEAD?

(Also, the Wiki still references python-check.sh with wget; should I remove it?)

Use flymake-style temp files for large buffers

When we're completing a large buffer, transferring the full buffer contents via JSON is very slow. Instead, we could pass the contents as a temporary file much like flymake if the buffer size exceeds a certain value.

Should do some tests to see if this is slower or faster for small buffers, too.

(wrong-type-argument stringp nil) in latest git head

Since updating to latest git head, I get the following error on startup (well, this is the backtrace I get when I pass --debug-init):

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  file-exists-p(nil)
  (if (file-exists-p python-check) (progn (defvar python-check-command python-check "Command used to check a Python file.")))
  (when (file-exists-p python-check) (defvar python-check-command python-check "Command used to check a Python file."))
  (let* ((elpy-el (or byte-compile-current-file buffer-file-name)) (python-check (when elpy-el (concat (file-name-directory elpy-el) "python-check.sh")))) (when (file-exists-p python-check) (defvar python-check-command python-check "Command used to check a Python file.")))
  eval-buffer(#<buffer  *load*<2>> nil "/Users/lvh/.emacs.d/elpy/elpy.el" nil t)  ; Reading at buffer position 1965

This happens regardless of whether or not I set python-check-command. python-check's value is nil, but that might be related to the error.

Refactoring command fails on OS X/Emacs trunk

Hi,

first of all, thanks alot for fixing my recent virtualenv-related issue so quickly! I have noticed that C-c C-r does not work for me; Emacs returns the following error message: "elpy-rpc-call: Unknown method get_refactor_options". The elpy python module has been installed, although it resides in a virtual environment (which seems to work well in all other regards, including pydoc support, autocompletion, etc.). Is this a known bug or might I still be missing some dependencies?
best,
Sebastian

Traceback in refactor_add_missing_imports

Simply running add missing imports on a file caused this:

Traceback (most recent call last):
  File "/afs/dfn-cert.de/user/schaefer/.virtualenvs/petlib/lib/python2.7/site-packages/elpy/rpc.py", line 101, in handle_request
    result = method(*params)
  File "/afs/dfn-cert.de/user/schaefer/.virtualenvs/petlib/lib/python2.7/site-packages/elpy/server.py", line 141, in rpc_refactor
    return ref.get_changes(method, *args)
  File "/afs/dfn-cert.de/user/schaefer/.virtualenvs/petlib/lib/python2.7/site-packages/elpy/refactor.py", line 209, in get_changes
    return method(*args)
  File "/afs/dfn-cert.de/user/schaefer/.virtualenvs/petlib/lib/python2.7/site-packages/elpy/refactor.py", line 231, in refactor_add_missing_imports
    return autoimport.get_changes(self.resource.real_path)
  File "/afs/dfn-cert.de/user/schaefer/.virtualenvs/petlib/lib/python2.7/site-packages/elpy/utils/autoimport.py", line 32, in get_changes
    newsource = _autoimport_add_imports(orig)
  File "/afs/dfn-cert.de/user/schaefer/.virtualenvs/petlib/lib/python2.7/site-packages/elpy/utils/autoimport.py", line 50, in _autoimport_add_imports
    for name in findundefined.find_undefined(source):
  File "/afs/dfn-cert.de/user/schaefer/.virtualenvs/petlib/lib/python2.7/site-packages/elpy/utils/findundefined.py", line 8, in find_undefined
    return sorted(set(undefined))
  File "/afs/dfn-cert.de/user/schaefer/.virtualenvs/petlib/lib/python2.7/site-packages/elpy/utils/findundefined.py", line 119, in _find_undefined_from_script
    if _not_found(arg, current):
  File "/afs/dfn-cert.de/user/schaefer/.virtualenvs/petlib/lib/python2.7/site-packages/elpy/utils/findundefined.py", line 134, in _not_found
    while "." in var:
TypeError: argument of type 'NoneType' is not iterable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.