Skip to content

Use uv instead of pip for CI dependencies #5029

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

Merged
merged 10 commits into from
Feb 11, 2025
60 changes: 26 additions & 34 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,51 +39,52 @@ commands:
- run:
name: Install dependencies
command: |
python -m venv venv
. venv/bin/activate
pip install -e .
pip install -r ./test_requirements/requirements_<<parameters.py>>_optional.txt
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
uv pip install .
uv pip install -r ./test_requirements/requirements_<<parameters.py>>_optional.txt
cd js
npm ci
npm run build
- run:
name: Install plotly-geo
command: |
. venv/bin/activate
pip install plotly-geo
source .venv/bin/activate
uv pip install plotly-geo
- run:
name: Test core
command: |
. venv/bin/activate
source .venv/bin/activate
pytest tests/test_core
no_output_timeout: 20m
- run:
name: Test optional
command: |
. venv/bin/activate
source .venv/bin/activate
pytest tests/test_optional
no_output_timeout: 40m
- run:
name: Test utils
command: |
. venv/bin/activate
source .venv/bin/activate
pytest tests/test_plotly_utils/
no_output_timeout: 20m
- run:
name: Test io
command: |
. venv/bin/activate
pytest tests/test_io
source .venv/bin/activate
python -m pytest tests/test_io
no_output_timeout: 20m
- run:
name: Test dependencdies not imported
name: Test dependencies not imported
command: |
. venv/bin/activate
source .venv/bin/activate
python -m pytest -x test_init/test_dependencies_not_imported.py
- run:
name: Test lazy imports
command: |
. venv/bin/activate
source .venv/bin/activate
python -m pytest -x test_init/test_lazy_imports.py
test_orca:
parameters:
Expand Down Expand Up @@ -392,25 +393,22 @@ jobs:
- "dc:5f:39:48:00:b4:72:34:e1:d2:c4:e1:1f:d1:e2:ce" #plotlydocbot

- checkout

# Download and cache dependencies
- restore_cache:
key: v2-dependencies-{{ checksum "doc/requirements.txt" }}-{{ checksum ".circleci/config.yml" }}
- browser-tools/install-chrome
- browser-tools/install-chromedriver

- run:
name: install dependencies
command: |
cd doc
python -m venv venv
. venv/bin/activate
pip uninstall -y plotly
pip install -r requirements.txt
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
uv pip uninstall plotly
uv pip install -r requirements.txt
if [ "${CIRCLE_BRANCH}" != "doc-prod" ]; then
pip uninstall -y plotly
uv pip uninstall plotly
cd ..
pip install -e .
uv pip install -e .
cd js
npm ci
npm run build
Expand All @@ -426,17 +424,11 @@ jobs:
sudo apt-get install -y poppler-utils libxtst6 xvfb libgtk2.0-0 libgconf-2-4 libnss3 libasound2 rename
echo 'export PATH="/home/circleci/project/node_modules/.bin:$PATH"' >> $BASH_ENV

- save_cache:
paths:
- ./doc/venv
- ./doc/node_modules
key: v1-dependencies-{{ checksum "doc/requirements.txt" }}-{{ checksum ".circleci/config.yml" }}

- run:
name: make html
command: |
cd doc
. venv/bin/activate
source .venv/bin/activate
echo ${mapbox_token} > python/.mapbox_token
make -kj8 || make -kj8
curl https://raw.githubusercontent.com/plotly/graphing-library-docs/master/front-matter-ci.py > front-matter-ci.py
Expand Down Expand Up @@ -485,14 +477,14 @@ jobs:
name: make doc
command: |
cd doc
. venv/bin/activate
source .venv/bin/activate
# For the API doc, we need to use the local version of plotly
# since we are tweaking the source because of
# graph_objs/graph_objects
if [ "${CIRCLE_BRANCH}" == "doc-prod" ]; then
pip uninstall -y plotly
uv pip uninstall plotly
cd ..
pip install -e .
uv pip install -e .
cd doc
cd apidoc
make html
Expand Down