Skip to content

Commit d0d51d2

Browse files
authored
Make pip.sh faster with uv and easier to use with explicit steps (#851)
1 parent e318025 commit d0d51d2

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

docs/internal/development.md

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ If [ibazel](https://github.com/bazelbuild/bazel-watcher) breaks, but bazel works
1212

1313
> TIP: If your build mysteriously fails due to an npm-related error, try running `bazel clean --expunge && rm -rf node_modules`. Bazel and Yarn have a cache bug when upgrading npm modules.
1414
15+
### uv
16+
17+
We use [uv](https://github.com/astral-sh/uv). Follow the instructions [here](https://docs.astral.sh/uv/#getting-started) to install uv.
18+
1519
### Commit hooks
1620

1721
1. Install [pre-commit](https://pre-commit.com/#installation)

scripts/pip.sh

+11-5
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,21 @@ fi
2323

2424
virtualenv --python python3 /tmp/mesoprelease-test/venv-test && \
2525
source /tmp/mesoprelease-test/venv-test/bin/activate && \
26-
pip install --upgrade pip && \
27-
pip install -r mesop/pip_package/requirements.txt --no-binary pydantic && \
28-
pip uninstall -y mesop && \
26+
uv pip install --upgrade pip && \
27+
uv pip install -r mesop/pip_package/requirements.txt --no-binary pydantic && \
2928
bazel run //mesop/pip_package:build_pip_package -- /tmp/mesoprelease-test/mesop.tar.gz && \
3029
cp -r ./scripts/smoketest_app /tmp/mesoprelease-test && \
3130
# Do "-P" so that it follows the physical path so that
3231
# it follows the symlink on MacOs from /tmp to /private/tmp
3332
# Otherwise, gunicorn cannot serve the web component files properly
3433
cd -P /tmp/mesoprelease-test/ && \
3534
tar -xzf mesop.tar.gz && \
36-
pip install --upgrade /tmp/mesoprelease-test/mesop*.whl && \
37-
cd smoketest_app && mesop main.py
35+
uv pip install --upgrade /tmp/mesoprelease-test/mesop*.whl && \
36+
cd smoketest_app;
37+
38+
echo -e "\n\033[1;34m=== Instructions to Run the Smoke Test ===\033[0m"
39+
echo -e "\033[1;33m1. Activate the virtual environment:\033[0m"
40+
echo " source /tmp/mesoprelease-test/venv-test/bin/activate"
41+
echo -e "\033[1;33m2. Run the Mesop application:\033[0m"
42+
echo " mesop main.py"
43+
echo -e "\033[1;34m=========================================\033[0m\n"

0 commit comments

Comments
 (0)