From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id cHBRMjrOGl/+egAA0tVLHw (envelope-from ) for ; Fri, 24 Jul 2020 12:04:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id g3n/LTrOGl9YQwAAbx9fmQ (envelope-from ) for ; Fri, 24 Jul 2020 12:04:10 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3EC2D940214 for ; Fri, 24 Jul 2020 12:04:10 +0000 (UTC) Received: from localhost ([::1]:40612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jywQr-0002pq-7q for larch@yhetil.org; Fri, 24 Jul 2020 08:04:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jywQk-0002pY-Sx for guix-patches@gnu.org; Fri, 24 Jul 2020 08:04:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35528) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jywQk-0006Ji-JM for guix-patches@gnu.org; Fri, 24 Jul 2020 08:04:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jywQk-0003e8-FS for guix-patches@gnu.org; Fri, 24 Jul 2020 08:04:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42082] [PATCH v2 6/6] gnu: Add python-pre-commit. Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 24 Jul 2020 12:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42082 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42082@debbugs.gnu.org Cc: Vinicius Monego X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159559218513953 (code B ref -1); Fri, 24 Jul 2020 12:04:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 Jul 2020 12:03:05 +0000 Received: from localhost ([127.0.0.1]:47069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jywPi-0003c3-S3 for submit@debbugs.gnu.org; Fri, 24 Jul 2020 08:03:05 -0400 Received: from lists.gnu.org ([209.51.188.17]:55206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jywPg-0003bu-S9 for submit@debbugs.gnu.org; Fri, 24 Jul 2020 08:02:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jywPg-0002J7-M1 for guix-patches@gnu.org; Fri, 24 Jul 2020 08:02:56 -0400 Received: from mout02.posteo.de ([185.67.36.66]:58525) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jywPe-0006AR-Ff for guix-patches@gnu.org; Fri, 24 Jul 2020 08:02:56 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id D5D952400FB for ; Fri, 24 Jul 2020 14:02:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1595592172; bh=HktnKWZwQtcDuPeuHWXmziwSAZ46Sd4UnEvs/YQJfXQ=; h=From:To:Cc:Subject:Date:From; b=KUAqDmPCiLaRbECuKG0/5eitTcJGtic2Tk96ZemQl+YcStv01KtnjTcyoqQRCj1Nc KGb45jAn5lF0LaqkaVdwzhDF86ibVNJFTkxxTc2pmtnZo3Kkyvw+RK/8JgS/PzzDoC AEzB/LOXq9BeKOkhULb0gzrbM2yvR/YQcp8s20jUUfpZ+lNjtwyjhXDty850IwlROk 3PM6GwI48oQWbXZwDRORVpDj7ukJhJqel/KM1lDGwTmEwUiivQ32vmns4zAYtp8xqT KTGJ66+LPMKJrGWv8K/u2d4p4pPU+IieWqJhukq9+eqoSgVAU0t8a8CBcRfSN4t3xq uAZwmQ5GCguqw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4BCnrq4TH5z9rxG; Fri, 24 Jul 2020 14:02:51 +0200 (CEST) From: Vinicius Monego Date: Fri, 24 Jul 2020 09:01:44 -0300 Message-Id: <20200724120144.500-6-monego@posteo.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724120144.500-1-monego@posteo.net> References: <20200627154645.64264-1-monego@posteo.net> <20200724120144.500-1-monego@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=185.67.36.66; envelope-from=monego@posteo.net; helo=mout02.posteo.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/24 06:47:42 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -0.0 (/) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=posteo.net header.s=2017 header.b=KUAqDmPC; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 1.09 X-TUID: C4nxmn+/Mhn6 * gnu/packages/version-control.scm (pre-commit): New variable. --- Enable tests. Update to 2.6.0. Language tests require interpreters/compilers and build systems as inputs and downloading packages online (e.g. 'go get'), hence disabled. gnu/packages/version-control.scm | 113 +++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 5151e63ee1..d36b7c013e 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -29,6 +29,7 @@ ;;; Copyright © 2020 Brice Waegeneire ;;; Copyright © 2020 John D. Boy ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2020 Vinicius Monego ;;; ;;; This file is part of GNU Guix. ;;; @@ -1418,6 +1419,118 @@ also walk each side of a merge and test those changes individually.") control to Git repositories.") (license license:gpl2))) +(define-public pre-commit + (package + (name "pre-commit") + (version "2.6.0") + (source + (origin + ;; No tests in the PyPI tarball. + (method git-fetch) + (uri (git-reference + (url "https://github.com/pre-commit/pre-commit") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "144hcnz8vz07nkx7hk8a3ac822186ardwxa8jnl6s8qvm5ip92f2")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'check 'set-up-git + (lambda _ + ;; Change from /homeless-shelter to /tmp for write permission. + (setenv "HOME" "/tmp") + ;; Environment variables used in the tests. + (setenv "GIT_AUTHOR_NAME" "Your Name") + (setenv "GIT_COMMITTER_NAME" "Your Name") + (setenv "GIT_AUTHOR_EMAIL" "you@example.com") + (setenv "GIT_COMMITTER_EMAIL" "you@example.com") + (invoke "git" "config" "--global" "user.name" "Your Name") + (invoke "git" "config" "--global" "user.email" "you@example.com") + #t)) + (replace 'check + (lambda* (#:key inputs outputs #:allow-other-keys) + (add-installed-pythonpath inputs outputs) + (invoke "pytest" "tests" "-k" + (string-append + ;; Disable conda tests. + "not test_conda_hook" + " and not test_conda_with_additional_dependencies_hook" + " and not test_local_conda_additional_dependencies" + ;; Disable cpan tests. + " and not test_local_perl_additional_dependencies" + " and not test_perl_hook" + ;; Disable Ruby tests. + " and not test_additional_ruby_dependencies_installed" + " and not test_install_rbenv" + " and not test_install_rbenv_with_version" + " and not test_run_a_ruby_hook" + " and not test_run_ruby_hook_with_disable_shared_gems" + " and not test_run_versioned_ruby_hook" + ;; Disable Cargo tests + " and not test_additional_rust_cli_dependencies_installed" + " and not test_additional_rust_lib_dependencies_installed" + " and not test_local_rust_additional_dependencies" + " and not test_rust_hook" + ;; Disable python2 test. + " and not test_switch_language_versions_doesnt_clobber" + ;; These tests try to open a network socket. + " and not test_additional_golang_dependencies_installed" + " and not test_additional_node_dependencies_installed" + " and not test_golang_hook" + " and not test_golang_hook_still_works_when_gobin_is_set" + " and not test_local_golang_additional_dependencies" + " and not test_main" + " and not test_node_hook_with_npm_userconfig_set" + " and not test_run_a_node_hook" + " and not test_run_versioned_node_hook" + ;; Tests failing with a permission error. + ;; They try to write to the filesystem. + " and not test_autoupdate_hook_disappearing_repo" + " and not test_hook_disppearing_repo_raises" + " and not test_img_conflict" + " and not test_img_something_unstaged" + " and not test_installed_from_venv" + " and not test_too_new_version" + " and not test_try_repo_uncommitted_changes" + " and not test_versions_ok" + ;; This test tries to activate a virtualenv + " and not test_healthy_venv_creator" + ;; Fatal error: Not a Git repository. + " and not test_all_cmds" + " and not test_try_repo" + ;; No module named 'pip._internal.cli.main' + " and not test_additional_dependencies_roll_forward" + ; Assertion errors + " and not test_install_existing_hooks_no_overwrite" + " and not test_uninstall_restores_legacy_hooks")))) + (add-before 'reset-gzip-timestamps 'make-files-writable + (lambda* (#:key outputs #:allow-other-keys) + ;; Make sure .gz files are writable so that the + ;; 'reset-gzip-timestamps' phase can do its work. + (let ((out (assoc-ref outputs "out"))) + (for-each make-file-writable + (find-files out "\\.gz$")) + #t)))))) + (native-inputs + `(("git" ,git) + ("python-pytest" ,python-pytest))) + (inputs + `(("python-cfgv" ,python-cfgv) + ("python-identify" ,python-identify) + ("python-nodeenv" ,python-nodeenv) + ("python-pyyaml" ,python-pyyaml) + ("python-toml" ,python-toml) + ("python-virtualenv" ,python-virtualenv))) + (home-page "https://pre-commit.com/") + (synopsis "Framework for managing and maintaining multi-language pre-commit hooks") + (description + "Pre-commit is a multi-language package manager for pre-commit hooks. You +specify a list of hooks you want and pre-commit manages the installation and +execution of any hook written in any language before every commit.") + (license license:expat))) + (define (mercurial-patch name revision hash) (origin (method url-fetch) -- 2.20.1