help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: elpy don't syntax check on the fly


From: Jean Louis
Subject: Re: elpy don't syntax check on the fly
Date: Wed, 21 Oct 2020 15:24:04 +0300
User-agent: Mutt/+ (1036f0e) (2020-10-18)

* c.buhtz@posteo.jp <c.buhtz@posteo.jp> [2020-10-21 10:49]:
> I have Windows 10, running "GNU Emacs 27.1 (build 1, i686-w64-mingw32) of
> 2020-08-21".
> 
> I used this (not perfect) tutorial to setup emacs.
> https://realpython.com/emacs-the-best-python-editor/
> 
> I learned that installing "elpy" from melpa (via emacs) is not enough.
> "elpy" uses external commandline tools (e.g. flake8) - but very
> intransparent to the user. Even the official documentation is not clear
> about that part.
> https://elpy.readthedocs.io/_/downloads/en/latest/pdf/
> The documentation only offers a name. No URL to a project side or bug
> tracker nor an email.
> 
> I do not want to neg here. I want to learn how to do my stuff AND how to
> improve the project/community. So a side-question: What would be the usual
> way to find the project website for an emacs-mode and open a ticket?

What I understand is that elpy is for Python writing.

You can do following:

{M-x package-list-packages RET}

and you will find list of packages, then there is this package:

python                         0.27           available    gnu
Python's flying circus support for Emacs

so I think that is good to start with, I cannot confirm as I am not
pythonista.

If you have problem with elpy, you can find the library:

{M-x find-library RET elpy RET}

then you may see inside who is author or maintainer and write to them
if you think there is some bug.

If you have a bug inside of Emacs, or need help, you write to this
list, you may also file bugs and suggest improvements in Emacs by
doing:

{M-x report-emacs-bug RET}

The notation I am using between { } helps to activate such commands by
using the package `hyperbola' that you may also find in the package list.

> Ok, back to the main problem.
> 
> I explicite installed flake8 via pip. It works because C-c C-v does show my
> expected syntax errors.
> But the tutorial I first mentioned here tells me elpy should show me syntax
> errors on the fly/live while I am typing. But it does not.

I have found IRC channel #elpy but there is nobody inside, one person,
that person could know more about that.

You may connect to IRC by using:

{M-x irc RET}

or

{M-x erc RET}

and then join to channel #elpy on freenode servers. 

Usually by using command:

/join #elpy

As in my opinion I do think you need just some basic setup.

> How can I go on with diagnosis in that case?

You could turn on "Enter debugger on error" in the Options menu to
start with.

> The elpy doc tells me the syntax checking only happens when the file is
> saved.

In my opinion, without being user of elpy, I do think it could take
place during writing as well, on the fly.

> But the tutorial indicates that it happens on the fly. I am confused.
> 
> Is there an alternative to have a real on the fly syntax checking while
> typing?

Definitely. I am researching that package, myself I find it insecure
to allow various installations through a package, but let us see:

I did:

{M-x elpy-config RET}

it asked me to install virtual environment and other tools, then this
screen appeared:

Elpy Configuration

Emacs.............: 28.0.50
Elpy..............: 1.34.0
Virtualenv........: None
Interactive Python: python 3.6.8 (/usr/bin/python)
RPC virtualenv....: rpc-venv (/home/data1/protected/.emacs.d/elpy/rpc-venv)
 Python...........: python 3.6.8 
(/home/data1/protected/.emacs.d/elpy/rpc-venv/bin/python)
 Jedi.............: Not found
 Rope.............: Not found
 Autopep8.........: Not found
 Yapf.............: Not found
 Black............: Not found
Syntax checker....: Not found (flake8)

Warnings

You have not activated a virtual env. While Elpy supports this, it is
often a good idea to work inside a virtual env. You can use M-x
pyvenv-activate or M-x pyvenv-workon to activate a virtual env.

Elpy could not connect to Pypi (or at least not quickly enough) and
check if the python packages were up-to-date. You can still try to
update all of them:

[Update python packages]

The jedi package is not available. Completion and code navigation will
not work.

[Install jedi]

The autopep8 package is not available. Commands using this will not
work.

[Install autopep8]

The yapf package is not available. Commands using this will not work.

[Install yapf]

The black package is not available. Commands using this will not work.

[Install black]

The configured syntax checker could not be found. Elpy uses this
program to provide syntax checks of your programs, so you might want
to install one. Elpy by default uses flake8.

[Install flake8]

Options

`Raised' text indicates buttons; type RET or click mouse-1 on a button
to invoke its action.  Invoke [+] to expand a group, and [-] to
collapse an expanded group.  Invoke the [Group], [Face], and [Option]
buttons below to edit that item in another window.

[+]-- Group Elpy
[+]-- Group Python
[+]-- Group Virtual Environments (Pyvenv)
[ ]-- Group Completion (Company)
[+]-- Group Call Signatures (ElDoc)
[+]-- Group Inline Errors (Flymake)
[+]-- Group Code folding (hideshow)
[ ]-- Group Snippets (YASnippet)
[+]-- Group Directory Grep (rgrep)
[+]-- Group Search as You Type (ido)
[+]-- Group Django extension
[+]-- Group Autodoc extension

Then you would need to follow that screen to install various
components.

Can you confirm you did install all those components?


Jean



reply via email to

[Prev in Thread] Current Thread [Next in Thread]