From ea4be20af07ded69670b38fb321e3f5874f7ad41 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Wed, 28 Feb 2018 02:29:39 +0100 Subject: gnu: Add python-gitdb. * gnu/packages/version-control.scm (python-gitdb, python2-gitdb): New public variables. --- gnu/packages/version-control.scm | 60 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) (limited to 'gnu/packages/version-control.scm') diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 229dab5f35..adf28ed1ed 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -15,7 +15,7 @@ ;;; Copyright © 2017 Vasile Dumitrascu ;;; Copyright © 2017 Clément Lassieur ;;; Copyright © 2017 André -;;; Copyright © 2017 Marius Bakke +;;; Copyright © 2017, 2018 Marius Bakke ;;; Copyright © 2017 Stefan Reichör ;;; Copyright © 2017 Oleg Pykhalov ;;; @@ -52,6 +52,7 @@ #:use-module (gnu packages base) #:use-module (gnu packages bison) #:use-module (gnu packages boost) + #:use-module (gnu packages check) #:use-module (gnu packages cook) #:use-module (gnu packages curl) #:use-module (gnu packages docbook) @@ -633,6 +634,63 @@ default) of the repository.") (package-with-python2 (strip-python2-variant python-ghp-import))) +(define-public python-gitdb + (package + (name "python-gitdb") + (version "2.0.3") + (source (origin + (method url-fetch) + (uri (pypi-uri "gitdb2" version)) + (sha256 + (base32 + "02azg62mr99b7cllyjrly77np3vw32y8nrxpa2xjapiyaga2j3mn")))) + (build-system python-build-system) + (arguments + `(#:phases (modify-phases %standard-phases + (add-before 'check 'create-test-repository + (lambda _ + (mkdir "/tmp/testrepo") + ;; Some tests require a git repository, so create one. + (with-directory-excursion "/tmp/testrepo" + (do ((filecount 1 (1+ filecount))) + ((> filecount 1000)) + (call-with-output-file (string-append + "file" (number->string filecount)) + (lambda (port) + (format port "~a" filecount)))) + (and + (invoke "git" "init") + (invoke "git" "config" "user.name" "Total Git") + (invoke "git" "config" "user.email" "git@localhost") + (invoke "git" "add" "-A") + (invoke "git" "commit" "-q" "-m" "dummy commit"))) + + ;; The repository checkout must be a "bare" clone. + (invoke "git" "clone" "--bare" "/tmp/testrepo" + "/tmp/testrepo.git"))) + (replace 'check + (lambda _ + (setenv "GITDB_TEST_GIT_REPO_BASE" "/tmp/testrepo.git") + ;; Skip tests that must be run from the gitdb repository. + (setenv "TRAVIS" "1") + (invoke "nosetests" "-v")))))) + (propagated-inputs + `(("python-smmap2" ,python-smmap2))) + (native-inputs + `(("git" ,git) + ("python-nose" ,python-nose))) + (home-page "https://github.com/gitpython-developers/gitdb") + (synopsis "Python implementation of the Git object database") + (description + "GitDB allows you to access @dfn{bare} Git repositories for reading and +writing. It aims at allowing full access to loose objects as well as packs +with performance and scalability in mind. It operates exclusively on streams, +allowing to handle large objects with a small memory footprint.") + (license license:bsd-3))) + +(define-public python2-gitdb + (package-with-python2 python-gitdb)) + (define-public shflags (package (name "shflags") -- cgit v1.2.3