Skip to content

Commit

Permalink
Merge pull request #4970 from plotly/use-pyprojecttoml
Browse files Browse the repository at this point in the history
Move package metadata into pyproject.toml and all other python code into separate file
  • Loading branch information
marthacryan authored Feb 7, 2025
2 parents 19b611d + 10b2b87 commit e41dcab
Show file tree
Hide file tree
Showing 160 changed files with 458 additions and 3,585 deletions.
87 changes: 23 additions & 64 deletions .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
python -m pytest plotly/tests/test_core
pytest tests/test_core
no_output_timeout: 20m

test_optional:
Expand All @@ -41,7 +41,7 @@ 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>>_optional.txt
cd js
npm ci
Expand All @@ -55,25 +55,25 @@ commands:
name: Test core
command: |
. venv/bin/activate
python -m pytest plotly/tests/test_core
pytest tests/test_core
no_output_timeout: 20m
- run:
name: Test optional
command: |
. venv/bin/activate
python -m pytest plotly/tests/test_optional
pytest tests/test_optional
no_output_timeout: 40m
- run:
name: Test utils
command: |
. venv/bin/activate
python -m pytest _plotly_utils/tests/
pytest tests/test_plotly_utils/
no_output_timeout: 20m
- run:
name: Test io
command: |
. venv/bin/activate
python -m pytest plotly/tests/test_io
pytest tests/test_io
no_output_timeout: 20m
- run:
name: Test dependencdies not imported
Expand All @@ -99,7 +99,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 +117,10 @@ commands:
name: Test orca
command: |
. venv/bin/activate
python -m 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 +268,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 Down Expand Up @@ -299,7 +297,7 @@ jobs:
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 +309,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
python -m 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 +336,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 +365,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 Down Expand Up @@ -445,7 +405,6 @@ jobs:
cd doc
python -m venv venv
. venv/bin/activate
pip install --upgrade pip wheel
pip uninstall -y plotly
pip install -r requirements.txt
if [ "${CIRCLE_BRANCH}" != "doc-prod" ]; then
Expand Down
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

11 changes: 4 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
0
0.html
iframe_figures/
plotly/tests/test_orca/images/linux/failed/
tests/test_orca/images/linux/failed/

*.egg-info

Expand Down Expand Up @@ -49,19 +49,16 @@ plotly.egg-info/
# macOS utility file
**/.DS_Store

plotly/tests/test_orca/images/*/failed
plotly/tests/test_orca/images/*/tmp
/plotly-package/plotly/tests/test_core/test_offline/plotly.min.js
tests/test_orca/images/*/failed
tests/test_orca/images/*/tmp
tests/test_core/test_offline/plotly.min.js
temp-plot.html
.vscode
doc/python/.ipynb_checkpoints
doc/python/.mapbox_token
doc/.ipynb_checkpoints
tags
doc/check-or-enforce-order.py

jupyterlab_plotly/labextension/
jupyterlab_plotly/nbextension/index.js*
plotly/package_data/widgetbundle.js

test/percy/*.html
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
include LICENSE.txt
include README.md
include versioneer.py
include plotly/_version.py
include requires-install.txt
include requires-express.txt
include plotly/package_data/widgetbundle.js
Loading

0 comments on commit e41dcab

Please sign in to comment.