From patchwork Thu May 9 14:47:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 27221 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B865C27BBEC; Thu, 9 May 2024 15:51:28 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DCDC727BBEA for ; Thu, 9 May 2024 15:51:25 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s556a-0005Kd-Ny; Thu, 09 May 2024 10:50:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s556Y-0005JT-Fz for guix-patches@gnu.org; Thu, 09 May 2024 10:50:42 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s556Y-0003H7-7i for guix-patches@gnu.org; Thu, 09 May 2024 10:50:42 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s556y-0003zK-7V for guix-patches@gnu.org; Thu, 09 May 2024 10:51:08 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69980] [PATCH v2 12/14] gnu: pre-commit: Update to 3.6.2. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 09 May 2024 14:51:08 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69980 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69980@debbugs.gnu.org Cc: Vinicius Monego , ngraves@ngraves.fr Received: via spool by 69980-submit@debbugs.gnu.org id=B69980.171526626715316 (code B ref 69980); Thu, 09 May 2024 14:51:08 +0000 Received: (at 69980) by debbugs.gnu.org; 9 May 2024 14:51:07 +0000 Received: from localhost ([127.0.0.1]:55730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s556v-0003yf-Em for submit@debbugs.gnu.org; Thu, 09 May 2024 10:51:06 -0400 Received: from 17.mo561.mail-out.ovh.net ([87.98.178.58]:56839) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s556r-0003xX-Dx for 69980@debbugs.gnu.org; Thu, 09 May 2024 10:51:04 -0400 Received: from director2.ghost.mail-out.ovh.net (unknown [10.108.2.55]) by mo561.mail-out.ovh.net (Postfix) with ESMTP id 4VZw161WtPz1FYq for <69980@debbugs.gnu.org>; Thu, 9 May 2024 14:50:34 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-rlnt2 (unknown [10.108.54.36]) by director2.ghost.mail-out.ovh.net (Postfix) with ESMTPS id D0A561FD9E; Thu, 9 May 2024 14:50:33 +0000 (UTC) Received: from ngraves.fr ([37.59.142.103]) by ghost-submission-6684bf9d7b-rlnt2 with ESMTPSA id srDqKbniPGbQ6AQAbHn/wg (envelope-from ); Thu, 09 May 2024 14:50:33 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-103G00562fa1bba-d740-4bda-983f-1caeb5200c12, 4E77A7C380F2C3133289A0A0A30E10E37D805B97) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.146.208 Date: Thu, 9 May 2024 16:47:11 +0200 Message-ID: <20240509144944.30385-13-ngraves@ngraves.fr> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240509144944.30385-1-ngraves@ngraves.fr> References: <20240509144944.30385-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 16337370598613508627 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrvdefvddgkedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepvdelleegfeefteelkeeugedvhfetvdeuffeihfektdeljeekudevlefgudefudelnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugeeirddvtdekpdefjedrheelrddugedvrddutdefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeeileelkedtseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedupdhmohguvgepshhmthhpohhuth 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: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Vinicius Monego * gnu/packages/version-control.scm (pre-commit): Update to 3.6.2. [build-system]: Use pyproject-build-system. [arguments]: Use G-Expressions. Do not override the check phase, skip the tests in #:test-flags instead. Don't make source tree writable in the prepare-check-env phase. [native-inputs]: Use the new style. Change-Id: I4a1c56ce0903d6aa185d65d39c03c9566a6cf0d9 --- gnu/packages/version-control.scm | 106 +++++++++++++------------------ 1 file changed, 43 insertions(+), 63 deletions(-) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 2567acd2afc..226bcd4ad63 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -29,7 +29,7 @@ ;;; Copyright © 2020, 2021 Brice Waegeneire ;;; Copyright © 2020 John D. Boy ;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen -;;; Copyright © 2020, 2021, 2022, 2023 Vinicius Monego +;;; Copyright © 2020, 2021, 2022, 2023, 2024 Vinicius Monego ;;; Copyright © 2020 Tanguy Le Carrour ;;; Copyright © 2020, 2021, 2022 Michael Rohleder ;;; Copyright © 2021 Greg Hogan @@ -2014,7 +2014,7 @@ (define-public gitile (define-public pre-commit (package (name "pre-commit") ;formerly known as python-pre-commit - (version "3.3.3") + (version "3.6.2") (source (origin (method git-fetch) ; no tests in PyPI release @@ -2023,73 +2023,53 @@ (define-public pre-commit (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "1spkg3ld3s6l7wz24lcywlf1z2ywp751bcdlxjfdsln76bi9ylp8")) + (base32 "01b8mphyvm961n8hsk4ajqqgm5vwkr2kbi837s231bablnhs8ldf")) (modules '((guix build utils))) (snippet '(substitute* "setup.cfg" (("virtualenv>=20.10.0") ;our virtualenv (20.3.1) is fine "virtualenv>=20.0.8"))))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - (add-before 'check 'prepare-check-env - (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") - ;; 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"))) - (replace 'check - (lambda* (#:key inputs outputs tests? #:allow-other-keys) - (add-installed-pythonpath inputs outputs) - (when tests? - ;; The file below contains 30+ tests that fail because they - ;; depend on tools from multiple languages (cargo, npm, cpan, - ;; Rscript, etc). Other tests are passing, but it's more - ;; convenient to skip the 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" - ;; Skip lang-specific (network) tests added in 3.1.1 - "--ignore=tests/languages/conda_test.py" - "--ignore=tests/languages/coursier_test.py" - "--ignore=tests/languages/dart_test.py" - "--ignore=tests/languages/docker_test.py" - "--ignore=tests/languages/docker_image_test.py" - "--ignore=tests/languages/dotnet_test.py" - "--ignore=tests/languages/golang_test.py" - "--ignore=tests/languages/lua_test.py" - "--ignore=tests/languages/perl_test.py" - "--ignore=tests/languages/rust_test.py" - "--ignore=tests/languages/swift_test.py" - "-k" - (string-append - ;; 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" - " and not test_healthy_venv_creator" - " and not test_r_hook and not test_r_inline")))))))) + (list + ;; Skip language-specific tests because they depennd on language tools. + #:test-flags + #~(list "--ignore" "tests/languages" + ;; These fail with AssertionError. + "-k" (string-append + "not test_additional_dependencies_roll_forward" + " and not test_control_c_control_c_on_install" + " and not test_invalidated_virtualenv" + " and not test_local_python_repo" + " and not test_install_existing_hooks_no_overwrite" + " and not test_uninstall_restores_legacy_hooks" + " and not test_installed_from_venv")) + #:phases + #~(modify-phases %standard-phases + (add-before 'check 'prepare-check-env + (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") + ;; 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")))))) (native-inputs - `(("git" ,git-minimal) - ("python-covdefaults" ,python-covdefaults) - ("python-coverage" ,python-coverage) - ("python-distlib" ,python-distlib) - ("python-pytest" ,python-pytest) - ("python-pytest-env" ,python-pytest-env) - ("python-re-assert" ,python-re-assert) - ("which" ,which))) + (list git-minimal + python-covdefaults + python-coverage + python-distlib + python-pytest + python-pytest-env + python-re-assert + which)) ;; Propagate because pre-commit is also used as a module. (propagated-inputs (list python-cfgv