-
-
Notifications
You must be signed in to change notification settings - Fork 594
Use uv for dependency management and simplify build script #460
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
base: main
Are you sure you want to change the base?
Conversation
|
||
# Create virtual environment using UV | ||
print_step "Creating virtual environment with UV..." | ||
find . -type d -name ".venv" -exec rm -rf {} + 2>/dev/null || true |
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.
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
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.
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 |
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.
this overwrites .env, which could be nasty if i have something there i want to keep
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.
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?
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
.env.local
and manually deleted build caches and artifacts.core
,pylume
,computer
,agent
, etc.) separately, install everything from the project root with a singleuv pip install -e .
command..venv
— any existing virtual environment is removed and rebuilt to ensure a clean setup.PYTHONPATH
generation — reference the virtual environment’ssite-packages
path instead of hardcoding multiple library pathspdm.lock
withuv.lock