Skip to content

Commit e8093f9

Browse files
committed
merging latest bundle size reduction changes
2 parents f949f65 + d339c7b commit e8093f9

File tree

15,058 files changed

+247131
-266864
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

15,058 files changed

+247131
-266864
lines changed

.circleci/config.yml

Lines changed: 56 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ commands:
1818
command: |
1919
python -m venv venv
2020
. venv/bin/activate
21-
pip install --upgrade pip wheel
21+
pip install -e .
2222
pip install -r ./test_requirements/requirements_<<parameters.py>>_core.txt
2323
- run:
2424
name: Test core
2525
command: |
2626
. venv/bin/activate
27-
pytest plotly/tests/test_core
27+
python -m pytest tests/test_core
2828
no_output_timeout: 20m
2929

3030
test_optional:
@@ -39,52 +39,53 @@ commands:
3939
- run:
4040
name: Install dependencies
4141
command: |
42-
python -m venv venv
43-
. venv/bin/activate
44-
pip install --upgrade pip wheel
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 plotly/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 plotly/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 _plotly_utils/tests/
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 plotly/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-
pytest -x test_init/test_dependencies_not_imported.py
82+
source .venv/bin/activate
83+
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-
pytest -x test_init/test_lazy_imports.py
87+
source .venv/bin/activate
88+
python -m pytest -x test_init/test_lazy_imports.py
8889
test_orca:
8990
parameters:
9091
py:
@@ -99,7 +100,6 @@ commands:
99100
command: |
100101
python -m venv venv
101102
. venv/bin/activate
102-
pip install --upgrade pip wheel
103103
pip install -r ./test_requirements/requirements_<<parameters.py>>_optional.txt
104104
- run:
105105
name: Install plotly-geo
@@ -118,10 +118,10 @@ commands:
118118
name: Test orca
119119
command: |
120120
. venv/bin/activate
121-
pytest plotly/tests/test_orca
121+
pytest tests/test_orca
122122
no_output_timeout: 20m
123123
- store_artifacts:
124-
path: plotly/tests/test_orca/images/linux/failed
124+
path: tests/test_orca/images/linux/failed
125125

