GNU bug report logs - #48226
[PATCH] gnu: pre-commit: Update to 2.12.1.

Previous Next

Package: guix-patches;

Reported by: Vinicius Monego <monego <at> posteo.net>

Date: Tue, 4 May 2021 13:46:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 48226 in the body.
You can then email your comments to 48226 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#48226; Package guix-patches. (Tue, 04 May 2021 13:46:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vinicius Monego <monego <at> posteo.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 04 May 2021 13:46:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Vinicius Monego <monego <at> posteo.net>
To: guix-patches <at> gnu.org
Cc: Vinicius Monego <monego <at> posteo.net>
Subject: [PATCH] gnu: pre-commit: Update to 2.12.1.
Date: Tue,  4 May 2021 13:44:28 +0000
* 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 <brice <at> waegenei.re>
 ;;; Copyright © 2020 John D. Boy <jboy <at> bius.moe>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
-;;; Copyright © 2020 Vinicius Monego <monego <at> posteo.net>
+;;; Copyright © 2020, 2021 Vinicius Monego <monego <at> posteo.net>
 ;;; Copyright © 2020 Tanguy Le Carrour <tanguy <at> bioneland.org>
 ;;; Copyright © 2020 Michael Rohleder <mike <at> rohleder.de>
 ;;; Copyright © 2021 Greg Hogan <code <at> greghogan.com>
@@ -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 <at> example.com")
              (setenv "GIT_COMMITTER_EMAIL" "you <at> 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 <at> 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





Information forwarded to guix-patches <at> gnu.org:
bug#48226; Package guix-patches. (Tue, 11 May 2021 10:31:01 GMT) Full text and rfc822 format available.

Message #8 received at 48226 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Vinicius Monego <monego <at> posteo.net>
Cc: 48226 <at> debbugs.gnu.org
Subject: Re: bug#48226: [PATCH] gnu: pre-commit: Update to 2.12.1.
Date: Tue, 11 May 2021 12:30:15 +0200
Hi,

Vinicius Monego <monego <at> posteo.net> skribis:

> * 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.

What’s the reason to depend on ‘git’ rather than ‘git-minimal’?  (We
usually avoid that so packages don’t pull more than needed.)

Apart from that it LGTM.

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#48226; Package guix-patches. (Wed, 12 May 2021 06:41:01 GMT) Full text and rfc822 format available.

Message #11 received at 48226 <at> debbugs.gnu.org (full text, mbox):

From: Vinicius Monego <monego <at> posteo.net>
To: 48226 <at> debbugs.gnu.org
Cc: Vinicius Monego <monego <at> posteo.net>
Subject: [PATCH v2] gnu: pre-commit: Update to 2.12.1.
Date: Wed, 12 May 2021 06:39:25 +0000
* gnu/packages/version-control.scm (pre-commit): Update to 2.12.1.
[arguments]: Make source tree writable and initialize a git repository before
check phase. Simplify check phase.
[native-inputs]: Add python-covdefaults, python-coverage, python-distlib/next,
python-pytest-env, which.
---
Don't replace git-minimal. Reworded commit message.

 gnu/packages/version-control.scm | 99 +++++++++++---------------------
 1 file changed, 34 insertions(+), 65 deletions(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 0cad83c4b0..5e89de8450 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -29,7 +29,7 @@
 ;;; Copyright © 2020 Brice Waegeneire <brice <at> waegenei.re>
 ;;; Copyright © 2020 John D. Boy <jboy <at> bius.moe>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
-;;; Copyright © 2020 Vinicius Monego <monego <at> posteo.net>
+;;; Copyright © 2020, 2021 Vinicius Monego <monego <at> posteo.net>
 ;;; Copyright © 2020 Tanguy Le Carrour <tanguy <at> bioneland.org>
 ;;; Copyright © 2020, 2021 Michael Rohleder <mike <at> rohleder.de>
 ;;; Copyright © 2021 Greg Hogan <code <at> greghogan.com>
@@ -1518,7 +1518,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.
@@ -1528,12 +1528,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")
@@ -1542,72 +1542,36 @@ control to Git repositories.")
              (setenv "GIT_COMMITTER_NAME" "Your Name")
              (setenv "GIT_AUTHOR_EMAIL" "you <at> example.com")
              (setenv "GIT_COMMITTER_EMAIL" "you <at> 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 <at> 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.
@@ -1617,8 +1581,13 @@ control to Git repositories.")
                #t))))))
     (native-inputs
      `(("git" ,git-minimal)
+       ("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





Information forwarded to guix-patches <at> gnu.org:
bug#48226; Package guix-patches. (Wed, 12 May 2021 06:47:01 GMT) Full text and rfc822 format available.

Message #14 received at 48226 <at> debbugs.gnu.org (full text, mbox):

From: Vinicius Monego <monego <at> posteo.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 48226 <at> debbugs.gnu.org
Subject: Re: bug#48226: [PATCH] gnu: pre-commit: Update to 2.12.1.
Date: Wed, 12 May 2021 06:45:52 +0000
Ludovic Courtès writes:

> Hi,
>
> Vinicius Monego <monego <at> posteo.net> skribis:
>
>> * 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.
>
> What’s the reason to depend on ‘git’ rather than ‘git-minimal’?  (We
> usually avoid that so packages don’t pull more than needed.)

Hi Ludo,

I thought -minimal packages were there for internal use such as solving
bootstrapping issues. Full git is also more common as input in
gnu/packages. Pre-commit builds just fine with git-minimal though.

I sent a v2 without changing git-minimal and fixed the commit message.

>
> Apart from that it LGTM.
>
> Thanks,
> Ludo’.





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Wed, 12 May 2021 22:22:01 GMT) Full text and rfc822 format available.

Notification sent to Vinicius Monego <monego <at> posteo.net>:
bug acknowledged by developer. (Wed, 12 May 2021 22:22:01 GMT) Full text and rfc822 format available.

Message #19 received at 48226-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Vinicius Monego <monego <at> posteo.net>
Cc: 48226-done <at> debbugs.gnu.org
Subject: Re: bug#48226: [PATCH] gnu: pre-commit: Update to 2.12.1.
Date: Thu, 13 May 2021 00:21:02 +0200
Hi,

Vinicius Monego <monego <at> posteo.net> skribis:

> * gnu/packages/version-control.scm (pre-commit): Update to 2.12.1.
> [arguments]: Make source tree writable and initialize a git repository before
> check phase. Simplify check phase.
> [native-inputs]: Add python-covdefaults, python-coverage, python-distlib/next,
> python-pytest-env, which.
> ---
> Don't replace git-minimal. Reworded commit message.

Perfect.  Applied, thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 10 Jun 2021 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 319 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.