Toggle diff (139 lines)
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 <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.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
--
2.41.0