Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat: add type annotations to generated code #5008

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

Draft
wants to merge 11 commits into
base: main
Choose a base branch
Loading
from
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
162 changes: 56 additions & 106 deletions 162 .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ commands:
command: |
python -m venv venv
. venv/bin/activate
pip install --upgrade pip wheel
pip install -e .
pip install -r ./test_requirements/requirements_<<parameters.py>>_core.txt
- run:
name: Test core
command: |
. venv/bin/activate
pytest plotly/tests/test_core
python -m pytest tests/test_core
no_output_timeout: 20m

test_optional:
Expand All @@ -39,52 +39,53 @@ commands:
- run:
name: Install dependencies
command: |
python -m venv venv
. venv/bin/activate
pip install --upgrade pip wheel
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
pytest plotly/tests/test_core
source .venv/bin/activate
python -m pytest tests/test_core
no_output_timeout: 20m
- run:
name: Test optional
command: |
. venv/bin/activate
pytest plotly/tests/test_optional
source .venv/bin/activate
python -m pytest tests/test_optional
no_output_timeout: 40m
- run:
name: Test utils
command: |
. venv/bin/activate
pytest _plotly_utils/tests/
source .venv/bin/activate
python -m pytest tests/test_plotly_utils/
no_output_timeout: 20m
- run:
name: Test io
command: |
. venv/bin/activate
pytest plotly/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
pytest -x test_init/test_dependencies_not_imported.py
source .venv/bin/activate
python -m pytest -x test_init/test_dependencies_not_imported.py
- run:
name: Test lazy imports
command: |
. venv/bin/activate
pytest -x test_init/test_lazy_imports.py
source .venv/bin/activate
python -m pytest -x test_init/test_lazy_imports.py
test_orca:
parameters:
py:
Expand All @@ -99,7 +100,6 @@ commands:
command: |
python -m venv venv
. venv/bin/activate
pip install --upgrade pip wheel
pip install -r ./test_requirements/requirements_<<parameters.py>>_optional.txt
- run:
name: Install plotly-geo
Expand All @@ -118,10 +118,10 @@ commands:
name: Test orca
command: |
. venv/bin/activate
pytest plotly/tests/test_orca
pytest tests/test_orca
no_output_timeout: 20m
- store_artifacts:
path: plotly/tests/test_orca/images/linux/failed
path: tests/test_orca/images/linux/failed

