Skip to content

Use uv for venv creation in lc init (with python fallback)#125

Merged
EiffL merged 1 commit into
mainfrom
feat/uv-venv-init
May 8, 2026
Merged

Use uv for venv creation in lc init (with python fallback)#125
EiffL merged 1 commit into
mainfrom
feat/uv-venv-init

Conversation

@aboucaud
Copy link
Copy Markdown
Member

@aboucaud aboucaud commented May 8, 2026

Summary

  • Replaces python -m venv + pip install with uv venv --python 3.12 + uv pip install in lc init for faster environment setup
  • Gracefully falls back to the stdlib venv + pip path when uv is not available on the system
  • Adds Rich status spinners to keep the user informed during both steps

Closes #102

Test plan

  • test_init_venv_uses_uv_when_available — verifies uv venv --python 3.12 and uv pip install are called when uv is on PATH
  • test_init_venv_falls_back_to_python_when_uv_missing — verifies python -m venv / pip install fallback when uv is absent

🤖 Generated with Claude Code

Signed-off-by: Alexandre Boucaud aboucaud@apc.in2p3.fr

Prefer uv (faster installs, pinned Python 3.12) when available on the
system; fall back to the stdlib venv + pip path otherwise. Rich status
spinners give feedback during both steps. Tests cover both branches by
monkeypatching shutil.which and subprocess.run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aboucaud aboucaud requested a review from EiffL May 8, 2026 09:16
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
lightcone-cli 1d44859 Commit Preview URL

Branch Preview URL
May 08 2026, 09:17 AM

@EiffL
Copy link
Copy Markdown
Member

EiffL commented May 8, 2026

This looks good @aboucaud ! One question, does this modify the principle of having the venv in .venv? We curretrnyl have a hook that sources the .venv when claude starts. I think this doesn't change things, but just want to check

@aboucaud
Copy link
Copy Markdown
Member Author

aboucaud commented May 8, 2026

No it is transparent

Copy link
Copy Markdown
Member

@EiffL EiffL left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

Developer Certificate of Origin

All contributors have signed the DCO. This PR is ready to merge.

Status

@aboucaud
Copy link
Copy Markdown
Member Author

aboucaud commented May 8, 2026

I have read the Developer Certificate of Origin and I hereby sign the DCO for this PR

@EiffL EiffL merged commit 78092ff into main May 8, 2026
9 checks passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

✅ Eval Results

Metric Value
Score 1.00
Build complete
Cost $0.78
Turns 29
Duration 435s
lightcone-cli 0.3.5.dev10+gc77826a57 (c77826a5)
Results Download

Graders

✅ spec_valid (1.00)
✅ all_materialized (1.00)

Full output
09:16:24 lightcone.eval.build Building lightcone-cli wheel from /home/runner/work/lightcone-cli/lightcone-cli ...
09:16:29 lightcone.eval.build Built lightcone_cli-0.3.5.dev10+gc77826a57-py3-none-any.whl (commit c77826a5)
09:17:50 lightcone.eval.sandbox Created sandbox 1a4b6783-4a06-4ea3-8a19-b1e9b5f2c821 for trial build-snae-0
09:17:51 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/1a4b6783-4a06-4ea3-8a19-b1e9b5f2c821/files/bulk-upload "HTTP/1.1 200 OK"
09:17:52 lightcone.eval.sandbox Installed wheels: ['lightcone_cli-0.3.5.dev10+gc77826a57-py3-none-any.whl']
09:17:53 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/1a4b6783-4a06-4ea3-8a19-b1e9b5f2c821/files/bulk-upload "HTTP/1.1 200 OK"
09:17:53 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/1a4b6783-4a06-4ea3-8a19-b1e9b5f2c821/files/bulk-upload "HTTP/1.1 200 OK"
09:17:53 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/1a4b6783-4a06-4ea3-8a19-b1e9b5f2c821/files/bulk-upload "HTTP/1.1 200 OK"
09:17:54 httpx HTTP Request: POST https://proxy.app.daytona.io/toolbox/1a4b6783-4a06-4ea3-8a19-b1e9b5f2c821/files/bulk-upload "HTTP/1.1 200 OK"
09:25:10 lightcone.eval.sandbox Deleted sandbox for trial build-snae-0
  snae trial 0: score=1.00 complete

lightcone-cli: 0.3.5.dev10+gc77826a57 (HEAD c77826a5)
ASTRA: 0.2.7

  Eval Results: Scores  
┏━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Task ┃     Score     ┃
┡━━━━━━╇━━━━━━━━━━━━━━━┩
│ snae │ 1.00 +/- 0.00 │
│      │ pass@k: 100%  │
└──────┴───────────────┘

   Eval Results: Cost &   
         Duration         
┏━━━━━━┳━━━━━━━━━━━━━━━━━┓
┃ Task ┃ Cost / Duration ┃
┡━━━━━━╇━━━━━━━━━━━━━━━━━┩
│ snae │      $0.78      │
│      │      434s       │
└──────┴─────────────────┘

Total: 1 trials, $0.78, 434s

Results saved to: eval-results/build-c77826a5/results.json

@aboucaud aboucaud deleted the feat/uv-venv-init branch May 8, 2026 10:45
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.

lc init dreadfully slow compared to uv install for venv building

2 participants