From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id mAh9MjBQkWCWCQEAgWs5BA (envelope-from ) for ; Tue, 04 May 2021 15:46:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id WGUtLjBQkWA+fgAAB5/wlQ (envelope-from ) for ; Tue, 04 May 2021 13:46:24 +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 50BA4178FC for ; Tue, 4 May 2021 15:46:22 +0200 (CEST) Received: from localhost ([::1]:44664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldvNU-00058J-Sk for larch@yhetil.org; Tue, 04 May 2021 09:46:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldvNC-00056k-3P for guix-patches@gnu.org; Tue, 04 May 2021 09:46:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41771) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldvNB-00013j-Ri for guix-patches@gnu.org; Tue, 04 May 2021 09:46:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ldvNB-0007vy-Q5 for guix-patches@gnu.org; Tue, 04 May 2021 09:46:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48226] [PATCH] gnu: pre-commit: Update to 2.12.1. Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 04 May 2021 13:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48226 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48226@debbugs.gnu.org Cc: Vinicius Monego X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.162013592030486 (code B ref -1); Tue, 04 May 2021 13:46:01 +0000 Received: (at submit) by debbugs.gnu.org; 4 May 2021 13:45:20 +0000 Received: from localhost ([127.0.0.1]:53314 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldvMM-0007vc-Ui for submit@debbugs.gnu.org; Tue, 04 May 2021 09:45:20 -0400 Received: from lists.gnu.org ([209.51.188.17]:44930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldvMF-0007vS-D6 for submit@debbugs.gnu.org; Tue, 04 May 2021 09:45:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldvMF-0004S9-3A for guix-patches@gnu.org; Tue, 04 May 2021 09:45:03 -0400 Received: from mout01.posteo.de ([185.67.36.65]:38105) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldvM3-0000Ge-Pp for guix-patches@gnu.org; Tue, 04 May 2021 09:45:02 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 75B1C240028 for ; Tue, 4 May 2021 15:44:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1620135886; bh=5ry9KGyMMr0fi1BWlKMmt/BU4Aosipf4i2pUalpNfMs=; h=From:To:Cc:Subject:Date:From; b=BJPVqhSfBKOEeyZIeO7AXf9/gE3mlSAb5Vr3wy1rulE9sr1ocE2EFpGgSNUJuC1DT zSdbVuEr6PdHubZoEWgu8au/Zr+Q7I1JgKln0GtX8O2Jsabeg5OpNFC5gkW9R5vxWq CJA6vE9oYb3OGu29BqSYzrxSv6XNNZoMS6o+q0Crx70wawWZdvSd50lJnyY0Yiq+bG 5qDb2OTqY+PEWwtggvct651WStwhYsfjLMHbMOCpJhQIDHIwI3m9fMBZ8Yks1ur0c5 RIkXyxS6zuw8RvcA+C59K0kGsP5t3h1+z8JoUFnrcX6bFODtiDQ0ELcs+jVh+nIBwM sxqfUcsHjTy4A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FZLgJ3pl4z9rxL; Tue, 4 May 2021 15:44:44 +0200 (CEST) From: Vinicius Monego Date: Tue, 4 May 2021 13:44:28 +0000 Message-Id: <20210504134428.331526-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.65; envelope-from=monego@posteo.net; helo=mout01.posteo.de 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.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620135982; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=psrrykP9cmTmOgZJa/O2ZfylLe+NI4blBC9zW2FcLlA=; b=IeAJcYzOIDCkQkkjHtIW8b8hZdZ8Ij00VK+PkzLNLRQKYQJT5T2RW310WI8HRoALApX6CL Kb8iEESrZ/geqT2eD8Zn8QBZhPAWOKz/rBkbss+FQeCMf2CvZMWEPfms3ssW5xy7/lkIrI Rh0vFQIdmXqRkgozfHO65AILMc3/SonanO3Old2W7SH3nbBp+0sfm4nKazXIVY2phA5E5e FZt65aaKu0EnyUykCAzaodEnIQ/Ae95O/DQ6F/e415WPY3P4nfbsd0CgFLOVsPSgWTMtQS 3hjvtbMR2BpvJer3sRA1UlLhr8pTbFlpckE4giDLcJBBjccYpZtpuXKjdEVEoQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620135982; a=rsa-sha256; cv=none; b=H6AQL7AY5PX+r4yG0XiHjVzQ5J6EiiSdDC7ClLycXBaY/GJGeOdIEN9Xrrp7DSHRR3CcEC IfU6MQjV+t0oTJyf2/y3hIUBCgEWK7BXHKOC4yPsixh1jhSuXkdF2yiJ+14d4txh0zpBJd 5ZGg7oStE88ndbYmNeYuc+KoqqUAghA65cbRPSnNyGJ5U04jqMSms0fe2yHIWTzXWoHcZ/ WTiZRAMqKzqpJGb+esG4Kkb3kvWzeLGUP3GWjnnyl+3Bhe2+fRRCGN0bEDgzDpe2yNE9r4 1X8qPTD2SuLMywLLRWyhFe98NEYWi/iq/1hgc5Zq8peNR+woOHPx+X5lKl2oMw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=BJPVqhSf; 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-Migadu-Spam-Score: -0.36 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=BJPVqhSf; 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-Migadu-Queue-Id: 50BA4178FC X-Spam-Score: -0.36 X-Migadu-Scanner: scn0.migadu.com X-TUID: QwhwEOTWLYWT * gnu/packages/version-control.scm (pre-commit): Update to 2.12.1. [arguments]: Simplify running tests. Make source tree writable and initialize a git repositoryy before check phase. [native-inputs]: Add python-covdefaults, python-coverage, python-distlib/next, python-pytest-env, which. Use git instead of git-minimal. --- gnu/packages/version-control.scm | 101 +++++++++++-------------------- 1 file changed, 35 insertions(+), 66 deletions(-) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 3992f74644..23b5ba41e2 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -29,7 +29,7 @@ ;;; Copyright © 2020 Brice Waegeneire ;;; Copyright © 2020 John D. Boy ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen -;;; Copyright © 2020 Vinicius Monego +;;; Copyright © 2020, 2021 Vinicius Monego ;;; Copyright © 2020 Tanguy Le Carrour ;;; Copyright © 2020 Michael Rohleder ;;; Copyright © 2021 Greg Hogan @@ -1505,7 +1505,7 @@ control to Git repositories.") (define-public pre-commit (package (name "pre-commit") - (version "2.8.1") + (version "2.12.1") (source (origin ;; No tests in the PyPI tarball. @@ -1515,12 +1515,12 @@ control to Git repositories.") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "0b3ks6viccq3n4p8i8zgfd40vp1k5nkhmmlz7p4nxcdizw8zxgn8")))) + (base32 "0gwy5bnjnlj6yjcmghsibrcijvz9isxcygln7ihvi728p04rgymf")))) (build-system python-build-system) (arguments `(#:phases (modify-phases %standard-phases - (add-before 'check 'set-up-git + (add-before 'check 'prepare-check-env (lambda _ ;; Change from /homeless-shelter to /tmp for write permission. (setenv "HOME" "/tmp") @@ -1529,72 +1529,36 @@ control to Git repositories.") (setenv "GIT_COMMITTER_NAME" "Your Name") (setenv "GIT_AUTHOR_EMAIL" "you@example.com") (setenv "GIT_COMMITTER_EMAIL" "you@example.com") + ;; Some tests still fail with PermissionError. Make the source + ;; tree writable. + (for-each make-file-writable (find-files ".")) + ;; Some tests will need a working git repository. + (invoke "git" "init") (invoke "git" "config" "--global" "user.name" "Your Name") (invoke "git" "config" "--global" "user.email" "you@example.com") - #t)) + #t)) (replace 'check (lambda* (#:key inputs outputs #:allow-other-keys) (add-installed-pythonpath inputs outputs) - (invoke "pytest" "tests" "-k" + ;; The file below contains about 30 tests that fail because they + ;; depend on tools from multiple languages (cargo, npm, cpan, + ;; Rscript, etc). There are other tests that pass, but it's more + ;; convenient to skip the whole file than list 30 tests to skip. + (invoke "pytest" "--ignore=tests/repository_test.py" + ;; Ruby and Node tests require node and gem. + "--ignore=tests/languages/node_test.py" + "--ignore=tests/languages/ruby_test.py" + ;; FIXME: Python tests fail because of distlib version + ;; mismatch. Even with python-distlib/next it is + ;; pulling version 0.3.0, while 0.3.1 is required. + "--ignore=tests/languages/python_test.py" "-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 dotnet tests. - " and not test_dotnet_hook" - ;; Disable nodejs tests. - " and not test_unhealthy_if_system_node_goes_missing" - " and not test_installs_without_links_outside_env" - " and not test_healthy_system_node" - ;; 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 + ;; TODO: these tests fail with AssertionError. It may + ;; be possible to fix them. + "not test_install_existing_hooks_no_overwrite" + " and not test_uninstall_restores_legacy_hooks" + " and not test_installed_from_venv")))) + (add-before 'reset-gzip-timestamps 'make-gz-writable (lambda* (#:key outputs #:allow-other-keys) ;; Make sure .gz files are writable so that the ;; 'reset-gzip-timestamps' phase can do its work. @@ -1603,9 +1567,14 @@ control to Git repositories.") (find-files out "\\.gz$")) #t)))))) (native-inputs - `(("git" ,git-minimal) + `(("git" ,git) + ("python-covdefaults" ,python-covdefaults) + ("python-coverage" ,python-coverage) + ("python-distlib" ,python-distlib/next) ("python-pytest" ,python-pytest) - ("python-re-assert" ,python-re-assert))) + ("python-pytest-env" ,python-pytest-env) + ("python-re-assert" ,python-re-assert) + ("which" ,which))) ;; Propagate because pre-commit is also used as a module. (propagated-inputs `(("python-cfgv" ,python-cfgv) -- 2.31.1