jobs:
check-code-formatting:
Expand Down Expand Up @@ -269,7 +269,6 @@ jobs:
command: |
python -m venv venv
. venv/bin/activate
pip install --upgrade pip wheel
pip install -e .
pip install plotly-geo
pip install -r test_requirements/requirements_39_pandas_2_optional.txt
Expand All @@ -278,28 +277,28 @@ jobs:
name: Build html figures (Pandas 2)
command: |
. venv/bin/activate
python test/percy/plotly-express.py
python tests/percy/plotly-express.py
- run:
name: Build html figures (Pandas 1) and compare
command: |
. venv/bin/activate
mkdir test/percy/pandas2
mv test/percy/*.html test/percy/pandas2/
mkdir tests/percy/pandas2
mv tests/percy/*.html tests/percy/pandas2/
# 1.1 is the earliest minor with Py3.9 wheels
pip install "pandas==1.1.5"
python test/percy/plotly-express.py
python test/percy/compare-pandas.py
rm -rf test/percy/pandas2
python tests/percy/plotly-express.py
python tests/percy/compare-pandas.py
rm -rf tests/percy/pandas2
- run:
name: Run percy snapshots
command: |
npm i @percy/cli
npx percy snapshot -c test/percy/snapshots.yml test/percy/
rm test/percy/*.html
npx percy snapshot -c tests/percy/snapshots.yml tests/percy/
rm tests/percy/*.html

plotlyjs_dev_build:
docker:
- image: cimg/python:3.8-node
- image: cimg/python:3.11-node
environment:
LANG: en_US.UTF-8
resource_class: large
Expand All @@ -311,25 +310,20 @@ jobs:
command: |
python -m venv venv
. venv/bin/activate
pip install --upgrade pip wheel
pip install -r ./test_requirements/requirements_38_core.txt black inflect
pip install -e .
pip install -r ./test_requirements/requirements_311_core.txt black inflect
pip install jupyterlab
- run:
name: Update jupyter widget plotly.js version
command: |
. venv/bin/activate
python setup.py updateplotlywidgetversion
- run:
name: Update plotly.js to dev
command: |
. venv/bin/activate
python setup.py updateplotlyjsdev
python commands.py updateplotlyjsdev
- run:
name: Test core
command: |
. venv/bin/activate
locale
pytest -k 'not nodev' plotly/tests/test_core
pytest -k 'not nodev' tests/test_core
no_output_timeout: 20m
- run:
name: Commit
Expand All @@ -343,36 +337,27 @@ jobs:
name: Build source distribution packages
command: |
. venv/bin/activate
python setup.py sdist
pip install build
python -m build --sdist --wheel -o dist
when: always
- store_artifacts:
path: dist/

full_build:
docker:
- image: continuumio/miniconda3:24.3.0-0
- image: cimg/python:3.11-node
environment:
LANG: en_US.UTF-8
resource_class: large

steps:
- checkout

- run:
name: Create conda environment
command: |
conda config --remove channels defaults
conda config --add channels conda-forge
conda create -n env --yes python=3.9 conda-build=3.28.4 conda-verify
conda install -n env -c conda-forge jupyterlab nodejs=16
conda init bash
mkdir output

- run:
name: initial NPM Build
command: |
eval "$(conda shell.bash hook)"
conda activate env
python -m venv venv
. venv/bin/activate
cd js
npm ci
npm run build
Expand All @@ -381,41 +366,17 @@ jobs:
- run:
name: PyPI Build
command: |
eval "$(conda shell.bash hook)"
conda activate env
python setup.py sdist bdist_wheel
cp -R dist output/dist
git status

- run:
name: Conda Build
command: |
eval "$(conda shell.bash hook)"
conda activate env
conda build recipe/
mv /opt/conda/envs/env/conda-bld/noarch/plotly*.tar.bz2 output/
. venv/bin/activate
pip install build
python -m build --sdist --wheel -o dist
cp -R dist output
git status

- run:
name: Build Widget javascript bundle
command: |
eval "$(conda shell.bash hook)"
conda activate env
cd js
npm ci
npm run build

- run:
name: Zip output
command: |
tar czf output.tgz output

- run:
name: Git Diff
command: |
git status
git diff

- store_artifacts:
path: output.tgz

Expand All @@ -432,26 +393,21 @@ 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 install --upgrade pip wheel
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 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 @@ -467,17 +423,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 @@ -526,14 +476,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
2 changes: 0 additions & 2 deletions 2 .flake8

This file was deleted.

1 change: 0 additions & 1 deletion 1 .gitattributes

This file was deleted.

4 changes: 2 additions & 2 deletions 4 .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ below :-).
### Documentation PR

- [ ] I've [seen the `doc/README.md` file](https://github.com/plotly/plotly.py/blob/master/doc/README.md)
- [ ] This change runs in the current version of Plotly on PyPI and targets the `doc-prod` branch OR it targets the `master` branch
- [ ] This change runs in the current version of Plotly on PyPI and targets the `doc-prod` branch OR it targets the `main` branch
- [ ] If this PR modifies the first example in a page or adds a new one, it is a `px` example if at all possible
- [ ] Every new/modified example has a descriptive title and motivating sentence or paragraph
- [ ] Every new/modified example is independently runnable
Expand All @@ -27,7 +27,7 @@ below :-).

## Code PR

- [ ] 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.
- [ ] 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.
- [ ] I have added tests (if submitting a new feature or correcting a bug) or
modified existing tests.
- [ ] For a new feature, I have added documentation examples in an existing or
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.