From 541d4b7ee4232c6bc8c93c33e0c22fcf7d5a3dba Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Tue, 30 Jan 2024 16:41:04 +0000 Subject: [PATCH 1/9] configure ci for python 3.10 Fixes #1863 --- .circleci/config.yml | 130 ++++++++++++++++++------------------ .pylintrc39 => .pylintrc310 | 0 2 files changed, 65 insertions(+), 65 deletions(-) rename .pylintrc39 => .pylintrc310 (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index c8b784ca46..65b406d75b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,12 +8,12 @@ orbs: jobs: artifacts: docker: - - image: cimg/python:3.9.9 + - image: cimg/python:3.10.13 auth: username: dashautomation password: $DASH_PAT_DOCKERHUB environment: - PYVERSION: python39 + PYVERSION: python310 PERCY_ENABLE: 0 steps: - checkout @@ -27,16 +27,16 @@ jobs: path: ~/dash/dash-main destination: /tmp/dash-main - install-dependencies-39: &install-dependencies + install-dependencies-310: &install-dependencies working_directory: ~/dash docker: - - image: cimg/python:3.9.9-node + - image: cimg/python:3.10.13-node auth: username: dashautomation password: $DASH_PAT_DOCKERHUB environment: - PYLINTRC: .pylintrc39 - PYVERSION: python39 + PYLINTRC: .pylintrc310 + PYVERSION: python310 PERCY_ENABLE: 0 steps: @@ -88,16 +88,16 @@ jobs: PYVERSION: python36 PERCY_ENABLE: 0 - lint-unit-39: &lint-unit + lint-unit-310: &lint-unit working_directory: ~/dash docker: - - image: cimg/python:3.9.9-browsers + - image: cimg/python:3.10.13-browsers auth: username: dashautomation password: $DASH_PAT_DOCKERHUB environment: - PYLINTRC: .pylintrc39 - PYVERSION: python39 + PYLINTRC: .pylintrc310 + PYVERSION: python310 PERCY_ENABLE: 0 steps: @@ -142,7 +142,7 @@ jobs: PYVERSION: python36 PERCY_ENABLE: 0 - build-windows-39: + build-windows-310: working_directory: ~/dash executor: name: win/default @@ -157,10 +157,10 @@ jobs: pip install --no-cache-dir --upgrade -e .[dev,testing] --progress-bar off cd dash/dash-renderer && renderer build && cd ../../ - test-39: &test + test-310: &test working_directory: ~/dash docker: - - image: cimg/python:3.9.9-browsers + - image: cimg/python:3.10.13-browsers auth: username: dashautomation password: $DASH_PAT_DOCKERHUB @@ -168,7 +168,7 @@ jobs: PERCY_ENABLE: 1 PERCY_PARALLEL_TOTAL: -1 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: True - PYVERSION: python39 + PYVERSION: python310 REDIS_URL: redis://localhost:6379 - image: cimg/redis:6.2.6 auth: @@ -208,17 +208,17 @@ jobs: - store_artifacts: path: /tmp/dash_artifacts - test-39-react-18: + test-310-react-18: <<: *test docker: - - image: cimg/python:3.9.9-browsers + - image: cimg/python:3.10.13-browsers auth: username: dashautomation password: $DASH_PAT_DOCKERHUB environment: PERCY_ENABLE: 0 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: True - PYVERSION: python39 + PYVERSION: python310 REDIS_URL: redis://localhost:6379 REACT_VERSION: "18.2.0" - image: cimg/redis:6.2.6 @@ -243,15 +243,15 @@ jobs: username: dashautomation password: $DASH_PAT_DOCKERHUB - dcc-lint-unit-39: &dcc-lint-unit + dcc-lint-unit-310: &dcc-lint-unit working_directory: ~/dash docker: - - image: cimg/python:3.9.9-node + - image: cimg/python:3.10.13-node auth: username: dashautomation password: $DASH_PAT_DOCKERHUB environment: - PYVERSION: python39 + PYVERSION: python310 PERCY_ENABLE: 0 steps: - checkout: @@ -280,15 +280,15 @@ jobs: PYVERSION: python36 PERCY_ENABLE: 0 - dcc-39: &dcc-test + dcc-310: &dcc-test working_directory: ~/dash docker: - - image: cimg/python:3.9.9-browsers + - image: cimg/python:3.10.13-browsers auth: username: dashautomation password: $DASH_PAT_DOCKERHUB environment: - PYVERSION: python39 + PYVERSION: python310 PERCY_PARALLEL_TOTAL: -1 PERCY_ENABLE: 1 parallelism: 3 @@ -326,15 +326,15 @@ jobs: - store_artifacts: path: /tmp/dash_artifacts - dcc-39-react-18: + dcc-310-react-18: <<: *dcc-test docker: - - image: cimg/python:3.9.9-browsers + - image: cimg/python:3.10.13-browsers auth: username: dashautomation password: $DASH_PAT_DOCKERHUB environment: - PYVERSION: python39 + PYVERSION: python310 PERCY_ENABLE: 0 REACT_VERSION: "18.2.0" @@ -349,15 +349,15 @@ jobs: PYVERSION: python36 PERCY_ENABLE: 0 - html-39: &html-test + html-310: &html-test working_directory: ~/dash docker: - - image: cimg/python:3.9.9-browsers + - image: cimg/python:3.10.13-browsers auth: username: dashautomation password: $DASH_PAT_DOCKERHUB environment: - PYVERSION: python39 + PYVERSION: python310 PERCY_ENABLE: 1 PERCY_PARALLEL_TOTAL: -1 @@ -403,15 +403,15 @@ jobs: - store_artifacts: path: /tmp/dash_artifacts - html-39-react-18: + html-310-react-18: <<: *html-test docker: - - image: cimg/python:3.9.9-browsers + - image: cimg/python:3.10.13-browsers auth: username: dashautomation password: $DASH_PAT_DOCKERHUB environment: - PYVERSION: python39 + PYVERSION: python310 PERCY_ENABLE: 0 REACT_VERSION: "18.2.0" @@ -429,9 +429,9 @@ jobs: table-server: &table-server working_directory: ~/dash docker: - - image: cimg/python:3.9.9-browsers + - image: cimg/python:3.10.13-browsers environment: - PYVERSION: python39 + PYVERSION: python310 PERCY_ENABLE: 1 PERCY_PARALLEL_TOTAL: -1 @@ -478,18 +478,18 @@ jobs: table-server-react-18: <<: *table-server docker: - - image: cimg/python:3.9.9-browsers + - image: cimg/python:3.10.13-browsers environment: - PYVERSION: python39 + PYVERSION: python310 PERCY_ENABLE: 0 REACT_VERSION: "18.2.0" table-unit-test: working_directory: ~/dash docker: - - image: cimg/python:3.9.9-browsers + - image: cimg/python:3.10.13-browsers environment: - PYVERSION: python39 + PYVERSION: python310 PERCY_ENABLE: 0 steps: - checkout: @@ -562,9 +562,9 @@ jobs: table-node: working_directory: ~/dash docker: - - image: cimg/python:3.9.9-node + - image: cimg/python:3.10.13-node environment: - PYVERSION: python39 + PYVERSION: python310 PERCY_ENABLE: 0 steps: - checkout: @@ -602,74 +602,74 @@ workflows: version: 2 tests: jobs: - - install-dependencies-39 + - install-dependencies-310 - install-dependencies-36 - - build-windows-39 + - build-windows-310 - - lint-unit-39: + - lint-unit-310: requires: - - install-dependencies-39 + - install-dependencies-310 - lint-unit-36: requires: - install-dependencies-36 - - test-39: + - test-310: requires: - - install-dependencies-39 - - test-39-react-18: + - install-dependencies-310 + - test-310-react-18: requires: - - install-dependencies-39 + - install-dependencies-310 - test-36: requires: - install-dependencies-36 - - dcc-lint-unit-39: + - dcc-lint-unit-310: requires: - - install-dependencies-39 + - install-dependencies-310 - dcc-lint-unit-36: requires: - install-dependencies-36 - - dcc-39: + - dcc-310: requires: - - install-dependencies-39 - - dcc-39-react-18: + - install-dependencies-310 + - dcc-310-react-18: requires: - - install-dependencies-39 + - install-dependencies-310 - dcc-36: requires: - install-dependencies-36 - - html-39: + - html-310: requires: - - install-dependencies-39 - - html-39-react-18: + - install-dependencies-310 + - html-310-react-18: requires: - - install-dependencies-39 + - install-dependencies-310 - html-36: requires: - install-dependencies-36 - table-node: requires: - - install-dependencies-39 + - install-dependencies-310 - table-unit-test: requires: - - install-dependencies-39 + - install-dependencies-310 - table-visual-test - table-server: requires: - - install-dependencies-39 + - install-dependencies-310 - table-server-react-18: requires: - - install-dependencies-39 + - install-dependencies-310 - percy/finalize_all: requires: - - test-39 - - dcc-39 - - html-39 + - test-310 + - dcc-310 + - html-310 - table-server - artifacts: requires: diff --git a/.pylintrc39 b/.pylintrc310 similarity index 100% rename from .pylintrc39 rename to .pylintrc310 From 78de5bb6dd7eb0132c0896249d57ffa5b3fbef18 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Tue, 30 Jan 2024 16:42:54 +0000 Subject: [PATCH 2/9] add 3.10 to trove classifiers --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 9a99e22641..5edd96f5e6 100644 --- a/setup.py +++ b/setup.py @@ -68,6 +68,7 @@ def read_req_file(req_type): "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Topic :: Database :: Front-Ends", "Topic :: Office/Business :: Financial :: Spreadsheet", "Topic :: Scientific/Engineering :: Visualization", From f508435ecd5ba8e0c11ebab7d14ec6bd9df1d7b6 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 31 Jan 2024 09:14:25 +0000 Subject: [PATCH 3/9] add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4891531bf3..db3c12ce5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). ## Changed - [#2652](https://github.com/plotly/dash/pull/2652) dcc.Clipboard supports htm_content and triggers a copy to clipboard when n_clicks are changed - [#2721](https://github.com/plotly/dash/pull/2721) Remove ansi2html, fixes [#2613](https://github.com/plotly/dash/issues/2713) +- [#2734](https://github.com/plotly/dash/pull/2735) Configure CI for Python 3.10 [#1863](https://github.com/plotly/dash/issues/1863) ## [2.14.2] - 2023-11-27 From 3a00a766ca66163feb0812442919435778a33f81 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 31 Jan 2024 11:23:39 +0000 Subject: [PATCH 4/9] remove check for npm logs since npm 8.2 logs are alway written, so this step will always fail --- .circleci/config.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 65b406d75b..2fb50e505e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,14 +59,6 @@ jobs: mkdir dash-package && cp dist/*.tar.gz dash-package/dash-package.tar.gz ls -la dash-package no_output_timeout: 30m - - run: - name: Display npm errors and exit on failed builds - command: | - if [ -d "/home/circleci/.npm/_logs" ] - then - cat /home/circleci/.npm/_logs/* - exit 1 - fi - save_cache: key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-all.txt" }} paths: From 6129403c47803ff5d23b68babb9d9c0501f74f6f Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 31 Jan 2024 11:44:07 +0000 Subject: [PATCH 5/9] replace all uses of python39 with python310 --- components/dash-core-components/package.json | 2 +- components/dash-table/package.json | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/dash-core-components/package.json b/components/dash-core-components/package.json index d60c7646ad..092318975d 100644 --- a/components/dash-core-components/package.json +++ b/components/dash-core-components/package.json @@ -15,7 +15,7 @@ "private::format.black": "black dash_core_components_base/ tests/ setup.py", "private::format.eslint": "eslint src --fix", "private::format.prettier": "prettier --config .prettierrc --write src/**/*.js", - "private::lint.black": "node -e \"if ((process.env.PYVERSION || 'python39') !== 'python36'){process.exit(1)} \" || black --check dash_core_components_base/ tests/ setup.py", + "private::lint.black": "node -e \"if ((process.env.PYVERSION || 'python310') !== 'python36'){process.exit(1)} \" || black --check dash_core_components_base/ tests/ setup.py", "private::lint.eslint": "eslint src", "private::lint.flake8": "flake8 --exclude=dash_core_components,node_modules,venv", "private::lint.prettier": "prettier --config .prettierrc src/**/*.js --list-different", diff --git a/components/dash-table/package.json b/components/dash-table/package.json index 3cc0b8b970..3bae43bbff 100644 --- a/components/dash-table/package.json +++ b/components/dash-table/package.json @@ -23,7 +23,7 @@ "private::format.black": "black dash_table_base tests", "private::lint.ts": "eslint ./src ./tests", "private::lint.flake": "flake8 dash_table_base tests", - "private::lint.black": "node -e \"if ((process.env.PYVERSION || 'python39') !== 'python36'){process.exit(1)} \" || black --check dash_table_base tests", + "private::lint.black": "node -e \"if ((process.env.PYVERSION || 'python310') !== 'python36'){process.exit(1)} \" || black --check dash_table_base tests", "private::lint.prettier": "prettier --config .prettierrc \"{src,tests,demo}/**/*.{js,ts,tsx}\" --list-different", "private::test.python": "python -m unittest tests/unit/format_test.py", "private::test.unit": "karma start karma.conf.js --single-run", diff --git a/package.json b/package.json index f5644f3601..d13f16150b 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "private::cibuild.renderer": "cd dash/dash-renderer && renderer build", "private::build.renderer": "cd dash/dash-renderer && renderer build", "private::build.jupyterlab": "cd \\@plotly/dash-jupyterlab && jlpm install && jlpm build:pack", - "private::lint.black": "node -e \"if ((process.env.PYVERSION || 'python39') !== 'python36'){process.exit(1)} \" || black dash tests --exclude metadata_test.py --check", + "private::lint.black": "node -e \"if ((process.env.PYVERSION || 'python310') !== 'python36'){process.exit(1)} \" || black dash tests --exclude metadata_test.py --check", "private::lint.flake8": "flake8 --exclude=metadata_test.py dash tests", "private::lint.pylint-dash": "PYLINTRC=${PYLINTRC:=.pylintrc39} && pylint dash setup.py --rcfile=$PYLINTRC", "private::lint.pylint-tests": "PYLINTRC=${PYLINTRC:=.pylintrc39} && pylint tests/unit tests/integration -d all --rcfile=$PYLINTRC", From 01a4d97bef9da15e22164353b3b1e8a70d8c91c7 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 31 Jan 2024 11:46:29 +0000 Subject: [PATCH 6/9] fix changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de27764909..cd0def7cc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). ## Changed - [#2652](https://github.com/plotly/dash/pull/2652) dcc.Clipboard supports htm_content and triggers a copy to clipboard when n_clicks are changed - [#2721](https://github.com/plotly/dash/pull/2721) Remove ansi2html, fixes [#2613](https://github.com/plotly/dash/issues/2713) -- [#2734](https://github.com/plotly/dash/pull/2735) Configure CI for Python 3.10 [#1863](https://github.com/plotly/dash/issues/1863) +- [#2734](https://github.com/plotly/dash/pull/2734) Configure CI for Python 3.10 [#1863](https://github.com/plotly/dash/issues/1863) ## [2.14.2] - 2023-11-27 From c1f0edea3aa94b63b1faf9e1894132c5a9e68c41 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Tue, 6 Feb 2024 09:50:57 +0000 Subject: [PATCH 7/9] update changelog with unreleased section --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 419756a578..891a5982fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to `dash` will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/). +## [UNRELEASED] + +## Changed + +- [#2734](https://github.com/plotly/dash/pull/2734) Configure CI for Python 3.10 [#1863](https://github.com/plotly/dash/issues/1863) + ## [2.15.0] - 2024-01-31 ## Added @@ -19,7 +25,6 @@ This project adheres to [Semantic Versioning](https://semver.org/). ## Changed - [#2652](https://github.com/plotly/dash/pull/2652) dcc.Clipboard supports htm_content and triggers a copy to clipboard when n_clicks are changed - [#2721](https://github.com/plotly/dash/pull/2721) Remove ansi2html, fixes [#2613](https://github.com/plotly/dash/issues/2713) -- [#2734](https://github.com/plotly/dash/pull/2734) Configure CI for Python 3.10 [#1863](https://github.com/plotly/dash/issues/1863) ## [2.14.2] - 2023-11-27 From 7ab720ff130b8789e6c09964d53e0f2d729ed523 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Tue, 6 Feb 2024 09:55:49 +0000 Subject: [PATCH 8/9] hardcode python version in snapshot name --- dash/testing/browser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dash/testing/browser.py b/dash/testing/browser.py index 1ce5eea68c..de4bbda788 100644 --- a/dash/testing/browser.py +++ b/dash/testing/browser.py @@ -159,7 +159,10 @@ def percy_snapshot( """ if widths is None: widths = [1280] - snapshot_name = f"{name} - py{sys.version_info.major}.{sys.version_info.minor}" + + # py3.9 hardcoded here to keep snapshot names the same accorss + # future python upgrades + snapshot_name = f"{name} - py3.9" logger.info("taking snapshot name => %s", snapshot_name) try: if wait_for_callbacks: From bc1a8d3e7d1c4af9d247c982b325113bfc2785a7 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Tue, 6 Feb 2024 10:02:12 +0000 Subject: [PATCH 9/9] display npm logs --- .circleci/config.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2fb50e505e..09ffc838de 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,6 +59,13 @@ jobs: mkdir dash-package && cp dist/*.tar.gz dash-package/dash-package.tar.gz ls -la dash-package no_output_timeout: 30m + - run: + name: Display npm logs + command: | + if [ -d "/home/circleci/.npm/_logs" ] + then + cat /home/circleci/.npm/_logs/* + fi - save_cache: key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-all.txt" }} paths: