summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobert Schütz <nix@dotlambda.de>2021-12-07 09:51:23 -0800
committerRobert Schütz <github@dotlambda.de>2021-12-11 09:13:32 -0800
commit5e4feb3c2da78853c87f29d97e34096facf5a10d (patch)
treebacea892f8e036b03e383fe96dc61f2cf4d770b0
parentf5e4406520339193af23dede6760ff150ed6f4e5 (diff)
downloadnixpkgs-5e4feb3c2da78853c87f29d97e34096facf5a10d.tar
nixpkgs-5e4feb3c2da78853c87f29d97e34096facf5a10d.tar.gz
nixpkgs-5e4feb3c2da78853c87f29d97e34096facf5a10d.tar.bz2
nixpkgs-5e4feb3c2da78853c87f29d97e34096facf5a10d.tar.lz
nixpkgs-5e4feb3c2da78853c87f29d97e34096facf5a10d.tar.xz
nixpkgs-5e4feb3c2da78853c87f29d97e34096facf5a10d.tar.zst
nixpkgs-5e4feb3c2da78853c87f29d97e34096facf5a10d.zip
python3Packages.django-sites: run tests
-rw-r--r--pkgs/development/python-modules/django-sites/default.nix45
1 files changed, 27 insertions, 18 deletions
diff --git a/pkgs/development/python-modules/django-sites/default.nix b/pkgs/development/python-modules/django-sites/default.nix
index 126e309ec0c..08641aa935f 100644
--- a/pkgs/development/python-modules/django-sites/default.nix
+++ b/pkgs/development/python-modules/django-sites/default.nix
@@ -1,31 +1,40 @@
-{ lib, buildPythonPackage, fetchPypi, django }:
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, django
+, django-jinja
+, python
+}:
 
 buildPythonPackage rec {
   pname = "django-sites";
   version = "0.11";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "1cbee714fdf2bfbe92e4f5055de4e6c41b64ebb32e1f96b1016c0748210928b8";
+  src = fetchFromGitHub {
+    owner = "niwinz";
+    repo = "django-sites";
+    rev = version;
+    sha256 = "sha256-MQtQC+9DyS1ICXXovbqPpkKIQ5wpuJDgq3Lcd/1kORU=";
   };
-  # LICENSE file appears to be missing from pypi package, but expected by the installer
-  # https://github.com/niwinz/django-sites/issues/11
-  postPatch = ''
-    touch LICENSE
-  '';
 
-  propagatedBuildInputs = [ django ];
+  propagatedBuildInputs = [
+    django
+  ];
+
+  checkInputs = [
+    django-jinja
+  ];
+
+  checkPhase = ''
+    runHook preCheck
 
-  # required files for test don't seem to be included in pypi package, full source for 0.10
-  # version doesn't appear to be present on github
-  # https://github.com/niwinz/django-sites/issues/9
-  doCheck = false;
+    ${python.interpreter} runtests.py
+
+    runHook postCheck
+  '';
 
   meta = {
-    description = ''
-      Alternative implementation of django "sites" framework
-      based on settings instead of models.
-    '';
+    description = "Alternative implementation of django sites framework";
     homepage = "https://github.com/niwinz/django-sites";
     license = lib.licenses.bsd3;
   };