-
Notifications
You must be signed in to change notification settings - Fork 3
Install Python 3.12 in setup script to fix venv creation issues #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mentatbot
wants to merge
5
commits into
main
Choose a base branch
from
mentat-42
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Updated .mentat/setup.sh to install Python 3.12 and required packages before creating virtual environment. This resolves the python3-venv package not found error that was preventing successful setup for future agents. Changes include: - Install Python 3.12 from deadsnakes PPA - Install python3.12-venv, python3.12-dev, python3.12-distutils, and python3-pip - Create symlink to make python3 point to python3.12 This ensures the setup script works reliably for future bots working on this repository. Mentat precommit script passed. Log: https://mentat.ai/gh/AbanteAI/repo-visualizer/log/2a056d0b-3fdf-4da2-b299-061f81675607 Co-authored-by: jakethekoenig <[email protected]>
Fixed several issues in the setup script based on auto-review feedback: 1. **Removed non-existent package**: `python3.12-distutils` doesn't exist in the deadsnakes PPA 2. **Fixed pip setup**: Use `python3.12 -m ensurepip` instead of installing system python3-pip 3. **Simplified Python selection**: Use `python3.12` directly instead of problematic symlink logic 4. **Improved robustness**: Added `set -euo pipefail` and `DEBIAN_FRONTEND=noninteractive` 5. **Fixed pip command**: Use the correct `$PIP_CMD` variable for package installation 6. **Removed duplicate**: Single `apt-get update` after adding PPA This should resolve the package installation failures and make the setup more reliable for future agents. Mentat precommit script passed. Log: https://mentat.ai/gh/AbanteAI/repo-visualizer/log/4d19c133-61d8-4ba0-9c98-4c6aca8cda85 Co-authored-by: jakethekoenig <[email protected]>
The setup script was failing because `python3.12 -m ensurepip` is disabled in Ubuntu for system Python. This is a security measure in Debian/Ubuntu systems. Fixed by: - Removing the `python3.12 -m ensurepip --upgrade` command - Removing the `python3.12 -m pip install --upgrade pip` command - Removing the `PIP_CMD` variable and using `pip` directly after venv activation The virtual environment will have pip available automatically after creation, so no manual pip setup is needed. Mentat precommit script passed. Log: https://mentat.ai/gh/AbanteAI/repo-visualizer/log/4bd526fa-9c17-415a-909d-38f23e63ee5c Co-authored-by: jakethekoenig <[email protected]>
Added debug output to see what's happening when creating the virtual environment and why the activate script is missing. Mentat precommit script passed. Log: https://mentat.ai/gh/AbanteAI/repo-visualizer/log/fcb146bd-c5f3-43f0-b188-c14cb6030506 Co-authored-by: jakethekoenig <[email protected]>
Major improvements based on auto-review feedback: 1. **Removed deadsnakes PPA**: Ubuntu 24.04 already ships Python 3.12 in main repos 2. **Fixed virtual environment creation**: Check for activate script rather than just directory 3. **Fixed pip in venv**: Ubuntu disables ensurepip, so manually install pip in venv 4. **Added conditional installation**: Only install Python 3.12 if not already present 5. **Improved robustness**: Remove broken .venv directories and recreate them 6. **Added proper quoting**: Quote variables for safety 7. **Use --no-install-recommends**: Keep image size smaller This should resolve the venv creation issues and make the setup more reliable. Mentat precommit script passed. Log: https://mentat.ai/gh/AbanteAI/repo-visualizer/log/f30696d3-6798-4493-ac22-da95ec03e1af Co-authored-by: jakethekoenig <[email protected]>
Great news! The setup script is now working properly. 🎉 What was fixed:
Results:
Future agents working on this repository should now have a smooth setup experience! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
None yet
0 participants
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updated .mentat/setup.sh to install Python 3.12 and required packages before creating virtual environment. This resolves the python3-venv package not found error that was preventing successful setup for future agents.
Changes include:
This ensures the setup script works reliably for future bots working on this repository.
🤖 See my steps and cost here ✨