|
| 1 | +# Copyright 1999-2024 Gentoo Authors |
| 2 | +# Distributed under the terms of the GNU General Public License v2 |
| 3 | + |
| 4 | +EAPI=8 |
| 5 | + |
| 6 | +PYTHON_COMPAT=( python3_{11..12} ) |
| 7 | +DISTUTILS_SINGLE_IMPL=1 |
| 8 | +DISTUTILS_USE_PEP517=setuptools |
| 9 | +PYTHON_REQ_USE="sqlite" |
| 10 | + |
| 11 | +inherit distutils-r1 |
| 12 | + |
| 13 | +DESCRIPTION="A framework for managing and maintaining multi-language Git pre-commit hooks" |
| 14 | +HOMEPAGE="https://pre-commit.com/" |
| 15 | +SRC_URI="https://github.com/${PN}/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz" |
| 16 | + |
| 17 | +LICENSE="MIT" |
| 18 | +SLOT="0" |
| 19 | +KEYWORDS="amd64 arm arm64 x86" |
| 20 | + |
| 21 | +RDEPEND="dev-vcs/git |
| 22 | + $(python_gen_cond_dep ' |
| 23 | + >=dev-python/cfgv-2.0.0[${PYTHON_USEDEP}] |
| 24 | + >=dev-python/identify-1.0.0[${PYTHON_USEDEP}] |
| 25 | + >=dev-python/nodeenv-0.11.1[${PYTHON_USEDEP}] |
| 26 | + >=dev-python/pyyaml-5.1[${PYTHON_USEDEP}] |
| 27 | + >=dev-python/virtualenv-20.10.0[${PYTHON_USEDEP}] |
| 28 | + ')" |
| 29 | +# coreutils requirement: see Bug #885559 |
| 30 | +BDEPEND="test? ( |
| 31 | + $(python_gen_cond_dep ' |
| 32 | + dev-python/pytest-env[${PYTHON_USEDEP}] |
| 33 | + dev-python/re-assert[${PYTHON_USEDEP}] |
| 34 | + ') |
| 35 | + sys-apps/coreutils[-multicall] |
| 36 | +)" |
| 37 | + |
| 38 | +PATCHES=( |
| 39 | + "${FILESDIR}"/${PN}-3.1.1-tests_git_file_transport.patch |
| 40 | +) |
| 41 | + |
| 42 | +DOCS=( CHANGELOG.md CONTRIBUTING.md README.md ) |
| 43 | + |
| 44 | +EPYTEST_DESELECT=( |
| 45 | + # All of these require a boatload of dependencies (e.g. Conda, Go, R and more) in order to run |
| 46 | + # and while some of them do include "skip if not found" logic, most of them do not. |
| 47 | + tests/languages/ |
| 48 | + tests/repository_test.py |
| 49 | + # These three consistently fail with |
| 50 | + # Calling "git rev-parse" fails with "fatal: not a git repository (or any of the parent directories): .git". |
| 51 | + # including with the sandbox disabled. |
| 52 | + tests/main_test.py::test_all_cmds |
| 53 | + tests/main_test.py::test_hook_stage_migration |
| 54 | + tests/main_test.py::test_try_repo |
| 55 | + # These two fail if pre-commit is already installed (Bug #894502) |
| 56 | + tests/commands/install_uninstall_test.py::test_environment_not_sourced |
| 57 | + tests/commands/install_uninstall_test.py::test_installed_from_venv |
| 58 | +) |
| 59 | + |
| 60 | +distutils_enable_tests pytest |
0 commit comments