summaryrefslogtreecommitdiff
path: root/dev-vcs/pre-commit
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-10-30 03:02:28 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-10-30 03:02:28 +0000
commitb77e1a6cc7c668e135d139c5ec5ad0ae1c11b857 (patch)
tree41574d961a9788fa95e2a789a408e1c6fc151bd9 /dev-vcs/pre-commit
parent009897642a869d630779716efc51af1554f72867 (diff)
gentoo auto-resync : 30:10:2022 - 03:02:28
Diffstat (limited to 'dev-vcs/pre-commit')
-rw-r--r--dev-vcs/pre-commit/Manifest3
-rw-r--r--dev-vcs/pre-commit/files/pre-commit-2.20.0-no_toml.patch81
-rw-r--r--dev-vcs/pre-commit/pre-commit-2.20.0-r1.ebuild54
3 files changed, 138 insertions, 0 deletions
diff --git a/dev-vcs/pre-commit/Manifest b/dev-vcs/pre-commit/Manifest
index eba830d49063..40840a5bd592 100644
--- a/dev-vcs/pre-commit/Manifest
+++ b/dev-vcs/pre-commit/Manifest
@@ -1,3 +1,6 @@
+AUX pre-commit-2.20.0-no_toml.patch 2448 BLAKE2B 1f067b87826fe582b4b9afaf235ec25ff53eefb5b05b28edcc477c9a697e223df0bcda3330afc6ed868c5cdf0ca836da53c884901039c05a7cbd06cbd9e8e2a7 SHA512 7fbd1dcc0fae28d8265827def2ed73eccc65791912e6bd410c457d4c437a385991af9675107634be319ba5fe1521af3309d29f49e2bcc6dcdc091a2a28925beb
+DIST pre-commit-2.20.0.gh.tar.gz 266604 BLAKE2B 470f032e6d5bfcdd9ac8ba8f37d4323b601da0c82bcd524ffc575dc688fe81ad326a1f6a8ddd03da6e37130319ee40070c03d9789cd6e0e4b427a1d6e646416e SHA512 b1da558a0e5d8f2f655427089f1d0b11b01ad7513ece7a0b3b67c33529cf3584edba558c78704e6da6ca18876b1d6c0fa8698e01fd7c2439b8d4dc0a93961e52
DIST pre-commit-2.20.0.tar.gz 266604 BLAKE2B 470f032e6d5bfcdd9ac8ba8f37d4323b601da0c82bcd524ffc575dc688fe81ad326a1f6a8ddd03da6e37130319ee40070c03d9789cd6e0e4b427a1d6e646416e SHA512 b1da558a0e5d8f2f655427089f1d0b11b01ad7513ece7a0b3b67c33529cf3584edba558c78704e6da6ca18876b1d6c0fa8698e01fd7c2439b8d4dc0a93961e52
+EBUILD pre-commit-2.20.0-r1.ebuild 1622 BLAKE2B 81436933bc5a602e8c802652229112c78618d1ac67ecb8265d8f8986d6d338e11d7ab29726e6de0ac1458d640977caa865055009396961dd50ffd70f1c2dc602 SHA512 f63b39f52bd66dca9a54052a3db18585f26a9ab187a16ef6bb251ff88135de901f2d581dd5f0875f95ecf5be9b9f6d32ec8aa3dca7fe3ab31ea3e15d83def129
EBUILD pre-commit-2.20.0.ebuild 1598 BLAKE2B 3b12bd2c4b0813038c689ea053600bdca89409f34e86cad85dd6646dc8c0ed71689a4c1fbb7928a810b7f3543768d472e43173bca9311d05089b8b765de23335 SHA512 595a35b0592aa24a59568b2c146e6bd7fc96f42ab86a4f27f92cc8c069154387efe9469f89407c85dec340952fe6e6713f84f9e7636be25a445da90b0822986f
MISC metadata.xml 380 BLAKE2B 99842a97367e91700c6f714f427b7b3d4b7212c401abae5ab715dfaa724776f02fe250184a33504d3433bb58cd5679af59a32ec21a7e7432481160dab36a4d95 SHA512 45330930d1e58fc1de0fd0ba55cd488dee96579ceab3be5073b91ff8f4f2b9adefff533dbfa5b0e8b23fbb648d45c0b7b4073a1ec57b586600cc2bf6347e0bbb
diff --git a/dev-vcs/pre-commit/files/pre-commit-2.20.0-no_toml.patch b/dev-vcs/pre-commit/files/pre-commit-2.20.0-no_toml.patch
new file mode 100644
index 000000000000..f7f335c29e14
--- /dev/null
+++ b/dev-vcs/pre-commit/files/pre-commit-2.20.0-no_toml.patch
@@ -0,0 +1,81 @@
+Backported upstream commit e703982de45ac64492897b25fa4edbdb8da10e62.
+
+--- a/pre_commit/languages/rust.py
++++ b/pre_commit/languages/rust.py
+@@ -5,8 +5,6 @@
+ from typing import Generator
+ from typing import Sequence
+
+-import toml
+-
+ import pre_commit.constants as C
+ from pre_commit.envcontext import envcontext
+ from pre_commit.envcontext import PatchesT
+@@ -38,18 +36,16 @@
+
+
+ def _add_dependencies(
+- cargo_toml_path: str,
++ prefix: Prefix,
+ additional_dependencies: set[str],
+ ) -> None:
+- with open(cargo_toml_path, 'r+') as f:
+- cargo_toml = toml.load(f)
+- cargo_toml.setdefault('dependencies', {})
+- for dep in additional_dependencies:
+- name, _, spec = dep.partition(':')
+- cargo_toml['dependencies'][name] = spec or '*'
+- f.seek(0)
+- toml.dump(cargo_toml, f)
+- f.truncate()
++ crates = []
++ for dep in additional_dependencies:
++ name, _, spec = dep.partition(':')
++ crate = f'{name}@{spec or "*"}'
++ crates.append(crate)
++
++ helpers.run_setup_cmd(prefix, ('cargo', 'add', *crates))
+
+
+ def install_environment(
+@@ -77,9 +73,6 @@
+ }
+ lib_deps = set(additional_dependencies) - cli_deps
+
+- if len(lib_deps) > 0:
+- _add_dependencies(prefix.path('Cargo.toml'), lib_deps)
+-
+ with clean_path_on_failure(directory):
+ packages_to_install: set[tuple[str, ...]] = {('--path', '.')}
+ for cli_dep in cli_deps:
+@@ -90,6 +83,9 @@
+ else:
+ packages_to_install.add((package,))
+
++ if len(lib_deps) > 0:
++ _add_dependencies(prefix, lib_deps)
++
+ for args in packages_to_install:
+ cmd_output_b(
+ 'cargo', 'install', '--bins', '--root', directory, *args,
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -27,7 +27,6 @@
+ identify>=1.0.0
+ nodeenv>=0.11.1
+ pyyaml>=5.1
+- toml
+ virtualenv>=20.0.8
+ importlib-metadata;python_version<"3.8"
+ python_requires = >=3.7
+--- a/tests/repository_test.py
++++ b/tests/repository_test.py
+@@ -485,7 +485,7 @@
+ path = make_repo(tempdir_factory, 'rust_hooks_repo')
+ config = make_config_from_repo(path)
+ # A small rust package with no dependencies.
+- deps = ['shellharden:3.1.0']
++ deps = ['shellharden:3.1.0', 'git-version']
+ config['hooks'][0]['additional_dependencies'] = deps
+ hook = _get_hook(config, store, 'rust-hook')
+ binaries = os.listdir(
diff --git a/dev-vcs/pre-commit/pre-commit-2.20.0-r1.ebuild b/dev-vcs/pre-commit/pre-commit-2.20.0-r1.ebuild
new file mode 100644
index 000000000000..5c803594ede5
--- /dev/null
+++ b/dev-vcs/pre-commit/pre-commit-2.20.0-r1.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..11} )
+DISTUTILS_SINGLE_IMPL=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_REQ_USE="sqlite"
+
+inherit distutils-r1
+
+DESCRIPTION="A framework for managing and maintaining multi-language Git pre-commit hooks"
+HOMEPAGE="https://pre-commit.com/"
+SRC_URI="https://github.com/${PN}/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~x86"
+
+RDEPEND="dev-vcs/git
+ $(python_gen_cond_dep '
+ >=dev-python/cfgv-2.0.0[${PYTHON_USEDEP}]
+ >=dev-python/identify-1.0.0[${PYTHON_USEDEP}]
+ >=dev-python/nodeenv-0.11.1[${PYTHON_USEDEP}]
+ >=dev-python/pyyaml-5.1[${PYTHON_USEDEP}]
+ >=dev-python/virtualenv-20.0.8[${PYTHON_USEDEP}]
+ ')"
+BDEPEND="test? (
+ $(python_gen_cond_dep '
+ dev-python/pytest-env[${PYTHON_USEDEP}]
+ dev-python/re-assert[${PYTHON_USEDEP}]
+ ')
+)"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.20.0-no_toml.patch
+)
+
+DOCS=( CHANGELOG.md CONTRIBUTING.md README.md )
+
+# The former two require a boatload of dependencies (e.g. Conda, Go, R and more) in order to run
+# and while some of them do include "skip if not found" logic, most of them do not.
+# The latter consistently fail with
+# Calling "git rev-parse" fails with "fatal: not a git repository (or any of the parent directories): .git".
+# including with the sandbox disabled and when run manually with tox.
+EPYTEST_DESELECT=(
+ tests/languages/
+ tests/repository_test.py
+ tests/main_test.py::test_all_cmds
+ tests/main_test.py::test_try_repo
+)
+
+distutils_enable_tests pytest