Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-vcs/pre-commit/
Date: Tue, 25 May 2021 12:31:15
Message-Id: 1621945858.601bee8634604f80b438ed706f46a45c97554ac1.marecki@gentoo
1 commit: 601bee8634604f80b438ed706f46a45c97554ac1
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 25 12:03:27 2021 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Tue May 25 12:30:58 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=601bee86
7
8 dev-vcs/pre-commit: add 2.13.0
9
10 Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
11
12 dev-vcs/pre-commit/Manifest | 1 +
13 dev-vcs/pre-commit/pre-commit-2.13.0.ebuild | 59 +++++++++++++++++++++++++++++
14 2 files changed, 60 insertions(+)
15
16 diff --git a/dev-vcs/pre-commit/Manifest b/dev-vcs/pre-commit/Manifest
17 index b94fd505fbe..6a58d3a08e1 100644
18 --- a/dev-vcs/pre-commit/Manifest
19 +++ b/dev-vcs/pre-commit/Manifest
20 @@ -1 +1,2 @@
21 DIST pre-commit-2.12.1.tar.gz 246313 BLAKE2B 45ee7c8217f88eeaa2e9eb11efd79291d6577134799b328f252bd4d4283c11754b36ffeedf045a5101c6edc8cdf330d566e404ae34f1a831a830e8e0346337e9 SHA512 6dbd804e1001276e6e8cea7c31b321a05798b38c59f37d5900317c3a9ceccf5103afcbdfd29f9438be3595a18ae15eb09dd222c91c439da47d7728a0e0a55c70
22 +DIST pre-commit-2.13.0.tar.gz 252631 BLAKE2B 7e6b3af46dfaf9928d2cb2aa6cad05423bf6e417e2324af71b241e1aaa2eec6fcb271869f98c040cd4fb8c608a1fabd244c8286864f469a06c44684cd2bf33eb SHA512 5dfc297b3f900afef8f1c355b38ce086af7c836d1e577af8ec95ffb30e82df8b866131da4ff12933339bda63e4a90833c3852265d4f2d4a59bf92bce2b972a5e
23
24 diff --git a/dev-vcs/pre-commit/pre-commit-2.13.0.ebuild b/dev-vcs/pre-commit/pre-commit-2.13.0.ebuild
25 new file mode 100644
26 index 00000000000..d2e6b60c37b
27 --- /dev/null
28 +++ b/dev-vcs/pre-commit/pre-commit-2.13.0.ebuild
29 @@ -0,0 +1,59 @@
30 +# Copyright 1999-2021 Gentoo Authors
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=7
34 +
35 +PYTHON_COMPAT=( python3_{8..9} )
36 +DISTUTILS_SINGLE_IMPL=1
37 +DISTUTILS_USE_SETUPTOOLS=rdepend
38 +PYTHON_REQ_USE="sqlite"
39 +
40 +inherit distutils-r1
41 +
42 +DESCRIPTION="A framework for managing and maintaining multi-language Git pre-commit hooks"
43 +HOMEPAGE="https://pre-commit.com/"
44 +SRC_URI="https://github.com/${PN}/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
45 +
46 +LICENSE="MIT"
47 +SLOT="0"
48 +KEYWORDS="~amd64"
49 +
50 +# TODO: figure out why these tests - all of which invoke git - fail:
51 +# - tests/main_test.py::test_all_cmds[autoupdate,hook-impl,install,install-hooks,migrate-config,run,uninstall],
52 +# tests/main_test.py::test_try_repo:
53 +# Calling "git rev-parse" fails with "fatal: not a git repository (or any of the parent directories): .git".
54 +# NOT a sandbox issue it seems, as disabling it does not help.
55 +# - tests/commands/install_uninstall_test.py::test_environment_not_sourced:
56 +# Unexpected error "/usr/bin/env: 'python3.8': No such file or directory" - but only if pre-commit
57 +# has previously been installed.
58 +# - tests/commands/install_uninstall_test.py::test_installed_from_venv:
59 +# the function invoking "git commit" returns 1 instead of 0, no details.
60 +RESTRICT="test"
61 +
62 +RDEPEND="dev-vcs/git
63 + $(python_gen_cond_dep '
64 + dev-python/cfgv[${PYTHON_USEDEP}]
65 + dev-python/identify[${PYTHON_USEDEP}]
66 + dev-python/nodeenv[${PYTHON_USEDEP}]
67 + dev-python/pyyaml[${PYTHON_USEDEP}]
68 + dev-python/toml[${PYTHON_USEDEP}]
69 + >=dev-python/virtualenv-20.0.8[${PYTHON_USEDEP}]
70 + ')"
71 +BDEPEND="test? (
72 + $(python_gen_cond_dep '
73 + dev-python/pytest-env[${PYTHON_USEDEP}]
74 + dev-python/re-assert[${PYTHON_USEDEP}]
75 + ')
76 +)"
77 +
78 +DOCS=( CHANGELOG.md CONTRIBUTING.md README.md )
79 +
80 +distutils_enable_tests --install pytest
81 +
82 +src_prepare() {
83 + default
84 +
85 + # These tests require a boatload of dependencies (e.g. Conda, Go, R and more) in order to run
86 + # and while some of them do include "skip if not found" logic, most of them do not.
87 + rm -rf tests/languages tests/repository_test.py
88 +}