[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/03: gnu: python-djangorestframework: Enable tests.
From: |
guix-commits |
Subject: |
01/03: gnu: python-djangorestframework: Enable tests. |
Date: |
Fri, 7 May 2021 10:03:18 -0400 (EDT) |
mbakke pushed a commit to branch master
in repository guix.
commit a0365cf0073c550ef00baf462ce4875552867d36
Author: Marius Bakke <marius@gnu.org>
AuthorDate: Fri May 7 13:41:52 2021 +0200
gnu: python-djangorestframework: Enable tests.
* gnu/packages/django.scm (python-djangorestframework)[source]: Change to
GIT-FETCH.
[arguments]: Remove #:tests?. Add #:phases.
[native-inputs]: New field.
---
gnu/packages/django.scm | 28 +++++++++++++++++++++++-----
1 file changed, 23 insertions(+), 5 deletions(-)
diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm
index 5ec1c57..df143dc 100644
--- a/gnu/packages/django.scm
+++ b/gnu/packages/django.scm
@@ -1028,15 +1028,33 @@ Django projects, which allows association of a number
of tags with any
(version "3.12.4")
(source
(origin
- (method url-fetch)
- (uri (pypi-uri "djangorestframework" version))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/encode/django-rest-framework")
+ (commit version)))
+ (file-name (git-file-name name version))
(sha256
(base32
- "1wm7q3vp4226n6fhjnkjxg6pgh95p6ag238rg7l7dj6sind98izp"))))
+ "16n17dw35wqv47m8k8fixn0yywrvd6v4r573yr4nx6lbbiyi2cqn"))))
(build-system python-build-system)
(arguments
- '(;; No included tests
- #:tests? #f))
+ '(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ ;; Add a fix from the master branch for compatibility with Django
+ ;; 3.2: https://github.com/encode/django-rest-framework/pull/7911
+ ;; Remove for versions > 3.12.4.
+ (substitute* "tests/test_fields.py"
+ (("class MockTimezone:")
+ "class MockTimezone(pytz.BaseTzInfo):"))
+ (if tests?
+ (invoke "python" "runtests.py" "--nolint")
+ (format #t "test suite not run~%")))))))
+ (native-inputs
+ `(("python-django" ,python-django)
+ ("python-pytest" ,python-pytest)
+ ("python-pytest-django" ,python-pytest-django)))
(home-page "https://www.django-rest-framework.org")
(synopsis "Toolkit for building Web APIs with Django")
(description