From 4c02f6ab5885b70a52f96ac50331722326dfc474 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 18:25:03 +0400 Subject: [PATCH 01/36] Create renovate.json --- .github/renovate.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/renovate.json diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 00000000..fb707bc3 --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,19 @@ +{ + "extends": [ + "config:recommended", + ":enablePreCommit", + ":automergeMinor", + ":dependencyDashboard", + ":semanticCommits", + ":pinVersions" + ], + "enabledManagers": [ + "pip_requirements", + "pre-commit", + "github-actions" + ], + "timezone": "Asia/Dubai", + "schedule": [ + "before 10am on wednesday" + ] +} From 66bd2a3e891e93ec60feae20e9092156f201cfca Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 14:29:57 +0000 Subject: [PATCH 02/36] chore(deps): update astral-sh/setup-uv action to v5 --- .github/workflows/publish_testpypi.yml | 4 ++-- .github/workflows/test.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish_testpypi.yml b/.github/workflows/publish_testpypi.yml index ee943963..76d60e60 100644 --- a/.github/workflows/publish_testpypi.yml +++ b/.github/workflows/publish_testpypi.yml @@ -21,7 +21,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v4 + - uses: astral-sh/setup-uv@v5 - name: Install Dependencies if: ${{ matrix.os == 'ubuntu-latest' }} run: sudo apt-get update && sudo apt-get install xvfb @@ -95,7 +95,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v4 + - uses: astral-sh/setup-uv@v5 - uses: actions/setup-python@v5 with: python-version-file: "./src/py/pyproject.toml" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1bd6f132..1aba10fe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: working-directory: ./src/py/ steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v4 + - uses: astral-sh/setup-uv@v5 - uses: actions/setup-python@v5 with: python-version-file: "./src/py/pyproject.toml" From e405d52ab43068720cef0acb35587e71cef99053 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 18:40:23 +0400 Subject: [PATCH 03/36] specify non-standard location of pre-commit file in renovate.json --- .github/renovate.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/renovate.json b/.github/renovate.json index fb707bc3..9a3ab753 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -15,5 +15,11 @@ "timezone": "Asia/Dubai", "schedule": [ "before 10am on wednesday" + ], + "packageRules": [ + { + "matchManagers": ["pre-commit"], + "matchPaths": ["src/py/.pre-commit-config.yaml"] + } ] } From 140cdbf0f3c281447b7ce9d5650a78215a6ab971 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 18:40:56 +0400 Subject: [PATCH 04/36] Update renovate.json --- .github/renovate.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/renovate.json b/.github/renovate.json index fb707bc3..9a3ab753 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -15,5 +15,11 @@ "timezone": "Asia/Dubai", "schedule": [ "before 10am on wednesday" + ], + "packageRules": [ + { + "matchManagers": ["pre-commit"], + "matchPaths": ["src/py/.pre-commit-config.yaml"] + } ] } From b7b240ed6e278f80b91fc3c4b8f65bafbab4989a Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 18:48:10 +0400 Subject: [PATCH 05/36] Without pre-commit in enabled managers? --- .github/renovate.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/renovate.json b/.github/renovate.json index 9a3ab753..f59cae73 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -9,7 +9,6 @@ ], "enabledManagers": [ "pip_requirements", - "pre-commit", "github-actions" ], "timezone": "Asia/Dubai", From b30a5bcef101c580d5dccc6e62e370f5866af6d6 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 18:52:19 +0400 Subject: [PATCH 06/36] Tell renovate about the location of pyproject.toml --- .github/renovate.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/renovate.json b/.github/renovate.json index f59cae73..d3b120b2 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -19,6 +19,10 @@ { "matchManagers": ["pre-commit"], "matchPaths": ["src/py/.pre-commit-config.yaml"] + }, + { + "matchManagers": ["pep621"], + "matchPaths": ["scr/py/pyproject.toml"] } ] } From 1ccba8fa9e26d3b1918716b634c9eea8f9f95177 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 18:52:53 +0400 Subject: [PATCH 07/36] Update renovate.json --- .github/renovate.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/renovate.json b/.github/renovate.json index d3b120b2..984364ce 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -8,7 +8,6 @@ ":pinVersions" ], "enabledManagers": [ - "pip_requirements", "github-actions" ], "timezone": "Asia/Dubai", From cf5de1ccf22e58e6bdae2aad7544fac308842b1c Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 18:54:37 +0400 Subject: [PATCH 08/36] Update renovate.json --- .github/renovate.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/renovate.json b/.github/renovate.json index 984364ce..f2748e02 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -8,7 +8,9 @@ ":pinVersions" ], "enabledManagers": [ - "github-actions" + "github-actions", + "pep621", + "pre-commit" ], "timezone": "Asia/Dubai", "schedule": [ From 76c4e6b189a8f585b31734ea2a2eeae8d22974f4 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 19:24:26 +0400 Subject: [PATCH 09/36] Update renovate.json --- .github/renovate.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/renovate.json b/.github/renovate.json index f2748e02..0d87b2d4 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -23,7 +23,7 @@ }, { "matchManagers": ["pep621"], - "matchPaths": ["scr/py/pyproject.toml"] + "matchPaths": ["src/py/pyproject.toml"] } ] } From 3460d5fedc3daa66caf81b1d2225d183ef394382 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 19:34:55 +0400 Subject: [PATCH 10/36] Update renovate.json --- .github/renovate.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/renovate.json b/.github/renovate.json index 0d87b2d4..8b2607c4 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -1,4 +1,5 @@ { + "logLevel": "debug", "extends": [ "config:recommended", ":enablePreCommit", @@ -19,7 +20,7 @@ "packageRules": [ { "matchManagers": ["pre-commit"], - "matchPaths": ["src/py/.pre-commit-config.yaml"] + "fileMatch": ["src/py/.pre-commit-config\\.yaml"] }, { "matchManagers": ["pep621"], From 072f4ddc5cdf7fb28fb94b44f0892bb7161fbbc7 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 19:47:54 +0400 Subject: [PATCH 11/36] revisit renovate.json --- .github/renovate.json | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/renovate.json b/.github/renovate.json index 8b2607c4..63ecf772 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -2,25 +2,19 @@ "logLevel": "debug", "extends": [ "config:recommended", - ":enablePreCommit", ":automergeMinor", ":dependencyDashboard", - ":semanticCommits", - ":pinVersions" + ":semanticCommits" ], "enabledManagers": [ "github-actions", "pep621", "pre-commit" ], - "timezone": "Asia/Dubai", - "schedule": [ - "before 10am on wednesday" - ], "packageRules": [ { "matchManagers": ["pre-commit"], - "fileMatch": ["src/py/.pre-commit-config\\.yaml"] + "matchPaths": ["src/py/.pre-commit-config.yaml"] }, { "matchManagers": ["pep621"], From 7314918384dff4dbfdb9d6de1287ce988c8b8ec0 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 19:49:50 +0400 Subject: [PATCH 12/36] revisit renovate.json --- .github/renovate.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/renovate.json b/.github/renovate.json index 63ecf772..a97f1e4c 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -1,5 +1,4 @@ { - "logLevel": "debug", "extends": [ "config:recommended", ":automergeMinor", From 2765ca210ad1c9d3a4300ffaadb08b0eaf280dc4 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 19:54:45 +0400 Subject: [PATCH 13/36] revisit renovate.json --- .github/renovate.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/renovate.json b/.github/renovate.json index a97f1e4c..b50a12ce 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -1,6 +1,7 @@ { "extends": [ "config:recommended", + ":enablePreCommit", ":automergeMinor", ":dependencyDashboard", ":semanticCommits" From 5f0d4908d816c2530e2ca5f9a3fbfc52af0fc2fa Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 19:55:55 +0400 Subject: [PATCH 14/36] revisit renovate.json --- .github/renovate.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/renovate.json b/.github/renovate.json index b50a12ce..319a4a74 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -4,7 +4,8 @@ ":enablePreCommit", ":automergeMinor", ":dependencyDashboard", - ":semanticCommits" + ":semanticCommits", + ":pinDevDependencies" ], "enabledManagers": [ "github-actions", From 831ce7d290a75f140f2ed346a0eec80fa7c60ecb Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 20:04:27 +0400 Subject: [PATCH 15/36] renovate failed to parse the yaml file --- src/py/.pre-commit-config.yaml | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/py/.pre-commit-config.yaml b/src/py/.pre-commit-config.yaml index 2a672b12..4a729ea6 100644 --- a/src/py/.pre-commit-config.yaml +++ b/src/py/.pre-commit-config.yaml @@ -1,17 +1,15 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks -%YAML 1.2 ---- exclude: | (?x)( src/py/site/.*| src/py/integration_tests/mocks/.*| - src/py/intergation_tests/renders/.*| + src/py/integration_tests/renders/.*| src/js/.*| \.js$ ) -default_install_hook_types: [pre-commit, commit-msg] -default_stages: [pre-commit] +default_install_hook_types: [ pre-commit, commit-msg ] +default_stages: [ pre-commit ] repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.2.0 @@ -34,10 +32,10 @@ repos: hooks: # Run the linter. - id: ruff - types_or: [python, pyi] + types_or: [ python, pyi ] # Run the formatter. - id: ruff-format - types_or: [python, pyi] + types_or: [ python, pyi ] # options: ignore one line things [E701] - repo: https://github.com/adrienverge/yamllint rev: v1.35.1 @@ -47,13 +45,13 @@ repos: description: This hook runs yamllint. entry: yamllint language: python - types: [file, yaml] - args: ['-d', "{\ + types: [ file, yaml ] + args: [ '-d', "{\ extends: default,\ rules: {\ colons: { max-spaces-after: -1 }\ }\ - }"] + }" ] - repo: https://github.com/rhysd/actionlint rev: v1.7.4 hooks: @@ -61,7 +59,7 @@ repos: name: Lint GitHub Actions workflow files description: Runs actionlint to lint GitHub Actions workflow files language: golang - types: ["yaml"] + types: [ "yaml" ] files: ^\.github/workflows/ entry: actionlint - repo: https://github.com/jorisroovers/gitlint @@ -71,10 +69,10 @@ repos: name: gitlint description: Checks your git commit messages for style. language: python - additional_dependencies: ["./gitlint-core[trusted-deps]"] + additional_dependencies: [ "./gitlint-core[trusted-deps]" ] entry: gitlint - args: [--staged, -c, "general.ignore=B6,T3", --msg-filename] - stages: [commit-msg] + args: [ --staged, -c, "general.ignore=B6,T3", --msg-filename ] + stages: [ commit-msg ] - repo: https://github.com/crate-ci/typos rev: v1.28.2 hooks: @@ -95,4 +93,4 @@ repos: name: Detect secrets language: python entry: detect-secrets-hook - args: [''] + args: [ '' ] From 225a866e040e93ccf40de8e073975cb560591465 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 20:11:05 +0400 Subject: [PATCH 16/36] renovate failed to parse the yaml file --- src/py/.pre-commit-config.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/py/.pre-commit-config.yaml b/src/py/.pre-commit-config.yaml index 4a729ea6..5d496e2a 100644 --- a/src/py/.pre-commit-config.yaml +++ b/src/py/.pre-commit-config.yaml @@ -46,12 +46,7 @@ repos: entry: yamllint language: python types: [ file, yaml ] - args: [ '-d', "{\ - extends: default,\ - rules: {\ - colons: { max-spaces-after: -1 }\ - }\ - }" ] + args: [ '-d', '{"extends": "default", "rules": {"colons": {"max-spaces-after": -1}}}' ] - repo: https://github.com/rhysd/actionlint rev: v1.7.4 hooks: From 4997d486ab9887ed34a8be149172e0cd5a7aac0a Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 20:42:45 +0400 Subject: [PATCH 17/36] If the License is an MD file it needs to respect all those md rules --- src/py/LICENSE.md => LICENSE | 2 +- src/py/.pre-commit-config.yaml | 66 ++++++++++++++++++++-------------- LICENSE.md => src/py/LICENSE | 0 3 files changed, 41 insertions(+), 27 deletions(-) rename src/py/LICENSE.md => LICENSE (97%) rename LICENSE.md => src/py/LICENSE (100%) diff --git a/src/py/LICENSE.md b/LICENSE similarity index 97% rename from src/py/LICENSE.md rename to LICENSE index 7880ca78..6165adc1 100644 --- a/src/py/LICENSE.md +++ b/LICENSE @@ -1,4 +1,4 @@ -The MIT License (MIT) +if The MIT License (MIT) Copyright (c) Plotly, Inc diff --git a/src/py/.pre-commit-config.yaml b/src/py/.pre-commit-config.yaml index 5d496e2a..db584a38 100644 --- a/src/py/.pre-commit-config.yaml +++ b/src/py/.pre-commit-config.yaml @@ -8,8 +8,8 @@ exclude: | src/js/.*| \.js$ ) -default_install_hook_types: [ pre-commit, commit-msg ] -default_stages: [ pre-commit ] +default_install_hook_types: [pre-commit, commit-msg] +default_stages: [pre-commit] repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.2.0 @@ -32,21 +32,25 @@ repos: hooks: # Run the linter. - id: ruff - types_or: [ python, pyi ] + types_or: [python, pyi] # Run the formatter. - id: ruff-format - types_or: [ python, pyi ] + types_or: [python, pyi] # options: ignore one line things [E701] - - repo: https://github.com/adrienverge/yamllint - rev: v1.35.1 - hooks: - - id: yamllint - name: yamllint - description: This hook runs yamllint. - entry: yamllint - language: python - types: [ file, yaml ] - args: [ '-d', '{"extends": "default", "rules": {"colons": {"max-spaces-after": -1}}}' ] + + # you check the actions below + #- repo: https://github.com/adrienverge/yamllint + # rev: v1.35.1 + # hooks: + # - id: yamllint + # name: yamllint + # description: This hook runs yamllint. + # entry: yamllint + # language: python + # types: [file, yaml] + # args: ['-d', '{"extends": "default", + # "rules": {"colons": {"max-spaces-after": -1}}}'] + - repo: https://github.com/rhysd/actionlint rev: v1.7.4 hooks: @@ -54,9 +58,10 @@ repos: name: Lint GitHub Actions workflow files description: Runs actionlint to lint GitHub Actions workflow files language: golang - types: [ "yaml" ] + types: ["yaml"] files: ^\.github/workflows/ entry: actionlint + - repo: https://github.com/jorisroovers/gitlint rev: v0.19.1 hooks: @@ -64,23 +69,32 @@ repos: name: gitlint description: Checks your git commit messages for style. language: python - additional_dependencies: [ "./gitlint-core[trusted-deps]" ] + additional_dependencies: ["./gitlint-core[trusted-deps]"] entry: gitlint - args: [ --staged, -c, "general.ignore=B6,T3", --msg-filename ] - stages: [ commit-msg ] + args: [--staged, -c, "general.ignore=B6,T3", --msg-filename] + stages: [commit-msg] + - repo: https://github.com/crate-ci/typos rev: v1.28.2 hooks: - id: typos - - repo: https://github.com/markdownlint/markdownlint - rev: v0.13.0 + + # - repo: https://github.com/markdownlint/markdownlint + # rev: v0.13.0 + # hooks: + # - id: markdownlint + # name: Markdownlint + # description: Run markdownlint on your Markdown files + # entry: mdl --rules ~MD026 --style .markdown.rb + # language: ruby + # files: \.(md|mdown|markdown)$ + + # no ruby acrobatic needed + - repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.44.0 hooks: - id: markdownlint - name: Markdownlint - description: Run markdownlint on your Markdown files - entry: mdl --rules ~MD026 --style .markdown.rb - language: ruby - files: \.(md|mdown|markdown)$ + - repo: https://github.com/Yelp/detect-secrets rev: v1.5.0 hooks: @@ -88,4 +102,4 @@ repos: name: Detect secrets language: python entry: detect-secrets-hook - args: [ '' ] + args: [''] diff --git a/LICENSE.md b/src/py/LICENSE similarity index 100% rename from LICENSE.md rename to src/py/LICENSE From 0fbeb144f4388e923d4d3733056bba302e7bb0eb Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 20:43:07 +0400 Subject: [PATCH 18/36] ignore the .idea folder --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 48dbaac5..66aa7eec 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,6 @@ src/py/integration_tests/report* # avoid ignore .gitkeep !src/py/integration_tests/renders/.gitkeep node_modules/ + +# IDE +.idea From 000917115494a60a2d21eaab1903767a6e432aac Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 20:43:23 +0400 Subject: [PATCH 19/36] simple Makefile to run pre-commit locally --- Makefile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..81de16c1 --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +.DEFAULT_GOAL := help + +venv: + @curl -LsSf https://astral.sh/uv/install.sh | sh + @uv venv --python '3.12' + + +.PHONY: install +install: venv ## Install a virtual environment + @uv pip install --upgrade pip + @uv sync --all-extras --dev --frozen + + +.PHONY: fmt +fmt: venv ## Run autoformatting and linting + @uv pip install pre-commit + @uv run pre-commit install --config src/py/.pre-commit-config.yaml + @uv run pre-commit run --config src/py/.pre-commit-config.yaml --all-files + + +.PHONY: help +help: ## Display this help screen + @echo -e "\033[1mAvailable commands:\033[0m" + @grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}' | sort From b7facd1f5b5e633e91f628c955d8266b1510791f Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 20:43:43 +0400 Subject: [PATCH 20/36] Respect the md rules in techdebt --- src/py/REFACTOR_INSTRUCTIONS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/py/REFACTOR_INSTRUCTIONS.md b/src/py/REFACTOR_INSTRUCTIONS.md index 50f8bcd4..315cc704 100644 --- a/src/py/REFACTOR_INSTRUCTIONS.md +++ b/src/py/REFACTOR_INSTRUCTIONS.md @@ -1,8 +1,9 @@ +# Techdebt + We are just at the line of techdebt: How to refactor: - 1. We need more thoughtful design of how to manage parallel tasking with async/await a. We are beginning to look a bit like callback hell. 2. The above would probably accompany a switch from inheritance of choreo to composition From 840c2c25d138bf2a0080e48b0a8ea4887ae35013 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 20:44:00 +0400 Subject: [PATCH 21/36] Respect the md rules in examples.md --- src/py/docs/examples.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/py/docs/examples.md b/src/py/docs/examples.md index 07635ffe..41dcb94e 100644 --- a/src/py/docs/examples.md +++ b/src/py/docs/examples.md @@ -1,7 +1,6 @@ # Kaleido Code Snippets - -### Basic +## Basic ```python import plotly.express as px @@ -31,7 +30,6 @@ figures = [fig, fig2] kaleido.write_fig_sync(fig, path="./output/") - ## Multiple image write with error collection error_log = [] @@ -50,7 +48,6 @@ if error_log: print(str(e)) raise RuntimeError("{len(error_log)} images failed.") - ## async/await style of above await kaleido.write_fig( @@ -61,12 +58,11 @@ await kaleido.write_fig( ) ``` -### Generator (for batch processing) +## Generator (for batch processing) Generating all of the plotly figures can take too much memory depending on the number of figures, so use a generator: - ```python import plotly.express as px import kaleido @@ -88,7 +84,6 @@ def generate_figures(): # can be async as well kaleido.write_fig_sync(generate_figures(), path="./output/", n=4) # file names will be taken from figure title - ### If you need more control, use an object def generate_figure_objects(): From a281ca806211d82f5521f864745952502d5a4526 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 20:44:33 +0400 Subject: [PATCH 22/36] following the change in LICENSE.md to LICENSE --- src/py/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/py/pyproject.toml b/src/py/pyproject.toml index 79b2733d..e9ac32ca 100644 --- a/src/py/pyproject.toml +++ b/src/py/pyproject.toml @@ -14,7 +14,7 @@ kaleido = ['vendor/**'] [project] name = "kaleido" description = "Plotly graph export library" -license = {file = "LICENSE.md"} +license = {file = "LICENSE"} readme = "README.md" requires-python = ">=3.8" dynamic = ["version"] From b334f56c85aec46c74c4ee1bd497344eb97a357b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 16:47:55 +0000 Subject: [PATCH 23/36] chore(deps): update pre-commit hook rhysd/actionlint to v1.7.7 (#2) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- src/py/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/py/.pre-commit-config.yaml b/src/py/.pre-commit-config.yaml index db584a38..9b0b2157 100644 --- a/src/py/.pre-commit-config.yaml +++ b/src/py/.pre-commit-config.yaml @@ -52,7 +52,7 @@ repos: # "rules": {"colons": {"max-spaces-after": -1}}}'] - repo: https://github.com/rhysd/actionlint - rev: v1.7.4 + rev: v1.7.7 hooks: - id: actionlint name: Lint GitHub Actions workflow files From 15f55ebbe981a350a0ce821e3dc0ba04b025a4dc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 16:48:09 +0000 Subject: [PATCH 24/36] chore(deps): update pre-commit hook crate-ci/typos to v1.31.1 --- src/py/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/py/.pre-commit-config.yaml b/src/py/.pre-commit-config.yaml index 9b0b2157..86d43fa6 100644 --- a/src/py/.pre-commit-config.yaml +++ b/src/py/.pre-commit-config.yaml @@ -75,7 +75,7 @@ repos: stages: [commit-msg] - repo: https://github.com/crate-ci/typos - rev: v1.28.2 + rev: v1.31.1 hooks: - id: typos From 65a23fbc656949e16ceb2add0a215d81a2e0c053 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 16:48:17 +0000 Subject: [PATCH 25/36] chore(deps): update pre-commit hook pre-commit/pre-commit-hooks to v5 --- src/py/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/py/.pre-commit-config.yaml b/src/py/.pre-commit-config.yaml index 9b0b2157..42d4eb42 100644 --- a/src/py/.pre-commit-config.yaml +++ b/src/py/.pre-commit-config.yaml @@ -12,7 +12,7 @@ default_install_hook_types: [pre-commit, commit-msg] default_stages: [pre-commit] repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.2.0 + rev: v5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer From 54f8b7e709288818babde084502be6de32a9048b Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Wed, 16 Apr 2025 20:50:01 +0400 Subject: [PATCH 26/36] complaint with pep621 --- src/py/pyproject.toml | 13 +------------ src/py/uv.lock | 27 ++++++++++++--------------- 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/src/py/pyproject.toml b/src/py/pyproject.toml index e9ac32ca..4c2e7c19 100644 --- a/src/py/pyproject.toml +++ b/src/py/pyproject.toml @@ -39,7 +39,7 @@ Repository = "https://github.com/plotly/kaleido" kaleido_mocker = "kaleido._mocker:build_mocks" kaleido_get_chrome = "choreographer.cli._cli_utils:get_chrome_cli" -[dependency-groups] +[project.optional-dependencies] dev = [ "pytest", "pytest-asyncio", @@ -52,17 +52,6 @@ dev = [ "pandas>=2.0.3", ] -#docs = [ -# "mkquixote @ git+ssh://git@github.com/geopozo/mkquixote; python_version>= '3.11'", -# "mkdocs>=1.6.1", -# "mkdocs-material>=9.5.49", -#] - -#[tool.uv.sources] -#mkquixote = { path = "../../../mkquixote", editable = true } -#choreographer = { path = "../../../devtools_protocol", editable = true } -#logistro = { path = "../../../logistro", editable = true } - [tool.ruff.lint] select = ["ALL"] ignore = [ diff --git a/src/py/uv.lock b/src/py/uv.lock index 7499f507..10d05404 100644 --- a/src/py/uv.lock +++ b/src/py/uv.lock @@ -76,7 +76,7 @@ dependencies = [ { name = "orjson" }, ] -[package.dev-dependencies] +[package.optional-dependencies] dev = [ { name = "async-timeout" }, { name = "mypy", version = "1.14.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9'" }, @@ -95,23 +95,20 @@ dev = [ [package.metadata] requires-dist = [ + { name = "async-timeout", marker = "extra == 'dev'" }, { name = "choreographer", specifier = ">=1.0.5" }, { name = "logistro", specifier = ">=1.0.8" }, + { name = "mypy", marker = "extra == 'dev'", specifier = ">=1.14.1" }, { name = "orjson", specifier = ">=3.10.15" }, -] - -[package.metadata.requires-dev] -dev = [ - { name = "async-timeout" }, - { name = "mypy", specifier = ">=1.14.1" }, - { name = "pandas", specifier = ">=2.0.3" }, - { name = "plotly", extras = ["express"], specifier = ">=6.0.0" }, - { name = "poethepoet", specifier = ">=0.30.0" }, - { name = "pytest" }, - { name = "pytest-asyncio" }, - { name = "pytest-order", specifier = ">=1.3.0" }, - { name = "pytest-xdist" }, -] + { name = "pandas", marker = "extra == 'dev'", specifier = ">=2.0.3" }, + { name = "plotly", extras = ["express"], marker = "extra == 'dev'", specifier = ">=6.0.0" }, + { name = "poethepoet", marker = "extra == 'dev'", specifier = ">=0.30.0" }, + { name = "pytest", marker = "extra == 'dev'" }, + { name = "pytest-asyncio", marker = "extra == 'dev'" }, + { name = "pytest-order", marker = "extra == 'dev'", specifier = ">=1.3.0" }, + { name = "pytest-xdist", marker = "extra == 'dev'" }, +] +provides-extras = ["dev"] [[package]] name = "logistro" From 3929451081f0d8c0508fa6c51043606791c803f1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 16:51:30 +0000 Subject: [PATCH 27/36] chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.11.5 --- src/py/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/py/.pre-commit-config.yaml b/src/py/.pre-commit-config.yaml index 091084e1..109c8a22 100644 --- a/src/py/.pre-commit-config.yaml +++ b/src/py/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: - id: add-trailing-comma - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.8.2 + rev: v0.11.5 hooks: # Run the linter. - id: ruff From 6e4341fa2f8e492f99b74c5ae93c3d959a02bc0f Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Thu, 17 Apr 2025 08:45:22 +0400 Subject: [PATCH 28/36] Update LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 6165adc1..7880ca78 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -if The MIT License (MIT) +The MIT License (MIT) Copyright (c) Plotly, Inc From b826cf8356b0a68f4882d02a2ffb6c20fd3f7886 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 17 Apr 2025 19:06:47 +0000 Subject: [PATCH 29/36] chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.11.6 (#8) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- src/py/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/py/.pre-commit-config.yaml b/src/py/.pre-commit-config.yaml index 109c8a22..3d63ebd2 100644 --- a/src/py/.pre-commit-config.yaml +++ b/src/py/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: - id: add-trailing-comma - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.11.5 + rev: v0.11.6 hooks: # Run the linter. - id: ruff From 439d744df53313a6a68624df0f375d618cd39b28 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 03:38:48 +0000 Subject: [PATCH 30/36] chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.11.7 (#10) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- src/py/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/py/.pre-commit-config.yaml b/src/py/.pre-commit-config.yaml index 3d63ebd2..7a3a0d75 100644 --- a/src/py/.pre-commit-config.yaml +++ b/src/py/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: - id: add-trailing-comma - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.11.6 + rev: v0.11.7 hooks: # Run the linter. - id: ruff From ffafcd7d7aecc5dab538d2e29c5ff0b5d45c1a91 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 22:15:03 +0000 Subject: [PATCH 31/36] chore(deps): update pre-commit hook crate-ci/typos to v1.31.2 (#11) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- src/py/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/py/.pre-commit-config.yaml b/src/py/.pre-commit-config.yaml index 7a3a0d75..18531a33 100644 --- a/src/py/.pre-commit-config.yaml +++ b/src/py/.pre-commit-config.yaml @@ -75,7 +75,7 @@ repos: stages: [commit-msg] - repo: https://github.com/crate-ci/typos - rev: v1.31.1 + rev: v1.31.2 hooks: - id: typos From 88766a800c96f5512c706f95579a6347acae76dd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 23:01:26 +0000 Subject: [PATCH 32/36] chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.11.8 (#12) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- src/py/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/py/.pre-commit-config.yaml b/src/py/.pre-commit-config.yaml index 18531a33..77eb0e25 100644 --- a/src/py/.pre-commit-config.yaml +++ b/src/py/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: - id: add-trailing-comma - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.11.7 + rev: v0.11.8 hooks: # Run the linter. - id: ruff From d787ae5aea4fa2053dc24772a2d01a569c671bec Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 2 May 2025 18:11:00 +0000 Subject: [PATCH 33/36] chore(deps): update pre-commit hook crate-ci/typos to v1.32.0 (#13) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- src/py/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/py/.pre-commit-config.yaml b/src/py/.pre-commit-config.yaml index 77eb0e25..57745c10 100644 --- a/src/py/.pre-commit-config.yaml +++ b/src/py/.pre-commit-config.yaml @@ -75,7 +75,7 @@ repos: stages: [commit-msg] - repo: https://github.com/crate-ci/typos - rev: v1.31.2 + rev: v1.32.0 hooks: - id: typos From f23ff6ed0a13f5819ece732a2e62e91d5f187c40 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 9 May 2025 21:41:41 +0000 Subject: [PATCH 34/36] chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.11.9 (#14) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- src/py/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/py/.pre-commit-config.yaml b/src/py/.pre-commit-config.yaml index 57745c10..7eaa4b1c 100644 --- a/src/py/.pre-commit-config.yaml +++ b/src/py/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: - id: add-trailing-comma - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.11.8 + rev: v0.11.9 hooks: # Run the linter. - id: ruff From 2067232cf9d88e0aa62beb222ddccd4bd0436db5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 23:29:28 +0000 Subject: [PATCH 35/36] chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.11.10 (#15) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- src/py/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/py/.pre-commit-config.yaml b/src/py/.pre-commit-config.yaml index 7eaa4b1c..df0e1f73 100644 --- a/src/py/.pre-commit-config.yaml +++ b/src/py/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: - id: add-trailing-comma - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.11.9 + rev: v0.11.10 hooks: # Run the linter. - id: ruff From 6ac2b3d637a69af7a64fdb6ba19edd018afcfcbd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 18 May 2025 10:26:13 +0000 Subject: [PATCH 36/36] chore(deps): update pre-commit hook igorshubovych/markdownlint-cli to v0.45.0 (#16) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- src/py/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/py/.pre-commit-config.yaml b/src/py/.pre-commit-config.yaml index df0e1f73..28b4eea8 100644 --- a/src/py/.pre-commit-config.yaml +++ b/src/py/.pre-commit-config.yaml @@ -91,7 +91,7 @@ repos: # no ruby acrobatic needed - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.44.0 + rev: v0.45.0 hooks: - id: markdownlint