From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0ZE5-00052G-Lo for guix-patches@gnu.org; Fri, 06 Oct 2017 16:28:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0ZE3-0008L6-RB for guix-patches@gnu.org; Fri, 06 Oct 2017 16:28:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:44940) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0ZE3-0008L0-N9 for guix-patches@gnu.org; Fri, 06 Oct 2017 16:28:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e0ZE3-0005Pz-HF for guix-patches@gnu.org; Fri, 06 Oct 2017 16:28:03 -0400 Subject: [bug#28726] [PATCH 1/5] gnu: django: Fix the build for python-django-gravatar2. References: <20171006212026.5797a685@cbaines.net> In-Reply-To: <20171006212026.5797a685@cbaines.net> Resent-Message-ID: From: Christopher Baines Date: Fri, 6 Oct 2017 21:26:58 +0100 Message-Id: <20171006202702.1511-1-mail@cbaines.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 28726@debbugs.gnu.org The build was failing as the Django settings were not configured for the tests. The relevant files are missing from the release on PyPI, so switch to using a more complete source release. Also update the package at the same time. * gnu/packages/django.scm (python-django-gravatar2)[version]: 1.4.0 -> 1.4.2. [source]: Change to use a tarball from GitHub, update the sha256 hash. [arguments]: Add a phase to skip a test requiring network access, and replace the check phase to call ./manage.py within the example_project directory. --- gnu/packages/django.scm | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm index c70c07493..fb8663d3f 100644 --- a/gnu/packages/django.scm +++ b/gnu/packages/django.scm @@ -226,15 +226,43 @@ account authentication.") (define-public python-django-gravatar2 (package (name "python-django-gravatar2") - (version "1.4.0") + (version "1.4.2") (source (origin (method url-fetch) - (uri (pypi-uri "django-gravatar2" version)) + (uri (string-append + "https://github.com/twaddington/django-gravatar/archive/" + version ".tar.gz")) (sha256 (base32 - "1v4qyj6kms321yw0z2g1kch6b2dskmv6fjd6sfxzwr4xshq9mccl")))) + "1qa0awqkfnfcjx7d5ijgr9hj8ifpq5xrj16196im4hw9r9i1wapf")))) (build-system python-build-system) + (arguments + '(#:phases + (modify-phases %standard-phases + ;; TODO: Tagging the tests requiring the web could be done upstream. + (add-before 'check 'skip-test-requiring-network-access + (lambda _ + (substitute* "django_gravatar/tests.py" + (("def test_has_gravatar") + "from django.test import tag + @tag('requires-web') + def test_has_gravatar")))) + (replace 'check + (lambda _ + (setenv "PYTHONPATH" + (string-append + (getcwd) + ":" + (getenv "PYTHONPATH"))) + (with-directory-excursion "example_project" + (zero? + (system* + "./manage.py" + "test" + "--verbosity=2" + "--exclude-tag=requires-web" + "django_gravatar")))))))) (inputs `(("python-django" ,python-django))) (home-page "https://github.com/twaddington/django-gravatar") -- 2.14.2