OPTION: Simple eglot/flymake/rass
This is the current approach. The premise of this approach is to reinstall all of the IDE support stuff in each project's virtual package. reason: lots of debugging, doc, and other stuff assumes that we are in the environment that the program is running in, so it's not practical to have one clean environment with emacs and Python IDE stuff, another with the specific program and its stuff, and have the emacs from the first do complicated things with the code from the second. The downside is that the project virtualenv is cluttered with dev stuff, but that should be isolatable depending on the packaging tool.
-
What works
Syntax formatting works
C-nextandC-prevnavigate through errorsC-brings up company completion
-
What to try
xref-find-definitions
M-. to find the definition of the identifier at point.
xref-go-back
M-, to return back to where you invoked the xref-find-definitions command.
xref-find-references
M-? to find references to the identifier at point.
-
Start virtual environment.
source ~/.config/venv/myproject/bin/activate -
Install Python packages
pip install rassumfrassum ty ruff isort blackNote
Sources: Rassumfrassum on github
-
Configure emacs to use eglot/rass for python
This is all done in the standard init.el in
'use-package eglot. -
Configure pyproject so ty can find modules
For each project, configure
pyproject.tomlto find project modules for import.[tool.ty.environment] extra-paths = ["./src/myproject"]
Note
Source: astral.sh
-
Configure pyproject so isort and black work together
Put some stuff in every pyproject.toml so that isort and black cooperate.
[tool.isortk profile = "black"
Note
Source: isort readthedocs.io