From 9a19bed33f77d383129372f4a9ff91da67f9bbd5 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 24 May 2025 02:30:17 +0200 Subject: [PATCH] python313Packages.django-scheduler: refactor Use pep517 builder and pytest-django for tests. --- .../django-scheduler/default.nix | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/django-scheduler/default.nix b/pkgs/development/python-modules/django-scheduler/default.nix index 732e75dcd24e..3ffe10f0d65c 100644 --- a/pkgs/development/python-modules/django-scheduler/default.nix +++ b/pkgs/development/python-modules/django-scheduler/default.nix @@ -4,16 +4,18 @@ django, fetchFromGitHub, icalendar, - python, + pytestCheckHook, + pytest-django, python-dateutil, pythonOlder, pytz, + setuptools, }: buildPythonPackage rec { pname = "django-scheduler"; version = "0.10.1"; - format = "setuptools"; + pyproject = true; disabled = pythonOlder "3.7"; @@ -24,17 +26,22 @@ buildPythonPackage rec { hash = "sha256-dY2TPo15RRWrv7LheUNJSQl4d/HeptSMM/wQirRSI5w="; }; - propagatedBuildInputs = [ + build-system = [ setuptools ]; + + dependencies = [ django python-dateutil pytz icalendar ]; - checkPhase = '' - runHook preCheck - ${python.interpreter} -m django check --settings=tests.settings - runHook postCheck + nativeCheckInputs = [ + pytestCheckHook + pytest-django + ]; + + preCheck = '' + export DJANGO_SETTINGS_MODULE=tests.settings ''; pythonImportsCheck = [ "schedule" ];