The Complete Computer

Python in Emacs through LSP

LifeTechEmacsArcology

Python is a high-level interpreted Programming Language with some good functional constructs and a whitespace-sensitive syntax, dynamic types, objects and classes. It's a good Tool for data processing, it's a good tool for building small utilities, particularly with libraries like Click

emacs-lisp source: 
(provide 'cce/python)

In the CCE, Python programming is done using pyright in the LSP .

nix source: :tangle ~/arroyo-nix/hm/python.nix
{ pkgs, lib, ... }: { home.packages = [ pkgs.pyright ]; }

And I need to pull in poetry2nix in to my system using an overlay because the nixpkgs folks don't think it should be vendored. It's kept updated in my Nix Version Pins file.

nix source: :tangle ~/arroyo-nix/nixos/poetry2nix.nix
{ ... }: let poetry2nix = (import ../versions.nix {}).poetry2nix null; in { nixpkgs.overlays = [ (import "${poetry2nix}/overlay.nix") ]; }
emacs-lisp source: 
(use-package lsp-pyright :after lsp :config (add-hook 'python-mode-hook #'lsp) (add-hook 'python-mode-hook #'company-mode) :bind (:map python-mode-map ("C-<tab>" . company-lsp))) (use-package pyvenv)