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: :tangle ~/nix/lisp/python.el
(provide 'cce/python)

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

nix source: :tangle ~/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 pulled in as a flake input pinned by the Arroyo System Flake 's flake.lock.

nix source: :tangle ~/nix/snippets/poetry2nix-input.nix :mkdirp yes
poetry2nix = { url = "github:nix-community/poetry2nix"; inputs.nixpkgs.follows = "nixpkgs"; };
nix source: :tangle ~/nix/nixos/poetry2nix.nix
{ inputs, ... }: { nixpkgs.overlays = [ (import "${inputs.poetry2nix}/overlay.nix") ]; }
emacs-lisp source: :tangle ~/nix/lisp/python.el
(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)