gnu: thefuck: Upgrade to 3.15 and enable tests.

* gnu/packages/patches/thefuck-test-environ.patch: New patch.
* gnu/packages/admin.scm (thefuck): Upgrade to 3.15.
[source]: Use patch.
[arguments]: Remove '#:tests? #f'.  Move 'check' phase after 'install'.
* gnu/local.mk (dist_patch_DATA): Add patch.
This commit is contained in:
Eric Bavier 2017-03-29 20:23:33 -05:00
parent 6fd52309b8
commit bf5b6fb294
No known key found for this signature in database
GPG key ID: 1EBBD204781F962C
3 changed files with 29 additions and 13 deletions

View file

@ -948,6 +948,7 @@ dist_patch_DATA = \
%D%/packages/patches/texlive-texmf-CVE-2016-10243.patch \ %D%/packages/patches/texlive-texmf-CVE-2016-10243.patch \
%D%/packages/patches/texi2html-document-encoding.patch \ %D%/packages/patches/texi2html-document-encoding.patch \
%D%/packages/patches/texi2html-i18n.patch \ %D%/packages/patches/texi2html-i18n.patch \
%D%/packages/patches/thefuck-test-environ.patch \
%D%/packages/patches/tidy-CVE-2015-5522+5523.patch \ %D%/packages/patches/tidy-CVE-2015-5522+5523.patch \
%D%/packages/patches/tinyxml-use-stl.patch \ %D%/packages/patches/tinyxml-use-stl.patch \
%D%/packages/patches/tipp10-fix-compiling.patch \ %D%/packages/patches/tipp10-fix-compiling.patch \

View file

@ -2,7 +2,7 @@
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com> ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2014, 2015, 2016 Eric Bavier <bavier@member.fsf.org> ;;; Copyright © 2014, 2015, 2016, 2017 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2015, 2016 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com> ;;; Copyright © 2015, 2016 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
;;; Copyright © 2015 Alex Sassmannshausen <alex.sassmannshausen@gmail.com> ;;; Copyright © 2015 Alex Sassmannshausen <alex.sassmannshausen@gmail.com>
;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr> ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
@ -1688,7 +1688,7 @@ (define-public dstat
(define-public thefuck (define-public thefuck
(package (package
(name "thefuck") (name "thefuck")
(version "3.11") (version "3.15")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append "https://github.com/nvbn/thefuck/archive/" (uri (string-append "https://github.com/nvbn/thefuck/archive/"
@ -1696,19 +1696,20 @@ (define-public thefuck
(file-name (string-append name "-" version ".tar.gz")) (file-name (string-append name "-" version ".tar.gz"))
(sha256 (sha256
(base32 (base32
"04q2cn8c83f6z6wn1scla1ilrpi5ssjc64987hvmwfvwvb82bvkp")))) "1vxas21h5mf41cb6y7f7x07858ags7qg45lkf74rc0slqbic3l1h"))
(patches (search-patches "thefuck-test-environ.patch"))))
(build-system python-build-system) (build-system python-build-system)
(arguments (arguments
'(#:tests? #f)) '(#:phases
;; FIXME: 10 test failures. Some require newer pytest (> 2.9.2). (modify-phases %standard-phases
;; Others need more work. Un-comment the below to run the tests. (delete 'check)
;; #:phases (add-after 'install 'check
;; (modify-phases %standard-phases (lambda* (#:key inputs outputs #:allow-other-keys)
;; (replace 'check ;; Tests look for installed package
;; (lambda _ (add-installed-pythonpath inputs outputs)
;; ;; Some tests need write access to $HOME. ;; Some tests need write access to $HOME.
;; (setenv "HOME" "/tmp") (setenv "HOME" "/tmp")
;; (zero? (system* "py.test" "-v"))))))) (zero? (system* "py.test" "-v")))))))
(propagated-inputs (propagated-inputs
`(("python-colorama" ,python-colorama) `(("python-colorama" ,python-colorama)
("python-decorator" ,python-decorator) ("python-decorator" ,python-decorator)

View file

@ -0,0 +1,14 @@
Retain environment setting of "HOME" for tests that need os.path.expanduser()
to return a readable directory in the build chroot.
--- thefuck-3.15/tests/test_conf.py
+++ thefuck-3.15/tests/test_conf.py
@@ -12,7 +12,7 @@
@pytest.fixture
def environ(monkeypatch):
- data = {}
+ data = {"HOME": os.environ.get("HOME")}
monkeypatch.setattr('thefuck.conf.os.environ', data)
return data