Add uv and bloc using uv tool install #27

Merged
brad merged 3 commits from agent/add-bloc-uv-tool into main 2026-02-24 09:20:52 -08:00
Owner

Evaluation

Brad asked me to evaluate the best option for installing bloc in sandbox containers. After reviewing the options, I recommend:

Install uv + use uv tool install

Why This Approach

  1. Correct paths: uv installer puts binaries in /root/.local/bin/, not /root/.cargo/bin/
  2. Canonical method: uv tool install is the recommended way to install CLI tools globally
  3. No temp files: Installs directly from git URL without cloning
  4. Includes uvx: Provides both uv and uvx binaries
  5. Future-proof: uv is the modern Python package manager, useful for other commune tools

Implementation

# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
mv /root/.local/bin/uv /usr/local/bin/uv
mv /root/.local/bin/uvx /usr/local/bin/uvx

# Install bloc using uv tool install (clean, isolated)
uv tool install --python 3.11 git+https://git.brads.house/commune/bloc
ln -s /root/.local/bin/bloc /usr/local/bin/bloc

vs. git clone + pip install

PR #26 uses git clone + uv pip install --system. This works, but:

  • Requires temp directory management
  • Less idiomatic (uv tool install is designed for this)
  • Uses incorrect path /root/.cargo/bin/ (should be /root/.local/bin/)

Testing

Once merged and the image is rebuilt:

# In intern/researcher containers
bloc pr list --repo commune/skills
bloc issue create "Title" --body "Details" --repo commune/library

Auth is automatic via rbw (FORGEJO_TOKEN already configured).

## Evaluation Brad asked me to evaluate the best option for installing bloc in sandbox containers. After reviewing the options, I recommend: **✅ Install uv + use `uv tool install`** ### Why This Approach 1. **Correct paths**: uv installer puts binaries in `/root/.local/bin/`, not `/root/.cargo/bin/` 2. **Canonical method**: `uv tool install` is the recommended way to install CLI tools globally 3. **No temp files**: Installs directly from git URL without cloning 4. **Includes uvx**: Provides both uv and uvx binaries 5. **Future-proof**: uv is the modern Python package manager, useful for other commune tools ### Implementation ```dockerfile # Install uv curl -LsSf https://astral.sh/uv/install.sh | sh mv /root/.local/bin/uv /usr/local/bin/uv mv /root/.local/bin/uvx /usr/local/bin/uvx # Install bloc using uv tool install (clean, isolated) uv tool install --python 3.11 git+https://git.brads.house/commune/bloc ln -s /root/.local/bin/bloc /usr/local/bin/bloc ``` ### vs. git clone + pip install PR #26 uses `git clone + uv pip install --system`. This works, but: - Requires temp directory management - Less idiomatic (uv tool install is designed for this) - Uses incorrect path `/root/.cargo/bin/` (should be `/root/.local/bin/`) ### Testing Once merged and the image is rebuilt: ```bash # In intern/researcher containers bloc pr list --repo commune/skills bloc issue create "Title" --body "Details" --repo commune/library ``` Auth is automatic via rbw (FORGEJO_TOKEN already configured). ## Related - commune/bloc#1 — bloc MVP discussion - commune/sandbox#26 — alternative approach using git clone
Install uv (modern Python package manager) and bloc CLI tool from
commune/bloc using the recommended 'uv tool install' pattern.

Key improvements over git clone + pip install approach:
- Uses 'uv tool install' (canonical way to install CLI tools)
- Installs directly from git URL (no temp directory needed)
- Correct installation paths (/root/.local/bin/, not /root/.cargo/bin/)
- Includes both uv and uvx binaries
- Cleaner, more maintainable

The bloc CLI provides a unified interface for Forgejo operations,
replacing scattered curl commands across agent skills. Auth integration
works seamlessly with rbw vault (FORGEJO_TOKEN env var).

Addresses: commune/bloc#1
Owner

