Archived
1
0
Fork 0

gnu: python-django-auth-ldap: Update to 4.0.0.

* gnu/packages/django.scm (python-django-auth-ldap): Update to 4.0.0.
[arguments]: Rewrite with gexp and remove inputs labels.  Do a "manual"
PEP517-style build.
[native-inputs]: Remove PYTHON-MOCK.  Change from OPENLDAP to OPENLDAP-2.6.
Add PYTHON-PYPA-BUILD, PYTHON-PIP, PYTHON-SETUPTOOLS-SCM, PYTHON-TOML, and
PYTHON-WHEEL.
This commit is contained in:
Marius Bakke 2022-01-20 23:40:25 +01:00
parent 7f1e295c08
commit 7b62e4d3d3
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -30,6 +30,7 @@
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix git-download) #:use-module (guix git-download)
#:use-module (guix gexp)
#:use-module (guix build-system python) #:use-module (guix build-system python)
#:use-module (guix deprecation) #:use-module (guix deprecation)
#:use-module (gnu packages) #:use-module (gnu packages)
@ -41,6 +42,7 @@
#:use-module (gnu packages geo) #:use-module (gnu packages geo)
#:use-module (gnu packages openldap) #:use-module (gnu packages openldap)
#:use-module (gnu packages python) #:use-module (gnu packages python)
#:use-module (gnu packages python-build)
#:use-module (gnu packages python-crypto) #:use-module (gnu packages python-crypto)
#:use-module (gnu packages python-web) #:use-module (gnu packages python-web)
#:use-module (gnu packages python-xyz) #:use-module (gnu packages python-xyz)
@ -1181,28 +1183,42 @@ FileFields during tests.")
(define-public python-django-auth-ldap (define-public python-django-auth-ldap
(package (package
(name "python-django-auth-ldap") (name "python-django-auth-ldap")
(version "2.4.0") (version "4.0.0")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (pypi-uri "django-auth-ldap" version)) (uri (pypi-uri "django-auth-ldap" version))
(sha256 (sha256
(base32 (base32
"0xk6cxiqz5j3q79bd54x64f26alrlc8p7k9wkp2c768w2k1vzz30")))) "0fajn4bk7m1hk0mjz97q7vlfzh7ibzv8f4qn7zhkq26f4kk7jvr7"))))
(build-system python-build-system) (build-system python-build-system)
(arguments (arguments
'(#:phases (modify-phases %standard-phases (list #:phases
(replace 'check #~(modify-phases %standard-phases
(lambda* (#:key inputs #:allow-other-keys) (replace 'build
(let ((openldap (assoc-ref inputs "openldap"))) (lambda _
;; The tests need 'slapd' which is installed to the ;; Set file modification times to the early 80's because
;; libexec directory of OpenLDAP. ;; the Zip format does not support earlier timestamps.
(setenv "SLAPD" (string-append openldap "/libexec/slapd")) (setenv "SOURCE_DATE_EPOCH"
(setenv "SCHEMA" (number->string (* 10 366 24 60 60)))
(string-append openldap "/etc/openldap/schema")) (invoke "python" "-m" "build" "--wheel"
(invoke "python" "-m" "django" "test" "--no-isolation" ".")))
"--settings" "tests.settings"))))))) (replace 'check
(lambda* (#:key inputs #:allow-other-keys)
(setenv "SLAPD" (search-input-file inputs "/libexec/slapd"))
(setenv "SCHEMA"
(search-input-directory inputs "etc/openldap/schema"))
(invoke "python" "-m" "django" "test"
"--settings" "tests.settings")))
(replace 'install
(lambda _
(let ((whl (car (find-files "dist" "\\.whl$"))))
(invoke "pip" "--no-cache-dir" "--no-input"
"install" "--no-deps" "--prefix" #$output whl)))))))
(native-inputs (native-inputs
(list openldap python-mock)) (list openldap-2.6 python-wheel python-setuptools-scm python-toml
;; These can be removed after <https://bugs.gnu.org/46848>.
python-pypa-build python-pip))
(propagated-inputs (propagated-inputs
(list python-django python-ldap)) (list python-django python-ldap))
(home-page "https://github.com/django-auth-ldap/django-auth-ldap") (home-page "https://github.com/django-auth-ldap/django-auth-ldap")