Skip to content

feat(ebuild): fix installation script when using venv - #164

Merged
srpatcha merged 3 commits into
embeddedos-org:masterfrom
BenjaminGuzman:fix/installation-venv
Oct 2, 2026
Merged

srpatcha merged 3 commits into
embeddedos-org:masterfrom
BenjaminGuzman:fix/installation-venv

Conversation

@BenjaminGuzman

@BenjaminGuzman BenjaminGuzman commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

The installation script failed with no helpful message when a virtual environment was used.

Summary

This PR improves the install.sh script to gracefully handle environment-related installation failures. It prevents the script from failing silently when it hits PEP 668 externally-managed-environment protections, and fixes the issue where the installed binary couldn't be located when installed within a local virtual environment.

Type of Change

  • feat - New feature
  • fix - Bug fix
  • docs - Documentation only
  • style - Formatting, no code change
  • refactor - Code restructuring without behavior change
  • test - Add or fix tests
  • build - Build system or dependency changes
  • ci - CI/CD pipeline changes
  • perf - Performance improvement

Changes

  • Updated the pip install step to check for failure instead of failing silently, printing an actionable error message that tells the user how to run the command manually to see the underlying error.

  • Added $VIRTUAL_ENV/bin/ebuild to the search paths so the script can locate the binary when installed inside a local virtual environment.

  • Added a warning message when a venv binary is found, notifying the user that its execution will depend on the virtual environment's existence.

Testing

  • Unit tests pass (ctest --test-dir build --output-on-failure)
  • Integration tests pass
  • Manual testing performed
  • New tests added for new functionality

Pre-Submission Checklist

  • Code compiles without warnings (-Wall -Wextra -Werror for C)
  • All existing tests pass
  • New tests added for new functionality
  • Documentation updated if API changed
  • Commit messages follow the <type>(<scope>): <description> convention
  • Branch is rebased on latest master
  • This PR links a real issue in this repository with a closing keyword

Related Issue

Fixes #163

Screenshots / Logs

Additional Notes

@BenjaminGuzman
BenjaminGuzman force-pushed the fix/installation-venv branch 3 times, most recently from c60184c to 21546b0 Compare September 30, 2026 19:06
The installation script failed with no helpful message
when a virtual environment was used.

Plus, there were style errors (whitespaces) detected
by ruff, that were also fixed.

Signed-off-by: Benjamín Guzmán <code@bguzman.dev>
@BenjaminGuzman

Copy link
Copy Markdown
Contributor Author

CI is failing due to an issue after a merge documented here #141 (review)

@BenjaminGuzman
BenjaminGuzman marked this pull request as ready for review September 30, 2026 23:32
…TUAL_ENV candidate

Inside a venv, ~/.local/bin/pip3 was picked first, so the package was
installed outside the venv. With VIRTUAL_ENV unset, the new candidate
expanded to /bin/ebuild.
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@srpatcha srpatcha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: READY-TO-MERGE

Why CI failed: the run on af7e82c failed at mypy, not in this PR's code:
tests/unit/cli/test_commands_utils.py:5: Module "ebuild.cli.commands" has no attribute "_resolve_runner_args".
The PR was tested against base 7f1ff93, where the 09-30 batch merge had dropped _resolve_runner_args. It was restored on master in aee2231, so merging master fixes it.

Pushed:

  • 5164a49: merge origin/master (clean).
  • 5c6dada: two fixes in install.sh.
    • Use $VIRTUAL_ENV/bin/pip when a venv is active. Before, ~/.local/bin/pip3 won, so the package was installed outside the venv.
    • Check $VIRTUAL_ENV/bin/ebuild first, and skip it when VIRTUAL_ENV is unset. Before, it expanded to /bin/ebuild.

Verified locally (Python 3.12, WSL):

  • pytest tests --no-cov: 826 passed, 2 skipped. ruff check . clean. yamllint . rc=0. mypy: no issues in 120 files. bash -n install.sh OK.
  • Ran install.sh in a throwaway venv with an isolated HOME: rc=0, binary resolved to $VENV/bin/ebuild, ebuild, version 3.0.1.
  • With a broken pyproject: rc=1 and the "run it manually" hint.
  • GitHub CI on 5c6dada: 29 checks pass, including CI Gate.

Not verified: macOS. shellcheck was not available.

@srpatcha
srpatcha merged commit e5f6a9e into embeddedos-org:master Oct 2, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Installation script silently fails on PEP 668 environments and fails to find binary inside virtual environments

3 participants