Summary: | dev-vcs/pre-commit-3.0.4 fails tests if previously installed: AssertionError: assert Executable git not found == pre-commit not found Did you forget to activate your virtualenv? | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Agostino Sarubbo <ago> |
Component: | Current packages | Assignee: | Marek Szuba <marecki> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | parona |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
build.log
1-test.log |
Description
Agostino Sarubbo
2023-02-15 07:44:31 UTC
Created attachment 851174 [details]
build.log
build log and emerge --info
Created attachment 851176 [details]
1-test.log
1-test.log
Error(s) that match a know pattern in addition to what has been reported in the summary: ' E AssertionError: assert 'Executable `git` not found' == '`pre-commit` not found. Did you forget to activate your virtualenv? FAILED tests/commands/install_uninstall_test.py::test_environment_not_sourced FAILED tests/commands/install_uninstall_test.py::test_installed_from_venv - a... Is this still a problem with 3.3.3, and if so could you confirm: - that the executable 'git' is actually present on the file system, and - if it is, that the directory containing it is in PATH? This is a problem in 3.5.0. It appears to be case of https://github.com/pre-commit/pre-commit/blob/14169eb31db6a0ac3e4dfbc38234a8a3e90bc6c1/tests/commands/install_uninstall_test.py#L248 removing /usr/bin instead of the venv part. This would be triggered if pre-commit was installed already. Even if "fixed" it would cause the test to fail if pre-commit is already installed as its supposed to tests that pre-commit isn't path. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d2264f3830c1c14acd266a00577be7a86020723 commit 2d2264f3830c1c14acd266a00577be7a86020723 Author: Marek Szuba <marecki@gentoo.org> AuthorDate: 2023-11-06 11:36:41 +0000 Commit: Marek Szuba <marecki@gentoo.org> CommitDate: 2023-11-06 15:00:45 +0000 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@protonmail.com> Closes: https://bugs.gentoo.org/894502 Signed-off-by: Marek Szuba <marecki@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(-) Thank you very much for having figured this out, I must say this issue had me rather stumped - mostly because I do all my package development on a clean system! I have just pulled the relevant bits out of your PR, the py3.12 stuff has been left alone because it both is beyond the scope of this issue and involves another maintainer. Could you possibly report this problem upstream as well, so that they could try to actually fix it? I don't think reporting it is going to be useful, upstream has gone through it before and the advice was to skip it as the test isn't useful from the context of a system wide install. https://github.com/pre-commit/pre-commit/issues/1235#issuecomment-562868123 The big problem is that it failing is really caused by how gentoo installs it (and the fact it can be tested after its already installed) so upstream real has no incentive to completely rethink their tests to accommodate this edge case. Fedora went through this at one point as well https://github.com/pre-commit/pre-commit/issues/1183#issuecomment-545103220 |