From c0f0bfc5b68043304216480d93dd478c4a482582 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 3 Apr 2023 13:29:15 +0100 Subject: [PATCH] Improve standard templates for python packages --- templates/poetry.nix | 2 ++ templates/python.nix | 1 + 2 files changed, 3 insertions(+) diff --git a/templates/poetry.nix b/templates/poetry.nix index b9724b32..af84a269 100644 --- a/templates/poetry.nix +++ b/templates/poetry.nix @@ -18,6 +18,8 @@ pkgs.mkShell { shellHook = '' export LD_LIBRARY_PATH="${pkgs.zlib}/lib:${pkgs.libgccjit}/lib" + poetry lock --check > /dev/null || poetry lock + poetry env use "$(command -v ${python}/bin/python)" [ ! -d "./.venv" ] && poetry install --sync source .venv/bin/activate ''; diff --git a/templates/python.nix b/templates/python.nix index b9193c90..dfe1bb76 100644 --- a/templates/python.nix +++ b/templates/python.nix @@ -19,5 +19,6 @@ pkgs.mkShell { export LD_LIBRARY_PATH="${pkgs.zlib}/lib:${pkgs.libgccjit}/lib" python -m venv .venv source .venv/bin/activate + pip list --outdated | grep -iE "^(pip|wheel)" > /dev/null && python -m pip install --upgrade pip wheel ''; }