diff options
author | Hartmut Goebel <h.goebel@crazy-compilers.com> | 2016-09-28 11:36:35 +0200 |
---|---|---|
committer | Hartmut Goebel <h.goebel@crazy-compilers.com> | 2016-11-15 17:37:49 +0100 |
commit | 891a843d5184f696618af6fcbb9791ef6b574504 (patch) | |
tree | 0c63c4d6db9195751d8b64c1980b0fe3a1237743 /tests/lint.scm | |
parent | 15e57f576291d9233ab25e1614c6218579db170a (diff) | |
download | guix-891a843d5184f696618af6fcbb9791ef6b574504.tar guix-891a843d5184f696618af6fcbb9791ef6b574504.tar.gz |
guix: Add lint-checker for packages which should be no inputs at all.
Also refactor some common code into a new function.
Examples for these pacakges are python(2)-setuptools and python(2)-pip, which
are installed together with python itself.
* guix/scripts/lint.scm (warn-if-package-has-input): New procedure.
(check-inputs-should-be-native package): Use it; rename and clean-up
variables. (check-inputs-should-not-be-an-input-at-all): New procedure.
(%checkers) Add it.
* doc/guix.texi (Python Modules): Document it.
* tests/lint.scm: ("inputs: python-setuptools should not be an input at all
(input)", "inputs: python-setuptools should not be an input at all
(native-input)" "inputs: python-setuptools should not be an input at all
(propagated-input)"): Add tests.
Diffstat (limited to 'tests/lint.scm')
-rw-r--r-- | tests/lint.scm | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/lint.scm b/tests/lint.scm index fa2d19b2a6..b66cd29312 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2014, 2015, 2016 Eric Bavier <bavier@member.fsf.org> ;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org> +;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -33,6 +34,7 @@ #:use-module (gnu packages) #:use-module (gnu packages glib) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) #:use-module (web server) #:use-module (web server http) #:use-module (web response) @@ -354,6 +356,38 @@ string) on HTTP requests." (check-inputs-should-be-native pkg))) "'glib:bin' should probably be a native input"))) +(test-assert + "inputs: python-setuptools should not be an input at all (input)" + (->bool + (string-contains + (with-warnings + (let ((pkg (dummy-package "x" + (inputs `(("python-setuptools" ,python-setuptools)))))) + (check-inputs-should-not-be-an-input-at-all pkg))) + "'python-setuptools' should probably not be an input at all"))) + +(test-assert + "inputs: python-setuptools should not be an input at all (native-input)" + (->bool + (string-contains + (with-warnings + (let ((pkg (dummy-package "x" + (native-inputs + `(("python-setuptools" ,python-setuptools)))))) + (check-inputs-should-not-be-an-input-at-all pkg))) + "'python-setuptools' should probably not be an input at all"))) + +(test-assert + "inputs: python-setuptools should not be an input at all (propagated-input)" + (->bool + (string-contains + (with-warnings + (let ((pkg (dummy-package "x" + (propagated-inputs + `(("python-setuptools" ,python-setuptools)))))) + (check-inputs-should-not-be-an-input-at-all pkg))) + "'python-setuptools' should probably not be an input at all"))) + (test-assert "patches: file names" (->bool (string-contains |