Add poetryoverride template, add link to edgecases to poetryshell

This commit is contained in:
Evie Litherland-Smith 2024-04-03 07:58:42 +01:00
parent e1c8c477ff
commit edd11a6c34

View file

@ -184,16 +184,26 @@ nix-mode
n> q
n> "];"
n> "}")
(poetryshell "with import " (p "<nixpkgs>") " {};"
(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> "preferWheels = true;"
n> "extras = [\"*\"];"
n> "editablePackageSources = {" (p "package") "=projectDir;};"
n> "extraPackages = ps: with ps; [" (p "python-lsp-server isort mypy")"];"
n> "extraPackages = ps: with ps; [" (p "python-lsp-server isort mypy") " " q "];"
n> "})"
n> ".env")
(poetryoverride "overrides = defaultPoetryOverrides.extend"
n> "(self: super: {"
n> (s package) " ="
n> "super." package ".overridePythonAttrs"
n> "(old: {"
n> "buildInputs = (old.buildInputs or []) ++ [super." (p "setuptools" ) "];"
n> "});"
n> "});")
python-base-mode