From af4c8e074496902f4de25cb243b5d7990d11cf7c Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Mon, 22 May 2023 10:57:11 +0200 Subject: [PATCH] Update shell.nix and use django-types --- shell.nix | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/shell.nix b/shell.nix index 440f24bd..1dba6da6 100644 --- a/shell.nix +++ b/shell.nix @@ -1,5 +1,29 @@ { pkgs ? import { }, ... }: +let + python = pkgs.python38; + + django-types = python.pkgs.buildPythonPackage rec { + pname = "django-types"; + version = "0.17.0"; + + format = "pyproject"; + + src = pkgs.fetchPypi { + inherit pname version; + hash = "sha256-wcQqt4h2xXxyg0LVqwYHJas3H8jcg7uFuuC+BoRqrXA="; + }; + + nativeBuildInputs = with python.pkgs; [ poetry-core ]; + + # setup.cfg tries to pull in nonexistent LICENSE.txt file + # postPatch = "rm setup.cfg"; + + # propagatedBuildInputs = [ django typing-extensions ]; + }; +in + + pkgs.mkShell { shellHook = '' export DJANGO_SETTINGS_MODULE=gestioasso.settings.local @@ -10,12 +34,11 @@ pkgs.mkShell { pip install -r requirements-devel.txt | grep -v 'Requirement already satisfied:' ''; - packages = with pkgs; [ - python38 - python38Packages.pip - python38Packages.virtualenv - python38Packages.python-ldap - ]; + packages = [ python django-types ] ++ (with python.pkgs; [ + pip + virtualenv + python-ldap + ]); allowSubstitutes = false; }