From patchwork Sun Mar 24 13:40:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vinicius Monego X-Patchwork-Id: 62225 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 6432527BBEC; Sun, 24 Mar 2024 13:55:48 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 4DB0D27BBE2 for ; Sun, 24 Mar 2024 13:55:46 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1roOJm-0005Od-LT; Sun, 24 Mar 2024 09:55:22 -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 1roOJl-0005OS-Hi for guix-patches@gnu.org; Sun, 24 Mar 2024 09:55:21 -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 1roOJl-0002yo-9g for guix-patches@gnu.org; Sun, 24 Mar 2024 09:55:21 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1roOKR-000459-2N for guix-patches@gnu.org; Sun, 24 Mar 2024 09:56:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69980] [PATCH 13/13] gnu: pre-commit: Update to 3.6.2. Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 24 Mar 2024 13:56:03 +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 Received: via spool by 69980-submit@debbugs.gnu.org id=B69980.171128852014253 (code B ref 69980); Sun, 24 Mar 2024 13:56:03 +0000 Received: (at 69980) by debbugs.gnu.org; 24 Mar 2024 13:55:20 +0000 Received: from localhost ([127.0.0.1]:60183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1roOJi-0003hg-LC for submit@debbugs.gnu.org; Sun, 24 Mar 2024 09:55:20 -0400 Received: from mout02.posteo.de ([185.67.36.66]:33571) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1roO7d-000348-6v for 69980@debbugs.gnu.org; Sun, 24 Mar 2024 09:42:50 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 897D2240101 for <69980@debbugs.gnu.org>; Sun, 24 Mar 2024 14:42:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1711287721; bh=eB7bONurmxxWPIX9TF9rmORYfvPFnBqXAhqpiW8xz3g=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=eMKuWjm2UGVpyPHFK7WMoLFcZEb55KpG1+IvvvoeKNcnvE7KIhTDqnnwBMAG/0O+w Q7eJHVrGhmr0QVFHrrrcXokVRl4D4yG2ULguylMSMix1jN2DGzgtOdcvE5sLJFIh23 L+6x/M9C7CjWEJrERn+UAru21t8m+kTGfmlY7oVdE6zrRyBO2U5fMPEUNjOdv27p8c 8a5lXtQ3V4uXfnyorzbyd422jUv1Ri4ne+Gd8uCBFgMX6izJvZPLYHx9swbEHirAQO gTPnRQsDycuR4Z6PkYnxvR5CsQUumD/UvnHO8ABf3oxAiaa+sCE4P0uyAN3ISAYgAT zssA/YheMjV/A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4V2cgD5gSMz6txx; Sun, 24 Mar 2024 14:42:00 +0100 (CET) From: Vinicius Monego Date: Sun, 24 Mar 2024 13:40:38 +0000 Message-Id: <923daa675a7cbc414ebc2e4032044ba8b9fb2f37.1711287459.git.monego@posteo.net> In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 946b1f5aac..1fc3c7274e 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 @@ -1987,7 +1987,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 @@ -1996,73 +1996,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