From 0718b844bd26d69c85ec2e1459501cd7ceabc81e Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Mon, 4 Nov 2024 22:15:04 +0100 Subject: [PATCH] djangocms-admin-style --- .../djangocms-admin-style/default.nix | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/djangocms-admin-style/default.nix b/pkgs/development/python-modules/djangocms-admin-style/default.nix index e913776774faf..1f0dd68c87583 100644 --- a/pkgs/development/python-modules/djangocms-admin-style/default.nix +++ b/pkgs/development/python-modules/djangocms-admin-style/default.nix @@ -1,11 +1,13 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, django, pythonOlder, pytestCheckHook, setuptools, + django-cms, + djangocms-admin-style, }: buildPythonPackage rec { @@ -15,22 +17,36 @@ buildPythonPackage rec { disabled = pythonOlder "3.7"; - src = fetchPypi { - inherit pname version; - hash = "sha256-2iDeODHxoadN4z/hK704ZaACepgoeMAqodECsceZ12c="; + src = fetchFromGitHub { + owner = "django-cms"; + repo = "djangocms-admin-style"; + rev = "refs/tags/${version}"; + hash = "sha256-cDbmC7IJTT3NuVXBnbUVqC7dUfusMdntDGu2tSvxIdQ="; }; build-system = [ setuptools ]; dependencies = [ django ]; - env.DJANGO_SETTINGS_MODULE = "tests.settings"; + nativeCheckInputs = [ pytestCheckHook ]; - checkInputs = [ pytestCheckHook ]; + checkInputs = [ django-cms ]; + # Tests depend on django-cms, which depends on this package. + # To avoid infinite recursion, we only enable tests when building passthru.tests. doCheck = false; - #pythonImportCheck = [ "django-cms" ]; + preCheck = '' + export DJANGO_SETTINGS_MODULE="tests.settings" + ''; + + passthru.tests = { + runTests = djangocms-admin-style.overridePythonAttrs (_: { + doCheck = true; + }); + }; + + pythonImportCheck = [ "djangocms_admin_style" ]; meta = { description = "Django Theme tailored to the needs of django CMS";