[PR #3075] [MERGED] Hooks: run the public tree check through a Python that works #4786

Closed
opened 2026-11-03 05:07:57 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3075
Author: @Domanffe
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @ludovic111

Base: main ← Head: chore/hooks-find-python


📝 Commits (1)

  • e8cb6ae Hooks: run the public tree check through a Python that works

📊 Changes

2 files changed (+20 additions, -2 deletions)

View changed files

📝 .githooks/pre-commit (+10 -1)
📝 .githooks/pre-push (+10 -1)

📄 Description

🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself.

Both hooks ran python3 tools/check_public_tree.py. Git for Windows ships a
python3.exe that is only the Microsoft Store stub: it prints Python to
stderr and exits 49. Every commit and push through the hooks failed with that
output and nothing else, and the same stub makes tests.test_pre_push fail on
this machine: 10 tests, 14 failures, each one 49 != 0 : Python.

The hooks now walk python3, python, py and exec the first one that runs
Python 3. On Linux and macOS python3 still wins first, so the hook is
unchanged there.

Before: python -m unittest tests.test_pre_push → Ran 10 tests ... FAILED (failures=14).
After, on this commit: Ran 10 tests ... OK.

Tested on Windows 11 with git-bash. Nothing else touches the hooks.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3075 **Author:** [@Domanffe](https://github.com/Domanffe) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `chore/hooks-find-python` --- ### 📝 Commits (1) - [`e8cb6ae`](https://github.com/horizon-rust/horizon/commit/e8cb6ae83b98ddf4c8d5c3f9ab4595b12fd36af9) Hooks: run the public tree check through a Python that works ### 📊 Changes **2 files changed** (+20 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `.githooks/pre-commit` (+10 -1) 📝 `.githooks/pre-push` (+10 -1) </details> ### 📄 Description > 🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself. Both hooks ran `python3 tools/check_public_tree.py`. Git for Windows ships a `python3.exe` that is only the Microsoft Store stub: it prints `Python` to stderr and exits 49. Every commit and push through the hooks failed with that output and nothing else, and the same stub makes `tests.test_pre_push` fail on this machine: 10 tests, 14 failures, each one `49 != 0 : Python`. The hooks now walk `python3`, `python`, `py` and exec the first one that runs Python 3. On Linux and macOS `python3` still wins first, so the hook is unchanged there. Before: `python -m unittest tests.test_pre_push` → `Ran 10 tests ... FAILED (failures=14)`. After, on this commit: `Ran 10 tests ... OK`. Tested on Windows 11 with git-bash. Nothing else touches the hooks. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:07:57 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4786
No description provided.