Elpy: [question] enable-elpy deprecated?

Created on 11 Oct 2019  Â·  5Comments  Â·  Source: jorgenschaefer/elpy

I am getting this warning

Warning (emacs): The argument to ‘elpy-enable’ is deprecated, customize ‘elpy-modules’ instead

Maybe readme should be updated accordingly to reflect any changes?

Also I have flycheck installed how can I make elpy aware of this instead of using flymake?
Warning [flymake testpyth.py]: Disabling backend flymake-proc-legacy-flymake because (error Can’t find a suitable init function)

Also what variable should I change in order for elpy not to hijack my already setup yas-directory?

On another note, any progress on removing ivy dependency?

All 5 comments

Warning (emacs): The argument to ‘elpy-enable’ is deprecated, customize ‘elpy-modules’ instead

elpy-enable is not deprecated, this message is just saying that elpy-enable does not take arguments anymore (it used to, to specify which modules you wanted to use).

Also I have flycheck installed how can I make elpy aware of this instead of using flymake?

You can replace flymake with flycheck with this snippet (see the docs, here).

(when (load "flycheck" t t)
  (setq elpy-modules (delq 'elpy-module-flymake elpy-modules))
  (add-hook 'elpy-mode-hook 'flycheck-mode))

Also what variable should I change in order for elpy not to hijack my already setup yas-directory?

Elpy just add a bunch of snippets to the already available ones (by appending the yas-snippet-dirs list). If you don't want Elpy's snippets, just disable the yasnippet module (through M-x customize-variable RET elpy-modules). And add a hook to load yas for python buffer: (add-hook 'python-mode-hook (lambda () (yas-minor-mode 1))

On another note, any progress on removing ivy dependency?

PR #1681 is on its way. I just need to find a bit of time to make a last review before merging.

@galaunay How can I remove the highlight-indentation package from elisp? I used similar approach to the one you suggested
(when (load "highlight-indent-guides" t t) (setq elpy-modules (delq 'elpy-module-highlight-indentation elpy-modules)) (add-hook 'elpy-mode-hook 'highlight-indent-guides-mode))
but the package highlight-indentation seems to be still installed. I also tried (package-delete ' (highlight-indentation)) but no effect. Any other alternatives?

OR if possible replace highlight-indentation with highlight-indentation-guides?

package-delete doesn't take a package name directly, but its description (which is an elisp structure), so you need something like this:

(package-delete (nth 1 (assoc 'highlight-indentation package-alist)))

However, package will refuse to delete highlight-indentation because it is direct Elpy dependency.
You can still force the deletion with:

(package-delete (nth 1 (assoc 'highlight-indentation package-alist))
                t)

So if I update your snippet, this should work:

(when (load "highlight-indent-guides" t t)
  (when (assoc 'highlight-indentation package-alist)
    (package-delete (nth 1 (assoc 'highlight-indentation package-alist)) t))
  (setq elpy-modules (delq 'elpy-module-highlight-indentation elpy-modules))
  (add-hook 'elpy-mode-hook 'highlight-indent-guides-mode))

But I would let highlight-indentation installed for now to avoid breaking dependencies.
If you just disable the Elpy module (as you did already), it shouldn't slow down Emacs.

@galaunay Thanks a lot!

You are welcome.

I am closing this then.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SirSharpest picture SirSharpest  Â·  6Comments

Arseny-N picture Arseny-N  Â·  4Comments

kootenpv picture kootenpv  Â·  3Comments

kapilsh picture kapilsh  Â·  3Comments

Holt59 picture Holt59  Â·  6Comments