[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#69980] [PATCH python-team v3 12/14] gnu: pre-commit: Update to 3.7.
From: |
Nicolas Graves |
Subject: |
[bug#69980] [PATCH python-team v3 12/14] gnu: pre-commit: Update to 3.7.1. |
Date: |
Sat, 1 Jun 2024 16:58:00 +0200 |
From: Vinicius Monego <monego@posteo.net>
* gnu/packages/version-control.scm (pre-commit): Update to 3.7.1.
[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 | 90 +++++++++++++-------------------
1 file changed, 35 insertions(+), 55 deletions(-)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index c70f1209c42..0016c5bc9b6 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -29,7 +29,7 @@
;;; Copyright © 2020, 2021 Brice Waegeneire <brice@waegenei.re>
;;; Copyright © 2020 John D. Boy <jboy@bius.moe>
;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
-;;; Copyright © 2020, 2021, 2022, 2023 Vinicius Monego <monego@posteo.net>
+;;; Copyright © 2020, 2021, 2022, 2023, 2024 Vinicius Monego
<monego@posteo.net>
;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
;;; Copyright © 2020, 2021, 2022 Michael Rohleder <mike@rohleder.de>
;;; Copyright © 2021 Greg Hogan <code@greghogan.com>
@@ -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.7.1")
(source
(origin
(method git-fetch) ; no tests in PyPI release
@@ -2023,64 +2023,44 @@ (define-public pre-commit
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "1spkg3ld3s6l7wz24lcywlf1z2ywp751bcdlxjfdsln76bi9ylp8"))
+ (base32 "1m2cs21xq2j1x80s7bh47fm2nsbnfxgscxfijaqwdsi2rrf4vlzv"))
(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
(list git-minimal
python-covdefaults
--
2.41.0
- [bug#69980] [PATCH python-team v3 02/14] gnu: python-traitlets: Remove pre-commit from native-inputs., (continued)
- [bug#69980] [PATCH python-team v3 02/14] gnu: python-traitlets: Remove pre-commit from native-inputs., Nicolas Graves, 2024/06/01
- [bug#69980] [PATCH python-team v3 03/14] gnu: python-rich-click: Remove pre-commit from native-inputs., Nicolas Graves, 2024/06/01
- [bug#69980] [PATCH python-team v3 04/14] gnu: python-lazy-loader: Remove pre-commit from native-inputs., Nicolas Graves, 2024/06/01
- [bug#69980] [PATCH python-team v3 05/14] gnu: python-omnipath: Remove pre-commit from native-inputs., Nicolas Graves, 2024/06/01
- [bug#69980] [PATCH python-team v3 06/14] gnu: python-jupytext: Remove pre-commit from native-inputs., Nicolas Graves, 2024/06/01
- [bug#69980] [PATCH python-team v3 07/14] gnu: python-seaborn: Remove pre-commit from native-inputs., Nicolas Graves, 2024/06/01
- [bug#69980] [PATCH python-team v3 08/14] gnu: python-cfgv: Update to 3.4.0., Nicolas Graves, 2024/06/01
- [bug#69980] [PATCH python-team v3 09/14] gnu: Add python-ukkonen., Nicolas Graves, 2024/06/01
- [bug#69980] [PATCH python-team v3 11/14] gnu: python-nodeenv: Update to 1.8.0., Nicolas Graves, 2024/06/01
- [bug#69980] [PATCH python-team v3 10/14] gnu: python-identify: Update to 2.5.36., Nicolas Graves, 2024/06/01
- [bug#69980] [PATCH python-team v3 12/14] gnu: pre-commit: Update to 3.7.1.,
Nicolas Graves <=
- [bug#69980] [PATCH python-team v3 13/14] gnu: python-jupytext: Move to pyproject-build-system., Nicolas Graves, 2024/06/01
- [bug#69980] [PATCH python-team v3 14/14] gnu: jupytext: Fix pre-commit native-input removal., Nicolas Graves, 2024/06/01