126126
jobs:
127127
check-code-formatting:
@@ -269,7 +269,6 @@ jobs:
269269
command: |
270270
python -m venv venv
271271
. venv/bin/activate
272-
pip install --upgrade pip wheel
273272
pip install -e .
274273
pip install plotly-geo
275274
pip install -r test_requirements/requirements_39_pandas_2_optional.txt
@@ -278,28 +277,28 @@ jobs:
278277
name: Build html figures (Pandas 2)
279278
command: |
280279
. venv/bin/activate
281-
python test/percy/plotly-express.py
280+
python tests/percy/plotly-express.py
282281
- run:
283282
name: Build html figures (Pandas 1) and compare
284283
command: |
285284
. venv/bin/activate
286-
mkdir test/percy/pandas2
287-
mv test/percy/*.html test/percy/pandas2/
285+
mkdir tests/percy/pandas2
286+
mv tests/percy/*.html tests/percy/pandas2/
288287
# 1.1 is the earliest minor with Py3.9 wheels
289288
pip install "pandas==1.1.5"
290-
python test/percy/plotly-express.py
291-
python test/percy/compare-pandas.py
292-
rm -rf test/percy/pandas2
289+
python tests/percy/plotly-express.py
290+
python tests/percy/compare-pandas.py
291+
rm -rf tests/percy/pandas2
293292
- run:
294293
name: Run percy snapshots
295294
command: |
296295
npm i @percy/cli
297-
npx percy snapshot -c test/percy/snapshots.yml test/percy/
298-
rm test/percy/*.html
296+
npx percy snapshot -c tests/percy/snapshots.yml tests/percy/
297+
rm tests/percy/*.html
299298
300299
plotlyjs_dev_build:
301300
docker:
302-
- image: cimg/python:3.8-node
301+
- image: cimg/python:3.11-node
303302
environment:
304303
LANG: en_US.UTF-8
305304
resource_class: large
@@ -311,25 +310,20 @@ jobs:
311310
command: |
312311
python -m venv venv
313312
. venv/bin/activate
314-
pip install --upgrade pip wheel
315-
pip install -r ./test_requirements/requirements_38_core.txt black inflect
313+
pip install -e .
314+
pip install -r ./test_requirements/requirements_311_core.txt black inflect
316315
pip install jupyterlab
317-
- run:
318-
name: Update jupyter widget plotly.js version
319-
command: |
320-
. venv/bin/activate
321-
python setup.py updateplotlywidgetversion
322316
- run:
323317
name: Update plotly.js to dev
324318
command: |
325319
. venv/bin/activate
326-
python setup.py updateplotlyjsdev
320+
python commands.py updateplotlyjsdev
327321
- run:
328322
name: Test core
329323
command: |
330324
. venv/bin/activate
331325
locale
332-
pytest -k 'not nodev' plotly/tests/test_core
326+
pytest -k 'not nodev' tests/test_core
333327
no_output_timeout: 20m
334328
- run:
335329
name: Commit
@@ -343,36 +337,27 @@ jobs:
343337
name: Build source distribution packages
344338
command: |
345339
. venv/bin/activate
346-
python setup.py sdist
340+
pip install build
341+
python -m build --sdist --wheel -o dist
347342
when: always
348343
- store_artifacts:
349344
path: dist/
350345

351346
full_build:
352347
docker:
353-
- image: continuumio/miniconda3:24.3.0-0
348+
- image: cimg/python:3.11-node
354349
environment:
355350
LANG: en_US.UTF-8
356351
resource_class: large
357352

358353
steps:
359354
- checkout
360355

361-
- run:
362-
name: Create conda environment
363-
command: |
364-
conda config --remove channels defaults
365-
conda config --add channels conda-forge
366-
conda create -n env --yes python=3.9 conda-build=3.28.4 conda-verify
367-
conda install -n env -c conda-forge jupyterlab nodejs=16
368-
conda init bash
369-
mkdir output
370-
371356
- run:
372357
name: initial NPM Build
373358
command: |
374-
eval "$(conda shell.bash hook)"
375-
conda activate env
359+
python -m venv venv
360+
. venv/bin/activate
376361
cd js
377362
npm ci
378363
npm run build
@@ -381,41 +366,17 @@ jobs:
381366
- run:
382367
name: PyPI Build
383368
command: |
384-
eval "$(conda shell.bash hook)"
385-
conda activate env
386-
python setup.py sdist bdist_wheel
387-
cp -R dist output/dist
388-
git status
389-
390-
- run:
391-
name: Conda Build
392-
command: |
393-
eval "$(conda shell.bash hook)"
394-
conda activate env
395-
conda build recipe/
396-
mv /opt/conda/envs/env/conda-bld/noarch/plotly*.tar.bz2 output/
369+
. venv/bin/activate
370+
pip install build
371+
python -m build --sdist --wheel -o dist
372+
cp -R dist output
397373
git status
398374
399-
- run:
400-
name: Build Widget javascript bundle
401-
command: |
402-
eval "$(conda shell.bash hook)"
403-
conda activate env
404-
cd js
405-
npm ci
406-
npm run build
407-
408375
- run:
409376
name: Zip output
410377
command: |
411378
tar czf output.tgz output
412379
413-
- run:
414-
name: Git Diff
415-
command: |
416-
git status
417-
git diff
418-
419380
- store_artifacts:
420381
path: output.tgz
421382

@@ -432,26 +393,21 @@ jobs:
432393
- "dc:5f:39:48:00:b4:72:34:e1:d2:c4:e1:1f:d1:e2:ce" #plotlydocbot
433394

434395
- checkout
435-
436-
# Download and cache dependencies
437-
- restore_cache:
438-
key: v2-dependencies-{{ checksum "doc/requirements.txt" }}-{{ checksum ".circleci/config.yml" }}
439396
- browser-tools/install-chrome
440397
- browser-tools/install-chromedriver
441398

442399
- run:
443400
name: install dependencies
444401
command: |
445402
cd doc
446-
python -m venv venv
447-
. venv/bin/activate
448-
pip install --upgrade pip wheel
449-
pip uninstall -y plotly
450-
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
451407
if [ "${CIRCLE_BRANCH}" != "doc-prod" ]; then
452-
pip uninstall -y plotly
408+
uv pip uninstall plotly
453409
cd ..
454-
pip install -e .
410+
uv pip install -e .
455411
cd js
456412
npm ci
457413
npm run build
@@ -467,17 +423,11 @@ jobs:
467423
sudo apt-get install -y poppler-utils libxtst6 xvfb libgtk2.0-0 libgconf-2-4 libnss3 libasound2 rename
468424
echo 'export PATH="/home/circleci/project/node_modules/.bin:$PATH"' >> $BASH_ENV
469425
470-
- save_cache:
471-
paths:
472-
- ./doc/venv
473-
- ./doc/node_modules
474-
key: v1-dependencies-{{ checksum "doc/requirements.txt" }}-{{ checksum ".circleci/config.yml" }}
475-
476426
- run:
477427
name: make html
478428
command: |
479429
cd doc
480-
. venv/bin/activate
430+
source .venv/bin/activate
481431
echo ${mapbox_token} > python/.mapbox_token
482432
make -kj8 || make -kj8
483433
curl https://raw.githubusercontent.com/plotly/graphing-library-docs/master/front-matter-ci.py > front-matter-ci.py
@@ -526,14 +476,14 @@ jobs:
526476
name: make doc
527477
command: |
528478
cd doc
529-
. venv/bin/activate
479+
source .venv/bin/activate
530480
# For the API doc, we need to use the local version of plotly
531481
# since we are tweaking the source because of
532482
# graph_objs/graph_objects
533483
if [ "${CIRCLE_BRANCH}" == "doc-prod" ]; then
534-
pip uninstall -y plotly
484+
uv pip uninstall plotly
535485
cd ..
536-
pip install -e .
486+
uv pip install -e .
537487
cd doc
538488
cd apidoc
539489
make html

.flake8

Lines changed: 0 additions & 2 deletions
This file was deleted.

.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/pull_request_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ below :-).
77
### Documentation PR
88
99
- [ ] I've [seen the `doc/README.md` file](https://github.com/plotly/plotly.py/blob/master/doc/README.md)
10-
- [ ] This change runs in the current version of Plotly on PyPI and targets the `doc-prod` branch OR it targets the `master` branch
10+
- [ ] This change runs in the current version of Plotly on PyPI and targets the `doc-prod` branch OR it targets the `main` branch
1111
- [ ] If this PR modifies the first example in a page or adds a new one, it is a `px` example if at all possible
1212
- [ ] Every new/modified example has a descriptive title and motivating sentence or paragraph
1313
- [ ] Every new/modified example is independently runnable
@@ -27,7 +27,7 @@ below :-).
2727
2828
## Code PR
2929
30-
- [ ] I have read through the [contributing notes](https://github.com/plotly/plotly.py/blob/master/contributing.md) and understand the structure of the package. In particular, if my PR modifies code of `plotly.graph_objects`, my modifications concern the `codegen` files and not generated files.
30+
- [ ] I have read through the [contributing notes](https://github.com/plotly/plotly.py/blob/master/CONTRIBUTING.md) and understand the structure of the package. In particular, if my PR modifies code of `plotly.graph_objects`, my modifications concern the `codegen` files and not generated files.
3131
- [ ] I have added tests (if submitting a new feature or correcting a bug) or
3232
modified existing tests.
3333
- [ ] For a new feature, I have added documentation examples in an existing or

0 commit comments

Comments
 (0)