From ebd06f8ef6f89a2a75e8d21ce5d348726d0b9950 Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Tue, 11 Feb 2025 13:26:42 -0600 Subject: [PATCH 01/10] Use uv instead of pip for CI download --- .circleci/config.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6bbc74db2d..ff49a8b65f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,9 +39,10 @@ commands: - run: name: Install dependencies command: | - python -m venv venv - . venv/bin/activate - pip install -e . + curl -LsSf https://astral.sh/uv/install.sh | sh + uv venv + source .venv/bin/activate + uv pip install . pip install -r ./test_requirements/requirements_<>_optional.txt cd js npm ci From d69f1dc1686bc8a90ed497ccd6f8d9e596c2f8fb Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Tue, 11 Feb 2025 13:27:46 -0600 Subject: [PATCH 02/10] Update dependencies download to use uv --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ff49a8b65f..5b706cb733 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -43,7 +43,7 @@ commands: uv venv source .venv/bin/activate uv pip install . - pip install -r ./test_requirements/requirements_<>_optional.txt + uv pip install -r ./test_requirements/requirements_<>_optional.txt cd js npm ci npm run build @@ -77,7 +77,7 @@ commands: pytest tests/test_io no_output_timeout: 20m - run: - name: Test dependencdies not imported + name: Test dependencies not imported command: | . venv/bin/activate python -m pytest -x test_init/test_dependencies_not_imported.py From 84dde9e046af05488711f323b5b666ce0dd167f3 Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Tue, 11 Feb 2025 13:30:42 -0600 Subject: [PATCH 03/10] Fix plotly-geo install --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5b706cb733..93da24f776 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,8 +50,8 @@ commands: - 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: | From 69a39b93556f6a709c980f22366c1926a9d742a0 Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Tue, 11 Feb 2025 13:33:04 -0600 Subject: [PATCH 04/10] Use correct venv activate step --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 93da24f776..1e2d10ba7f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -55,36 +55,36 @@ commands: - 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 + source .venv/bin/activate pytest tests/test_io no_output_timeout: 20m - run: 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: From 4fc33b53a157c828ece7ee29c8a2698383ee58b3 Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Tue, 11 Feb 2025 13:40:01 -0600 Subject: [PATCH 05/10] Run pytest through python to fix dependency issue --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1e2d10ba7f..aac90980c1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -74,7 +74,7 @@ commands: name: Test io command: | source .venv/bin/activate - pytest tests/test_io + python -m pytest tests/test_io no_output_timeout: 20m - run: name: Test dependencies not imported From 632cf322b8238d732897ca0ee4b36042d3cdc711 Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Tue, 11 Feb 2025 13:48:55 -0600 Subject: [PATCH 06/10] Add uv for doc build --- .circleci/config.yml | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index aac90980c1..9da537c427 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -393,10 +393,6 @@ 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 @@ -404,14 +400,15 @@ jobs: 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 -y plotly + uv pip install -r requirements.txt if [ "${CIRCLE_BRANCH}" != "doc-prod" ]; then - pip uninstall -y plotly + uv pip uninstall -y plotly cd .. - pip install -e . + uv pip install -e . cd js npm ci npm run build @@ -427,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 @@ -486,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 -y plotly cd .. - pip install -e . + uv pip install -e . cd doc cd apidoc make html From 5981bfb6c2ce7bc64207d6496ccddf47328ede6d Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Tue, 11 Feb 2025 13:51:06 -0600 Subject: [PATCH 07/10] Remove flag that doesn't work for uv --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9da537c427..4828f13748 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -482,7 +482,7 @@ jobs: # since we are tweaking the source because of # graph_objs/graph_objects if [ "${CIRCLE_BRANCH}" == "doc-prod" ]; then - uv pip uninstall -y plotly + uv pip uninstall plotly cd .. uv pip install -e . cd doc From ffb2b2543d0abb7cf3312c8c5e0b7b5f0c5d1fb1 Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Tue, 11 Feb 2025 13:53:27 -0600 Subject: [PATCH 08/10] Remove flag that doesn't work for uv --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4828f13748..8ed5238187 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -403,10 +403,10 @@ jobs: curl -LsSf https://astral.sh/uv/install.sh | sh uv venv source .venv/bin/activate - uv pip uninstall -y plotly + uv pip uninstall plotly uv pip install -r requirements.txt if [ "${CIRCLE_BRANCH}" != "doc-prod" ]; then - uv pip uninstall -y plotly + uv pip uninstall plotly cd .. uv pip install -e . cd js From fe8b92e179e2079b3fc1f94535982ecb60a4a6fd Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Tue, 11 Feb 2025 14:08:12 -0600 Subject: [PATCH 09/10] Remove unnecessary uninstall step --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8ed5238187..96794fefa7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -403,7 +403,6 @@ jobs: 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 uv pip uninstall plotly From cfce34f820ff682f491da7e7c8bf7f999c2706b3 Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Tue, 11 Feb 2025 14:15:04 -0600 Subject: [PATCH 10/10] Make calls to pytest wrapped by python -m --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 96794fefa7..b987698aae 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,7 +24,7 @@ commands: name: Test core command: | . venv/bin/activate - pytest tests/test_core + python -m pytest tests/test_core no_output_timeout: 20m test_optional: @@ -56,19 +56,19 @@ commands: name: Test core command: | source .venv/bin/activate - pytest tests/test_core + python -m pytest tests/test_core no_output_timeout: 20m - run: name: Test optional command: | source .venv/bin/activate - pytest tests/test_optional + python -m pytest tests/test_optional no_output_timeout: 40m - run: name: Test utils command: | source .venv/bin/activate - pytest tests/test_plotly_utils/ + python -m pytest tests/test_plotly_utils/ no_output_timeout: 20m - run: name: Test io