Skip to content

Commit 82736ad

Browse files
authored
Merge pull request #5029 from plotly/uv-ci
Use uv instead of pip for CI dependencies
2 parents 60ada7c + cfce34f commit 82736ad

File tree

1 file changed

+29
-38
lines changed

1 file changed

+29
-38
lines changed

Diff for: .circleci/config.yml

+29-38
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ commands:
2424
name: Test core
2525
command: |
2626
. venv/bin/activate
27-
pytest tests/test_core
27+
python -m pytest tests/test_core
2828
no_output_timeout: 20m
2929

3030
test_optional:
@@ -39,51 +39,52 @@ commands:
3939
- run:
4040
name: Install dependencies
4141
command: |
42-
python -m venv venv
43-
. venv/bin/activate
44-
pip install -e .
45-
pip install -r ./test_requirements/requirements_<<parameters.py>>_optional.txt
42+
curl -LsSf https://astral.sh/uv/install.sh | sh
43+
uv venv
44+
source .venv/bin/activate
45+
uv pip install .
46+
uv pip install -r ./test_requirements/requirements_<<parameters.py>>_optional.txt
4647
cd js
4748
npm ci
4849
npm run build
4950
- run:
5051
name: Install plotly-geo
5152
command: |
52-
. venv/bin/activate
53-
pip install plotly-geo
53+
source .venv/bin/activate
54+
uv pip install plotly-geo
5455
- run:
5556
name: Test core
5657
command: |
57-
. venv/bin/activate
58-
pytest tests/test_core
58+
source .venv/bin/activate
59+
python -m pytest tests/test_core
5960
no_output_timeout: 20m
6061
- run:
6162
name: Test optional
6263
command: |
63-
. venv/bin/activate
64-
pytest tests/test_optional
64+
source .venv/bin/activate
65+
python -m pytest tests/test_optional
6566
no_output_timeout: 40m
6667
- run:
6768
name: Test utils
6869
command: |
69-
. venv/bin/activate
70-
pytest tests/test_plotly_utils/
70+
source .venv/bin/activate
71+
python -m pytest tests/test_plotly_utils/
7172
no_output_timeout: 20m
7273
- run:
7374
name: Test io
7475
command: |
75-
. venv/bin/activate
76-
pytest tests/test_io
76+
source .venv/bin/activate
77+
python -m pytest tests/test_io
7778
no_output_timeout: 20m
7879
- run:
79-
name: Test dependencdies not imported
80+
name: Test dependencies not imported
8081
command: |
81-
. venv/bin/activate
82+
source .venv/bin/activate
8283
python -m pytest -x test_init/test_dependencies_not_imported.py
8384
- run:
8485
name: Test lazy imports
8586
command: |
86-
. venv/bin/activate
87+
source .venv/bin/activate
8788
python -m pytest -x test_init/test_lazy_imports.py
8889
test_orca:
8990
parameters:
@@ -392,25 +393,21 @@ jobs:
392393
- "dc:5f:39:48:00:b4:72:34:e1:d2:c4:e1:1f:d1:e2:ce" #plotlydocbot
393394

394395
- checkout
395-
396-
# Download and cache dependencies
397-
- restore_cache:
398-
key: v2-dependencies-{{ checksum "doc/requirements.txt" }}-{{ checksum ".circleci/config.yml" }}
399396
- browser-tools/install-chrome
400397
- browser-tools/install-chromedriver
401398

402399
- run:
403400
name: install dependencies
404401
command: |
405402
cd doc
406-
python -m venv venv
407-
. venv/bin/activate
408-
pip uninstall -y plotly
409-
pip install -r requirements.txt
403+
curl -LsSf https://astral.sh/uv/install.sh | sh
404+
uv venv
405+
source .venv/bin/activate
406+
uv pip install -r requirements.txt
410407
if [ "${CIRCLE_BRANCH}" != "doc-prod" ]; then
411-
pip uninstall -y plotly
408+
uv pip uninstall plotly
412409
cd ..
413-
pip install -e .
410+
uv pip install -e .
414411
cd js
415412
npm ci
416413
npm run build
@@ -426,17 +423,11 @@ jobs:
426423
sudo apt-get install -y poppler-utils libxtst6 xvfb libgtk2.0-0 libgconf-2-4 libnss3 libasound2 rename
427424
echo 'export PATH="/home/circleci/project/node_modules/.bin:$PATH"' >> $BASH_ENV
428425
429-
- save_cache:
430-
paths:
431-
- ./doc/venv
432-
- ./doc/node_modules
433-
key: v1-dependencies-{{ checksum "doc/requirements.txt" }}-{{ checksum ".circleci/config.yml" }}
434-
435426
- run:
436427
name: make html
437428
command: |
438429
cd doc
439-
. venv/bin/activate
430+
source .venv/bin/activate
440431
echo ${mapbox_token} > python/.mapbox_token
441432
make -kj8 || make -kj8
442433
curl https://raw.githubusercontent.com/plotly/graphing-library-docs/master/front-matter-ci.py > front-matter-ci.py
@@ -485,14 +476,14 @@ jobs:
485476
name: make doc
486477
command: |
487478
cd doc
488-
. venv/bin/activate
479+
source .venv/bin/activate
489480
# For the API doc, we need to use the local version of plotly
490481
# since we are tweaking the source because of
491482
# graph_objs/graph_objects
492483
if [ "${CIRCLE_BRANCH}" == "doc-prod" ]; then
493-
pip uninstall -y plotly
484+
uv pip uninstall plotly
494485
cd ..
495-
pip install -e .
486+
uv pip install -e .
496487
cd doc
497488
cd apidoc
498489
make html

0 commit comments

Comments
 (0)