diff options
| author | Vinicius Monego <monego@posteo.net> | 2024-06-01 16:58:00 +0200 |
|---|---|---|
| committer | Sharlatan Hellseher <sharlatanus@gmail.com> | 2024-12-13 20:28:43 +0000 |
| commit | e715096f0ee1b1f601b8f26f86ccd54f75d2fa8c (patch) | |
| tree | 2bc29be6ce2b2f35c40e1d1db99ec117872f4ca2 /gnu/packages/version-control.scm | |
| parent | cb6fec876ae77f3dcc9fec5bfe4bbf5cb95cfd35 (diff) | |
gnu: pre-commit: Update to 3.7.1.
* 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
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Diffstat (limited to 'gnu/packages/version-control.scm')
| -rw-r--r-- | gnu/packages/version-control.scm | 88 |
1 files changed, 34 insertions, 54 deletions
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index bd831bdb358..2a2e83c50fe 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm | |||
| @@ -2247,7 +2247,7 @@ visualize your public Git repositories on a web interface.") | |||
| 2247 | (define-public pre-commit | 2247 | (define-public pre-commit |
| 2248 | (package | 2248 | (package |
| 2249 | (name "pre-commit") ;formerly known as python-pre-commit | 2249 | (name "pre-commit") ;formerly known as python-pre-commit |
| 2250 | (version "3.3.3") | 2250 | (version "3.7.1") |
| 2251 | (source | 2251 | (source |
| 2252 | (origin | 2252 | (origin |
| 2253 | (method git-fetch) ; no tests in PyPI release | 2253 | (method git-fetch) ; no tests in PyPI release |
| @@ -2256,64 +2256,44 @@ visualize your public Git repositories on a web interface.") | |||
| 2256 | (commit (string-append "v" version)))) | 2256 | (commit (string-append "v" version)))) |
| 2257 | (file-name (git-file-name name version)) | 2257 | (file-name (git-file-name name version)) |
| 2258 | (sha256 | 2258 | (sha256 |
| 2259 | (base32 "1spkg3ld3s6l7wz24lcywlf1z2ywp751bcdlxjfdsln76bi9ylp8")) | 2259 | (base32 "1m2cs21xq2j1x80s7bh47fm2nsbnfxgscxfijaqwdsi2rrf4vlzv")) |
| 2260 | (modules '((guix build utils))) | 2260 | (modules '((guix build utils))) |
| 2261 | (snippet '(substitute* "setup.cfg" | 2261 | (snippet '(substitute* "setup.cfg" |
| 2262 | (("virtualenv>=20.10.0") ;our virtualenv (20.3.1) is fine | 2262 | (("virtualenv>=20.10.0") ;our virtualenv (20.3.1) is fine |
| 2263 | "virtualenv>=20.0.8"))))) | 2263 | "virtualenv>=20.0.8"))))) |
| 2264 | (build-system python-build-system) | 2264 | (build-system pyproject-build-system) |
| 2265 | (arguments | 2265 | (arguments |
| 2266 | `(#:phases | 2266 | (list |
| 2267 | (modify-phases %standard-phases | 2267 | ;; Skip language-specific tests because they depennd on language tools. |
| 2268 | (add-before 'check 'prepare-check-env | 2268 | #:test-flags |
| 2269 | (lambda _ | 2269 | #~(list "--ignore" "tests/languages" |
| 2270 | ;; Change from /homeless-shelter to /tmp for write permission. | 2270 | ;; These fail with AssertionError. |
| 2271 | (setenv "HOME" "/tmp") | 2271 | "-k" (string-append |
| 2272 | ;; Environment variables used in the tests. | 2272 | "not test_additional_dependencies_roll_forward" |
| 2273 | (setenv "GIT_AUTHOR_NAME" "Your Name") | 2273 | " and not test_control_c_control_c_on_install" |
| 2274 | (setenv "GIT_COMMITTER_NAME" "Your Name") | 2274 | " and not test_invalidated_virtualenv" |
| 2275 | (setenv "GIT_AUTHOR_EMAIL" "you@example.com") | 2275 | " and not test_local_python_repo" |
| 2276 | (setenv "GIT_COMMITTER_EMAIL" "you@example.com") | 2276 | " and not test_install_existing_hooks_no_overwrite" |
| 2277 | ;; Some tests still fail with PermissionError. Make the source | 2277 | " and not test_uninstall_restores_legacy_hooks" |
| 2278 | ;; tree writable. | 2278 | " and not test_installed_from_venv")) |
| 2279 | (for-each make-file-writable (find-files ".")) | 2279 | #:phases |
| 2280 | ;; Some tests will need a working git repository. | 2280 | #~(modify-phases %standard-phases |
| 2281 | (invoke "git" "init") | 2281 | (add-before 'check 'prepare-check-env |
| 2282 | (invoke "git" "config" "--global" "user.name" "Your Name") | 2282 | (lambda _ |
| 2283 | (invoke "git" "config" "--global" "user.email" "you@example.com"))) | 2283 | ;; Change from /homeless-shelter to /tmp for write permission. |
| 2284 | (replace 'check | 2284 | (setenv "HOME" "/tmp") |
| 2285 | (lambda* (#:key inputs outputs tests? #:allow-other-keys) | 2285 | ;; Environment variables used in the tests. |
| 2286 | (add-installed-pythonpath inputs outputs) | 2286 | (setenv "GIT_AUTHOR_NAME" "Your Name") |
| 2287 | (when tests? | 2287 | (setenv "GIT_COMMITTER_NAME" "Your Name") |
| 2288 | ;; The file below contains 30+ tests that fail because they | 2288 | (setenv "GIT_AUTHOR_EMAIL" "you@example.com") |
| 2289 | ;; depend on tools from multiple languages (cargo, npm, cpan, | 2289 | (setenv "GIT_COMMITTER_EMAIL" "you@example.com") |
| 2290 | ;; Rscript, etc). Other tests are passing, but it's more | 2290 | ;; Some tests still fail with PermissionError. Make the source |
| 2291 | ;; convenient to skip the file than list 30 tests to skip. | 2291 | ;; tree writable. |
| 2292 | (invoke "pytest" "--ignore=tests/repository_test.py" | 2292 | ;; (for-each make-file-writable (find-files ".")) |
| 2293 | ;; Ruby and Node tests require node and gem. | 2293 | ;; Some tests will need a working git repository. |
| 2294 | "--ignore=tests/languages/node_test.py" | 2294 | (invoke "git" "init") |
| 2295 | "--ignore=tests/languages/ruby_test.py" | 2295 | (invoke "git" "config" "--global" "user.name" "Your Name") |
| 2296 | ;; Skip lang-specific (network) tests added in 3.1.1 | 2296 | (invoke "git" "config" "--global" "user.email" "you@example.com")))))) |
| 2297 | "--ignore=tests/languages/conda_test.py" | ||
| 2298 | "--ignore=tests/languages/coursier_test.py" | ||
| 2299 | "--ignore=tests/languages/dart_test.py" | ||
| 2300 | "--ignore=tests/languages/docker_test.py" | ||
| 2301 | "--ignore=tests/languages/docker_image_test.py" | ||
| 2302 | "--ignore=tests/languages/dotnet_test.py" | ||
| 2303 | "--ignore=tests/languages/golang_test.py" | ||
| 2304 | "--ignore=tests/languages/lua_test.py" | ||
| 2305 | "--ignore=tests/languages/perl_test.py" | ||
| 2306 | "--ignore=tests/languages/rust_test.py" | ||
| 2307 | "--ignore=tests/languages/swift_test.py" | ||
| 2308 | "-k" | ||
| 2309 | (string-append | ||
| 2310 | ;; TODO: these tests fail with AssertionError. It may | ||
| 2311 | ;; be possible to fix them. | ||
| 2312 | "not test_install_existing_hooks_no_overwrite" | ||
| 2313 | " and not test_uninstall_restores_legacy_hooks" | ||
| 2314 | " and not test_installed_from_venv" | ||
| 2315 | " and not test_healthy_venv_creator" | ||
| 2316 | " and not test_r_hook and not test_r_inline")))))))) | ||
| 2317 | (native-inputs | 2297 | (native-inputs |
| 2318 | (list git-minimal | 2298 | (list git-minimal |
| 2319 | python-covdefaults | 2299 | python-covdefaults |
