From 69ed02cf9e0d2a66a0ba8bb406b89b5d9ca2ff4e Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Wed, 15 Jan 2025 17:53:44 -0500 Subject: [PATCH 01/13] copy over text from release.md in plotly.py --- release.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 release.md diff --git a/release.md b/release.md new file mode 100644 index 0000000..e69de29 From 40eb7eacb2ee6bfa5c9e75a6a2a4c11d70d84149 Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Wed, 15 Jan 2025 17:58:43 -0500 Subject: [PATCH 02/13] update paths, branch names, tags --- release.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/release.md b/release.md index e69de29..f6f1950 100644 --- a/release.md +++ b/release.md @@ -0,0 +1,46 @@ +## Release process - `chart-studio` package + +The `chart-studio` package contains the utilities for interacting with +Chart Studio (both Cloud or On-Prem). + +### Update version + +Update the version of the `chart-studio` package in +`setup.py`. + +This version is not intended to match the version of plotly.py. + +### Update CHANGELOG + +Add a new entry to the CHANGELOG at `CHANGELOG.md` and commit the changes. + +### Tag Release + +Create a new tag for the release + +```bash +(plotly_dev) $ git checkout main +(plotly_dev) $ git stash +(plotly_dev) $ git pull origin main +(plotly_dev) $ git tag vX.Y.Z +(plotly_dev) $ git push origin vX.Y.Z +``` + +### Publishing to PYPI + +Publish the final version to PyPI + +```bash +(plotly_dev) $ python setup.py sdist bdist_wheel +(plotly_dev) $ twine upload dist/chart_studio-X.Y.Z.tar.gz +(plotly_dev) $ twine upload dist/chart_studio-X.Y.Z-py3-none-any.whl +``` + +### Publish to plotly anaconda channel + +From `packages/python/plotly-geo`, build the conda package +```bash +(plotly_dev) $ conda build recipe/ +``` + +Then upload to the plotly anaconda channel as described above. \ No newline at end of file From b17139c6c2a0e3bdb36f24b5211c50f450a35def Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Wed, 15 Jan 2025 17:59:05 -0500 Subject: [PATCH 03/13] update year --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index 359e5d3..2d78924 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016-2019 Plotly, Inc +Copyright (c) 2016-2025 Plotly, Inc Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 85bed22187c2deb226d786073dddfac8ef63f7dd Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Wed, 15 Jan 2025 18:00:14 -0500 Subject: [PATCH 04/13] update URLs and tags --- setup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5342b1f..7bfa466 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ def readme(): maintainer="Jon Mease", maintainer_email="jon@plot.ly", url="https://plot.ly/python/", - project_urls={"Github": "https://github.com/plotly/plotly.py"}, + project_urls={"Github": "https://github.com/plotly/chart-studio"}, description="Utilities for interfacing with plotly's Chart Studio", long_description=readme(), long_description_content_type="text/markdown", @@ -28,6 +28,11 @@ def readme(): "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Scientific/Engineering :: Visualization", ], license="MIT", From 6097ba780b15213243536083aadeb533e18a8de1 Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:09:41 -0500 Subject: [PATCH 05/13] copy over CI for tests --- .circleci/config.yml | 27 +++++++++++++++++++ ...equirements_37.txt => requirements_38.txt} | 0 2 files changed, 27 insertions(+) create mode 100644 .circleci/config.yml rename test_requirements/{requirements_37.txt => requirements_38.txt} (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..a24d403 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,27 @@ +jobs: + python_38_chart_studio: + docker: + - image: cimg/python:3.8 + resource_class: large + + steps: + - checkout + - run: + name: Install dependencies + command: | + python -m venv venv + . venv/bin/activate + pip install --upgrade pip wheel + pip install -r ./test_requirements/requirements_38.txt + - run: + name: Tests + command: | + cd packages/python/chart-studio + . venv/bin/activate + pytest -x chart_studio/tests/ + no_output_timeout: 20m + +workflows: + test: + jobs: + - python_38_chart_studio diff --git a/test_requirements/requirements_37.txt b/test_requirements/requirements_38.txt similarity index 100% rename from test_requirements/requirements_37.txt rename to test_requirements/requirements_38.txt From d1ff3ea38c26662adad4d834c4363630d4f5c026 Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:12:37 -0500 Subject: [PATCH 06/13] unpin versions --- test_requirements/requirements_38.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test_requirements/requirements_38.txt b/test_requirements/requirements_38.txt index 32bba34..9df55ae 100644 --- a/test_requirements/requirements_38.txt +++ b/test_requirements/requirements_38.txt @@ -1,11 +1,11 @@ -decorator==4.0.9 -nose==1.3.7 -requests==2.12.4 -pytz==2016.10 -retrying==1.3.3 -pytest==3.5.1 -pandas==0.23.2 -numpy==1.14.3 +decorator +nose +requests +pytz +retrying +pytest +pandas +plotly +numpy anywidget -matplotlib==2.2.3 ---editable=./plotly +matplotlib From 21b5122e74863d72702309a3c40317157d1939ab Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Tue, 28 Jan 2025 22:59:00 -0500 Subject: [PATCH 07/13] Update README.md Add short explanation of reorg in README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a24b0e4..6fa3abb 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # chart-studio This package contains utilities for interfacing with Plotly's Chart Studio service (both Chart Studio cloud and Chart Studio On-Prem). Prior to plotly.py version 4, This functionality was included in the `plotly` package under the `plotly.plotly` module. As part of plotly.py version 4, the Chart Studio functionality was removed from the `plotly` package and released in this `chart-studio` package. + +_Note: chart-studio was previously housed in the [Plotly.py](https://github.com/plotly/plotly.py) repository [until early 2025](https://github.com/plotly/plotly.py/pull/4972). This repository retains the Git history for all chart-studio files, dating back to [mid-2019](https://github.com/plotly/plotly.py/pull/1604) when the Plotly.py directory structure was changed. If you want to follow the history of these files back further in time, start [here](https://github.com/plotly/plotly.py/commits/59e36cf850bdb2384ddaf40ac37ad79f691c610c/chart-studio-package/README.md?browsing_rename_history=true&new_path=packages/python/chart-studio/README.md&original_branch=master)._ From acc714f144874ba5c5f8decc9cab0a3a715c0169 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Wed, 29 Jan 2025 14:25:03 -0500 Subject: [PATCH 08/13] Update README.md Clarify that this repository does not contain code for the Chart Studio web service --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6fa3abb..f5be159 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ # chart-studio -This package contains utilities for interfacing with Plotly's Chart Studio service (both Chart Studio cloud and Chart Studio On-Prem). Prior to plotly.py version 4, This functionality was included in the `plotly` package under the `plotly.plotly` module. As part of plotly.py version 4, the Chart Studio functionality was removed from the `plotly` package and released in this `chart-studio` package. +The chart-studio Python package contains utilities for interfacing with Plotly's Chart Studio service (both Chart Studio cloud and Chart Studio On-Prem). + +Prior to plotly.py version 4, these Chart Studio utilities were included in the `plotly` package under the `plotly.plotly` module. As part of plotly.py version 4, the Chart Studio functionality was removed from the `plotly` package and released in this `chart-studio` package. + +This repository contains _only_ the chart-studio Python package; code for the Chart Studio service itself is located elsewhere. _Note: chart-studio was previously housed in the [Plotly.py](https://github.com/plotly/plotly.py) repository [until early 2025](https://github.com/plotly/plotly.py/pull/4972). This repository retains the Git history for all chart-studio files, dating back to [mid-2019](https://github.com/plotly/plotly.py/pull/1604) when the Plotly.py directory structure was changed. If you want to follow the history of these files back further in time, start [here](https://github.com/plotly/plotly.py/commits/59e36cf850bdb2384ddaf40ac37ad79f691c610c/chart-studio-package/README.md?browsing_rename_history=true&new_path=packages/python/chart-studio/README.md&original_branch=master)._ From d92420925a424f247225ce4c0d6f9803fd993ee0 Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Wed, 29 Jan 2025 22:05:47 -0500 Subject: [PATCH 09/13] bring tests up to date --- .../tests/test_optional/test_matplotlylib/test_plot_mpl.py | 5 ++++- chart_studio/tests/test_optional/test_utils/test_utils.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/chart_studio/tests/test_optional/test_matplotlylib/test_plot_mpl.py b/chart_studio/tests/test_optional/test_matplotlylib/test_plot_mpl.py index 8ca3614..3691c3c 100644 --- a/chart_studio/tests/test_optional/test_matplotlylib/test_plot_mpl.py +++ b/chart_studio/tests/test_optional/test_matplotlylib/test_plot_mpl.py @@ -44,7 +44,10 @@ def test_update(self): ax.plot([1, 2, 3]) title = "new title" update = {"layout": {"title": title}} - url = py.plot_mpl(fig, update=update, filename="nosetests", auto_open=False) + # Note: Changed filename from "nosetests" to "nosetests2" because the + # previous filename was resulting in a recurring error -- + # `chart_studio.exceptions.PlotlyRequestError: Sorry, a file named 'nosetests_grid' already exists` + url = py.plot_mpl(fig, update=update, filename="nosetests2", auto_open=False) un = url.replace("https://plotly.com/~", "").split("/")[0] fid = url.replace("https://plotly.com/~", "").split("/")[1] pfig = py.get_figure(un, fid) diff --git a/chart_studio/tests/test_optional/test_utils/test_utils.py b/chart_studio/tests/test_optional/test_utils/test_utils.py index b72962d..742a1b2 100644 --- a/chart_studio/tests/test_optional/test_utils/test_utils.py +++ b/chart_studio/tests/test_optional/test_utils/test_utils.py @@ -6,7 +6,7 @@ from datetime import datetime as dt import numpy as np -np_list = np.array([1, 2, 3, np.NaN, np.NAN, np.Inf, dt(2014, 1, 5)]) +np_list = np.array([1, 2, 3, np.nan, np.nan, np.inf, dt(2014, 1, 5)]) numeric_list = [1, 2, 3] mixed_list = [ 1, From 49eef4e88e63f0e0f82270ac184641970d018785 Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Wed, 29 Jan 2025 22:06:00 -0500 Subject: [PATCH 10/13] add .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bee8a64 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__ From 8ebc0113cfef7cd25af8c8c1908b9c63274f4c42 Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Wed, 29 Jan 2025 23:06:31 -0500 Subject: [PATCH 11/13] update tests for plotly.py 6.0 --- .../tests/test_plot_ly/test_get_figure/test_get_figure.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/chart_studio/tests/test_plot_ly/test_get_figure/test_get_figure.py b/chart_studio/tests/test_plot_ly/test_get_figure/test_get_figure.py index 04816fe..72ac805 100644 --- a/chart_studio/tests/test_plot_ly/test_get_figure/test_get_figure.py +++ b/chart_studio/tests/test_plot_ly/test_get_figure/test_get_figure.py @@ -94,4 +94,9 @@ def test_proper_escaping(self): ak = "786r5mecv0" url = "https://plotly.com/~PlotlyImageTest/13185/" py.sign_in(un, ak) - py.get_figure(url) + # Note: raw=True added because the specified chart contains + # the property 'titlefont' which is no longer supported in + # plotly.py 6.0.0, so an error is raised when trying to create + # the chart object. raw=True just returns the raw JSON without + # trying to create the chart object. + py.get_figure(url, raw=True) From edc4c0384214f6b1d663738254a6d74f8e1d817f Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Wed, 29 Jan 2025 23:16:34 -0500 Subject: [PATCH 12/13] migrate circleci workflow to github actions --- .circleci/config.yml | 27 --------------------------- .github/workflows/config.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 27 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index a24d403..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,27 +0,0 @@ -jobs: - python_38_chart_studio: - docker: - - image: cimg/python:3.8 - resource_class: large - - steps: - - checkout - - run: - name: Install dependencies - command: | - python -m venv venv - . venv/bin/activate - pip install --upgrade pip wheel - pip install -r ./test_requirements/requirements_38.txt - - run: - name: Tests - command: | - cd packages/python/chart-studio - . venv/bin/activate - pytest -x chart_studio/tests/ - no_output_timeout: 20m - -workflows: - test: - jobs: - - python_38_chart_studio diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml new file mode 100644 index 0000000..db36105 --- /dev/null +++ b/.github/workflows/config.yml @@ -0,0 +1,26 @@ +name: Run unit tests (Python 3.8) +on: [ push ] + +jobs: + python_38_chart_studio: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.8' + - name: Install dependencies + run: | + python -m venv venv + . venv/bin/activate + pip install --upgrade pip wheel + pip install -r ./test_requirements/requirements_38.txt + - name: Run unit tests + run: | + cd packages/python/chart-studio + . venv/bin/activate + pytest -x chart_studio/tests/ + timeout-minutes: 20 + From 3ff831700d087da5d4fe518f0e2d3f89c4dbcdae Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Thu, 30 Jan 2025 09:51:54 -0500 Subject: [PATCH 13/13] remove unnecessary cd --- .github/workflows/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index db36105..e61a3ce 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -19,7 +19,6 @@ jobs: pip install -r ./test_requirements/requirements_38.txt - name: Run unit tests run: | - cd packages/python/chart-studio . venv/bin/activate pytest -x chart_studio/tests/ timeout-minutes: 20