Skip to content

Conversation

jamesmurdza
Copy link
Collaborator

@jamesmurdza jamesmurdza commented Oct 10, 2025

Summary

This PR replaces the old PDM-based setup with UV for dependency management and refactors the build-uv.sh script for simplicity and maintainability.

Changes

  • Remove environment loading and cleanup logic — remove the steps that loaded .env.local and manually deleted build caches and artifacts.
  • Remove individual package installation steps — instead of installing each internal Python package (core, pylume, computer, agent, etc.) separately, install everything from the project root with a single uv pip install -e . command.
  • Automatically recreate .venv — any existing virtual environment is removed and rebuilt to ensure a clean setup.
  • Simplify PYTHONPATH generation — reference the virtual environment’s site-packages path instead of hardcoding multiple library paths
  • Replace pdm.lock with uv.lock

@jamesmurdza jamesmurdza changed the title Chore/refactor build uv script Use uv for dependency management and simplify build script Oct 10, 2025
@jamesmurdza jamesmurdza self-assigned this Oct 10, 2025

# Create virtual environment using UV
print_step "Creating virtual environment with UV..."
find . -type d -name ".venv" -exec rm -rf {} + 2>/dev/null || true
Copy link
Contributor

Choose a reason for hiding this comment

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

this might be redundant step if uv venv .venv --python 3.12 is idempotent, might also make sense to just rm -rf .venv before too if it it might exist to make the test more reproducible and not get bugs due to existing state vs desired state

Copy link
Contributor

@r33drichards r33drichards left a comment

Choose a reason for hiding this comment

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

lgtm

# Create a .env file for VS Code to use the virtual environment
print_step "Creating .env file for VS Code..."
echo "PYTHONPATH=${PROJECT_ROOT}/libs/python/core:${PROJECT_ROOT}/libs/python/computer:${PROJECT_ROOT}/libs/python/agent:${PROJECT_ROOT}/libs/python/som:${PROJECT_ROOT}/libs/python/pylume:${PROJECT_ROOT}/libs/python/computer-server:${PROJECT_ROOT}/libs/python/mcp-server" > .env
echo "PYTHONPATH=${VIRTUAL_ENV}/lib/python${PYTHON_VERSION}/site-packages" > .env
Copy link
Contributor

Choose a reason for hiding this comment

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

this overwrites .env, which could be nasty if i have something there i want to keep

Copy link
Collaborator Author

@jamesmurdza jamesmurdza Oct 10, 2025

Choose a reason for hiding this comment

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

Yeah! We already have this line: https://github.com/trycua/cua/blob/main/.vscode/py.code-workspace#L58C1-L59C1

So I'm thinking that should be enough for VS Code to locate packages?

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.

2 participants