;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 Hartmut Goebel ;;; Copyright © 2016 Efraim Flashner ;;; Copyright © 2017 ng0 ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice ;;; Copyright © 2017 Ricardo Wurmus ;;; Copyright © 2018 Vijayalakshmi Vedantham ;;; Copyright © 2019 Sam ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu packages django) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix build-system python) #:use-module (gnu packages) #:use-module (gnu packages base) #:use-module (gnu packages databases) #:use-module (gnu packages check) #:use-module (gnu packages python) #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) #:use-module (gnu packages sphinx) #:use-module (gnu packages time)) (define-public python-django (package (name "python-django") (version "1.11.25") (source (origin (method url-fetch) (uri (pypi-uri "Django" version)) (sha256 (base32 "0rpgx212n8gh61nwizkyldvskna808xpcvawmavk5mc5c9cfh52k")))) (build-system python-build-system) (arguments '(#:modules ((srfi srfi-1) (guix build python-build-system) (guix build utils)) #:phases (modify-phases %standard-phases (add-before 'check 'set-tzdir (lambda* (#:key inputs #:allow-other-keys) ;; The test-suite tests timezone-dependent functions, thus tzdata ;; needs to be available. (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo")) #t)) (replace 'check (lambda* (#:key inputs #:allow-other-keys) (setenv "PYTHONPATH" (string-append ".:" (getenv "PYTHONPATH"))) (substitute* "tests/admin_scripts/tests.py" (("python_path = \\[") (string-append "python_path = ['" (find (lambda (entry) (string-prefix? (assoc-ref inputs "python-pytz") entry)) (string-split (getenv "PYTHONPATH") #\:)) "', "))) (invoke "python" "tests/runtests.py")))))) ;; TODO: Install extras/django_bash_completion. (native-inputs `(("tzdata" ,tzdata-for-tests) ;; bcrypt and argon2-cffi are extra requirements not yet in guix ;;("python-argon2-cffi" ,python-argon2-cffi) ; >= 16.1.0 ;;("python-bcrypt" ,python-bcrypt) ; not py-bcrypt! ;; Remaining packages are test requirements taken from ;; tests/requirements/py3.txt ("python-docutils" ,python-docutils) ;; optional for tests: ("python-geoip2" ,python-geoip2) ("python-jinja2" ,python-jinja2) ; >= 2.7 ;; optional for tests: ("python-memcached" ,python-memcached) ("python-numpy" ,python-numpy) ("python-pillow" ,python-pillow) ("python-pyyaml" ,python-pyyaml) ;; optional for tests: ("python-selenium" ,python-selenium) ("python-sqlparse" ,python-sqlparse) ("python-tblib" ,python-tblib))) (propagated-inputs `(("python-pytz" ,python-pytz))) (home-page "http://www.djangoproject.com/") (synopsis "High-level Python Web framework") (des