complete-computing-environment/python.org

2.2 KiB

Python in Emacs through LSP

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

(provide 'cce/python)

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

{ 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.

{ ... }:

let poetry2nix = (import ../versions.nix {}).poetry2nix null;
in {
  nixpkgs.overlays = [
    (import "${poetry2nix}/overlay.nix")
  ];
}
(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)