Update nix python shell templates

This commit is contained in:
Evie Litherland-Smith 2024-06-04 16:13:39 +01:00
parent b22cf00056
commit f7f909d615

View file

@ -167,26 +167,33 @@ nix-mode
"platforms = platforms."
(p (completing-read "Platform: " '("all" "allBut" "arm" "cygwin" "darwin" "freebsd" "gnu" "i686" "illumos" "linux" "mesaPlatforms" "mips" "netbsd" "none" "openbsd" "unix" "x86"))) ";" n> q "};" n> "}"
)
(pythonshell "with import " (p "<nixpkgs>") " {};" n
> "mkShellNoCC {" n
(pythonshell "let" n
> "pkgs = import " (p "<nixpkgs>") " {};" n
> "in pkgs.mkShellNoCC {" n
> "packages = [" n
> "(" (p "python3") ".withPackages" n
> "(ps: with ps; ["(p "python-lsp-server isort mypy") "]))" n
> "(pkgs." (p "python3") ".withPackages" n
> "(ps: with ps; ["(p "mypy") "]))" n
> q n
> "];" n
> "}")
(poetryshell "# See https://github.com/nix-community/poetry2nix/blob/master/docs/edgecases.md#cases" n
"# for edgecases like setuptools not found" n
"with import " (p "<nixpkgs>") " {};" n
"with (builtins.getFlake \"github:nix-community/poetry2nix\").lib.mkPoetry2Nix {inherit pkgs;};" n
> "(mkPoetryEnv rec {" n
> "projectDir = ./.;" n
"let" n
> "pkgs = import " (p "<nixpkgs>") " {};" n
> "poetry2nix = (builtins.getFlake \"github:nix-community/poetry2nix\").lib.mkPoetry2Nix {inherit pkgs;};" n
> "env = with poetry2nix; let " n
> "projectDir = " (p "./.") ";" n
> "in (mkPoetryEnv rec {" n
> "inherit projectDir;" n
> "python = " (p "pkgs.python3") ";" n
> "preferWheels = true;" n
> "extras = [\"*\"];" n
> "editablePackageSources = {" (p "package") "=projectDir;};" n
> "extraPackages = ps: with ps; [" (p "python-lsp-server isort mypy") " " q "];" n
> "})" n
> ".env")
> "});" n
"in" n
> "pkgs.mkShellNoCC {" n
> "packages = [pkgs.poetry env " q "];" n
> "}")
(poetryoverride "overrides = defaultPoetryOverrides.extend" n
> "(self: super: {" n
> (s package) " =" n
@ -194,7 +201,7 @@ nix-mode
> "(old: {" n
> "buildInputs = (old.buildInputs or []) ++ [super." (p "setuptools" ) "];" n
> "});" n
> "});")
> "});" q)
python-base-mode