diff options
| author | Craig Jennings <c@cjennings.net> | 2026-03-07 11:28:56 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-03-07 11:28:56 -0600 |
| commit | 60943e96a6a6a9fe6e8d368f9db2bf9aedf1a6bc (patch) | |
| tree | 5a49bdd265eb5a8f2803d016ddcfafbc99e0c5e3 /assets/outbox/pyright-and-django-stubs.txt | |
| parent | 3285f944b32f4b362abb00630daa86078b99dc9d (diff) | |
chore: update calibre, mimeapps, authinfo, add outbox items
Calibre window geometry and scheduler updates. Add Signal URI handlers.
Move processed inbox items to outbox.
Diffstat (limited to 'assets/outbox/pyright-and-django-stubs.txt')
| -rw-r--r-- | assets/outbox/pyright-and-django-stubs.txt | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/assets/outbox/pyright-and-django-stubs.txt b/assets/outbox/pyright-and-django-stubs.txt new file mode 100644 index 0000000..a9fcd90 --- /dev/null +++ b/assets/outbox/pyright-and-django-stubs.txt @@ -0,0 +1,48 @@ +pyright and django-stubs +======================== + +WHY +--- +Emacs is configured to use pyright as the Python LSP server (via lsp-pyright) +instead of pylsp. Pyright has significantly better type inference, especially +for Django's dynamic attributes (model fields, querysets, managers). With +django-stubs, pyright understands the Django ORM well enough to provide +accurate completions and type checking on QuerySets, Model.objects, request +objects, etc. + +PYRIGHT (language server - system-wide tool) +-------------------------------------------- +Install via pacman, NOT pip: + + sudo pacman -S pyright + +Pyright is already in the Arch extra repo. Do not use pip or pipx for this — +pacman keeps it updated with the rest of the system. + +DJANGO-STUBS (per-project, in the project venv) +------------------------------------------------ +django-stubs provides type stubs for Django so pyright understands Django's +dynamic attributes. Install inside each Django project's virtual environment: + + pip install django-stubs + +This must be installed per-project (not globally) because it needs to match +the Django version in use. Also add to requirements-dev.txt or pyproject.toml +so other developers get it automatically. + +Also requires a pyrightconfig.json at the project root with: + + { + "plugins": ["django-stubs"] + } + +Or if using pyright's djangoStubs setting directly: + + { + "djangoStubs": true + } + +SUMMARY +------- +- pyright: pacman (system tool, installed once) +- django-stubs: pip in venv (per Django project) |
