commit:     2d2264f3830c1c14acd266a00577be7a86020723
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Mon Nov  6 11:36:41 2023 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Mon Nov  6 15:00:45 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d2264f3

dev-vcs/pre-commit: deselect tests that fail if pre-commit is installed

On the one hand quite a few bits of pre-commit rely on the executable
"git" being present in PATH, on the other the tests delete the directory
containing "pre-commit" from PATH prior to executing. If both reside in
/usr/bin, hilarity ensues.

Just deselect these tests, they aren't directly relevant to packaged
pre-commit anyway.

Thanks-to: Alfred Wingate <parona <AT> protonmail.com>
Closes: https://bugs.gentoo.org/894502
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 dev-vcs/pre-commit/pre-commit-3.3.3.ebuild | 13 ++++++++-----
 dev-vcs/pre-commit/pre-commit-3.5.0.ebuild | 13 ++++++++-----
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/dev-vcs/pre-commit/pre-commit-3.3.3.ebuild 
b/dev-vcs/pre-commit/pre-commit-3.3.3.ebuild
index 57b3ece298ad..754a0991d794 100644
--- a/dev-vcs/pre-commit/pre-commit-3.3.3.ebuild
+++ b/dev-vcs/pre-commit/pre-commit-3.3.3.ebuild
@@ -41,17 +41,20 @@ PATCHES=(
 
 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.
 EPYTEST_DESELECT=(
+       # All of these 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.
        tests/languages/
        tests/repository_test.py
+       # These three 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.
        tests/main_test.py::test_all_cmds
        tests/main_test.py::test_hook_stage_migration
        tests/main_test.py::test_try_repo
+       # These two fail if pre-commit is already installed (Bug #894502)
+       tests/commands/install_uninstall_test.py::test_environment_not_sourced
+       tests/commands/install_uninstall_test.py::test_installed_from_venv
 )
 
 distutils_enable_tests pytest

diff --git a/dev-vcs/pre-commit/pre-commit-3.5.0.ebuild 
b/dev-vcs/pre-commit/pre-commit-3.5.0.ebuild
index e6d46da41754..96ec1f982805 100644
--- a/dev-vcs/pre-commit/pre-commit-3.5.0.ebuild
+++ b/dev-vcs/pre-commit/pre-commit-3.5.0.ebuild
@@ -42,17 +42,20 @@ PATCHES=(
 
 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.
 EPYTEST_DESELECT=(
+       # All of these 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.
        tests/languages/
        tests/repository_test.py
+       # These three 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.
        tests/main_test.py::test_all_cmds
        tests/main_test.py::test_hook_stage_migration
        tests/main_test.py::test_try_repo
+       # These two fail if pre-commit is already installed (Bug #894502)
+       tests/commands/install_uninstall_test.py::test_environment_not_sourced
+       tests/commands/install_uninstall_test.py::test_installed_from_venv
 )
 
 distutils_enable_tests pytest

Reply via email to