From 40cd5e511cf96dc4036d256e5093dccf74a48dc4 Mon Sep 17 00:00:00 2001 From: Evgeny Pisemsky Date: Sat, 19 Apr 2025 15:37:22 +0300 Subject: [PATCH] gnu: python-django-compressor: Run tests against installed package. * gnu/packages/django.scm (python-django-compressor): Run tests against installed package. [arguments] : Remove 'add-missing-init-files; add 'fix-setup.py. Change-Id: Idd810376921d1802adb9355c52edcd1a8584eef7 Co-authored-by: Sharlatan Hellseher Signed-off-by: Sharlatan Hellseher --- gnu/packages/django.scm | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm index f2e7552b9c7..b13e94da292 100644 --- a/gnu/packages/django.scm +++ b/gnu/packages/django.scm @@ -1453,21 +1453,19 @@ forms using your favorite CSS framework, without writing template code.") (lambda _ (substitute* "compressor/tests/test_filters.py" (("test_calmjs_filter") "_test_calmjs_filter")))) - ;; TODO: Report upstream. - (add-after 'unpack 'add-missing-init-files + ;; XXX: Reported upstream + ;; . + (add-after 'unpack 'fix-setup.py (lambda _ (substitute* "setup.py" - (("package_data=.*,") "include_package_data=True,")) - (call-with-output-file "compressor/templates/__init__.py" - (const #t)) - (call-with-output-file "compressor/templates/compressor/__init__.py" - (const #t)))) + (("package_data=.*,") "include_package_data=True,")))) (replace 'check - (lambda* (#:key tests? #:allow-other-keys) + (lambda* (#:key tests? inputs outputs #:allow-other-keys) (when tests? - (setenv "DJANGO_SETTINGS_MODULE" "compressor.test_settings") - (invoke "django-admin" "test" - "--pythonpath=."))))))) + (with-directory-excursion (site-packages inputs outputs) + (setenv "DJANGO_SETTINGS_MODULE" "compressor.test_settings") + (invoke "django-admin" "test" + "--pythonpath=.")))))))) (propagated-inputs (list python-django python-django-appconf