@agent sorry i didnt see your note before merging the other PR. i think your approach is correct. can you update from main and then add your change?

@agent sorry i didnt see your note before merging the other PR. i think your approach is correct. can you update from main and then add your change?
After merging main, we had two installations:
1. uv tool install approach (preferred, isolated)
2. git clone + uv pip install --system (from merged PR #26)

Keeping only the uv tool install approach as discussed with Brad.
Author
Owner

Updated from main and removed the duplicate installation. The branch now has only the uv tool install approach:

# Install uv (modern Python package manager)
RUN curl -LsSf https://astral.sh/uv/install.sh | sh \
  && mv /root/.local/bin/uv /usr/local/bin/uv \
  && mv /root/.local/bin/uvx /usr/local/bin/uvx

# Install bloc CLI tool using uv tool install
RUN uv tool install --python 3.11 git+https://git.brads.house/commune/bloc \
  && ln -s /root/.local/bin/bloc /usr/local/bin/bloc

This approach provides better isolation (each tool gets its own venv) and is more idiomatic for CLI tool installation.

Updated from main and removed the duplicate installation. The branch now has only the `uv tool install` approach: ```dockerfile # Install uv (modern Python package manager) RUN curl -LsSf https://astral.sh/uv/install.sh | sh \ && mv /root/.local/bin/uv /usr/local/bin/uv \ && mv /root/.local/bin/uvx /usr/local/bin/uvx # Install bloc CLI tool using uv tool install RUN uv tool install --python 3.11 git+https://git.brads.house/commune/bloc \ && ln -s /root/.local/bin/bloc /usr/local/bin/bloc ``` This approach provides better isolation (each tool gets its own venv) and is more idiomatic for CLI tool installation.
Owner

@agent i notice we need to handle this differently for build workflow

#5 [11/17] RUN curl -LsSf https://astral.sh/uv/install.sh | sh   && mv /root/.cargo/bin/uv /usr/local/bin/   && git clone https://git.brads.house/commune/bloc.git /tmp/bloc   && cd /tmp/bloc   && uv pip install --system .   && cd /   && rm -rf /tmp/bloc   && bloc --version
#5 sha256:25cb60d2d1e81013ddff74b354b5bbd1e702e3f08b81ce09f28f55edca61ee94
#5 1.265 downloading uv 0.10.5 x86_64-unknown-linux-gnu
#5 1.878 no checksums to verify
#5 2.299 installing to /root/.local/bin
#5 2.439   uv
#5 2.448   uvx
#5 2.448 everything's installed!
#5 2.552 
#5 2.552 To add $HOME/.local/bin to your PATH, either restart your shell or run:
#5 2.552 
#5 2.552     source $HOME/.local/bin/env (sh, bash, zsh)
#5 2.552     source $HOME/.local/bin/env.fish (fish)
#5 2.582 mv: cannot stat '/root/.cargo/bin/uv': No such file or directory
#5 ERROR: process "/bin/sh -c curl -LsSf https://astral.sh/uv/install.sh | sh   && mv /root/.cargo/bin/uv /usr/local/bin/   && git clone https://git.brads.house/commune/bloc.git /tmp/bloc   && cd /tmp/bloc   && uv pip install --system .   && cd /   && rm -rf /tmp/bloc   && bloc --version" did not complete successfully: exit code: 1
------
 > [11/17] RUN curl -LsSf https://astral.sh/uv/install.sh | sh   && mv /root/.cargo/bin/uv /usr/local/bin/   && git clone https://git.brads.house/commune/bloc.git /tmp/bloc   && cd /tmp/bloc   && uv pip install --system .   && cd /   && rm -rf /tmp/bloc   && bloc --version:
------
process "/bin/sh -c curl -LsSf https://astral.sh/uv/install.sh | sh   && mv /root/.cargo/bin/uv /usr/local/bin/   && git clone https://git.brads.house/commune/bloc.git /tmp/bloc   && cd /tmp/bloc   && uv pip install --system .   && cd /   && rm -rf /tmp/bloc   && bloc --version" did not complete successfully: exit code: 1
⚙️ [runner]: exitcode '1': failure
@agent i notice we need to handle this differently for build workflow ``` #5 [11/17] RUN curl -LsSf https://astral.sh/uv/install.sh | sh && mv /root/.cargo/bin/uv /usr/local/bin/ && git clone https://git.brads.house/commune/bloc.git /tmp/bloc && cd /tmp/bloc && uv pip install --system . && cd / && rm -rf /tmp/bloc && bloc --version #5 sha256:25cb60d2d1e81013ddff74b354b5bbd1e702e3f08b81ce09f28f55edca61ee94 #5 1.265 downloading uv 0.10.5 x86_64-unknown-linux-gnu #5 1.878 no checksums to verify #5 2.299 installing to /root/.local/bin #5 2.439 uv #5 2.448 uvx #5 2.448 everything's installed! #5 2.552 #5 2.552 To add $HOME/.local/bin to your PATH, either restart your shell or run: #5 2.552 #5 2.552 source $HOME/.local/bin/env (sh, bash, zsh) #5 2.552 source $HOME/.local/bin/env.fish (fish) #5 2.582 mv: cannot stat '/root/.cargo/bin/uv': No such file or directory #5 ERROR: process "/bin/sh -c curl -LsSf https://astral.sh/uv/install.sh | sh && mv /root/.cargo/bin/uv /usr/local/bin/ && git clone https://git.brads.house/commune/bloc.git /tmp/bloc && cd /tmp/bloc && uv pip install --system . && cd / && rm -rf /tmp/bloc && bloc --version" did not complete successfully: exit code: 1 ------ > [11/17] RUN curl -LsSf https://astral.sh/uv/install.sh | sh && mv /root/.cargo/bin/uv /usr/local/bin/ && git clone https://git.brads.house/commune/bloc.git /tmp/bloc && cd /tmp/bloc && uv pip install --system . && cd / && rm -rf /tmp/bloc && bloc --version: ------ process "/bin/sh -c curl -LsSf https://astral.sh/uv/install.sh | sh && mv /root/.cargo/bin/uv /usr/local/bin/ && git clone https://git.brads.house/commune/bloc.git /tmp/bloc && cd /tmp/bloc && uv pip install --system . && cd / && rm -rf /tmp/bloc && bloc --version" did not complete successfully: exit code: 1 ⚙️ [runner]: exitcode '1': failure ```
Author
Owner

The error you're seeing is from the old code on main (commit a0d84cd) that tried to move from /root/.cargo/bin/uv, but the uv installer actually puts the binary in /root/.local/bin/uv.

The current PR branch (78178e2) already has the fix — it correctly uses /root/.local/bin/uv. I cleaned up the duplicate installation and kept only the uv tool install approach.

If you're seeing this error from a recent build:

  • Check which commit the workflow built from
  • Clear any Docker build cache (docker builder prune)
  • Verify the workflow is building from agent/add-bloc-uv-tool branch, not main

The current Dockerfile on this branch should work.

The error you're seeing is from the old code on `main` (commit a0d84cd) that tried to move from `/root/.cargo/bin/uv`, but the uv installer actually puts the binary in `/root/.local/bin/uv`. The current PR branch (78178e2) already has the fix — it correctly uses `/root/.local/bin/uv`. I cleaned up the duplicate installation and kept only the `uv tool install` approach. If you're seeing this error from a recent build: - Check which commit the workflow built from - Clear any Docker build cache (`docker builder prune`) - Verify the workflow is building from `agent/add-bloc-uv-tool` branch, not `main` The current Dockerfile on this branch should work.
brad merged commit ed81434a25 into main 2026-02-24 09:20:52 -08:00
brad deleted branch agent/add-bloc-uv-tool 2026-02-24 09:20:53 -08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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
commune/sandbox!27
No description provided.