-
Notifications
You must be signed in to change notification settings - Fork 100
fix: mount .local/share to persist uv-managed Python installations #88
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
TonyHernandezAtMS
wants to merge
1
commit into
RchGrav:main
Choose a base branch
from
TonyHernandezAtMS:fix/uv-python-persistence
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.
Open
fix: mount .local/share to persist uv-managed Python installations #88
TonyHernandezAtMS
wants to merge
1
commit into
RchGrav:main
from
TonyHernandezAtMS:fix/uv-python-persistence
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
Fixes broken Python venv symlinks after container restarts. Problem: When uv creates a venv with --python-preference managed, it downloads Python to ~/.local/share/uv/python/. The venv contains symlinks pointing to this location. However, this directory was not mounted, causing the Python installation to be lost when containers exit, leaving broken symlinks. This bug was introduced in commit 57fa079 (July 17, 2025) when Python installation was moved from Docker build-time to runtime with the entrypoint flag system. Solution: Mount PROJECT_SLOT_DIR/.local/share to persist uv-downloaded Python installations across container restarts. Affects: python, ml, and datascience profiles Testing: - Clean project and add python profile - Verify Python 3.14 downloads and installs successfully - Restart container and verify Python still works - Confirm ~/.local/share/uv/python/ persists on host
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds a host directory creation and Docker volume mount for ~/.local/share in the run_claudebox_container function to persist uv-managed Python installations and prevent broken venv symlinks across container restarts. Flow diagram for persisting uv-managed Python installationsflowchart TD
A["Container start"] --> B["Create $PROJECT_SLOT_DIR/.local/share on host"]
B --> C["Mount $PROJECT_SLOT_DIR/.local/share to /home/$DOCKER_USER/.local/share in container"]
C --> D["uv downloads Python to /home/$DOCKER_USER/.local/share/uv/python/"]
D --> E["Python installation persists across container restarts"]
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Fixes broken Python venv symlinks after container restarts by mounting
~/.local/share/to persist uv-managed Python installations.Fixes #87
Problem
When
uvcreates a venv with--python-preference managed, it downloads Python to~/.local/share/uv/python/. The venv contains symlinks pointing to this location, but since~/.local/share/was not mounted, the Python installation was lost on container exit, leaving broken symlinks.Solution
Added mount for
PROJECT_SLOT_DIR/.local/shareinlib/docker.shto persist uv-downloaded Python installations across container restarts.Testing
Tested on macOS with ml-tutorial project:
python mlprofiles~/.claudebox/projects/.../6111fd25/.local/share/uv/python/cpython-3.14.0-linux-aarch64-gnu/Impact
python,ml, anddatascienceprofilesRelated Issues
This bug was introduced in commit
57fa079when Python installation was moved from build-time to runtime.Subsequent commits attempted to fix Python issues but missed the root cause:
4fd05a8- "Fix multiple issues: shell auth, Python/uv PATH..."b2aedd9- "Fix multiple issues with Python/uv, tmux activation..."bcf4ee7- "Add UV_PYTHON_MANAGED=1 environment variable"