From 3a34c7ff7cf8fec138a37d89fcfb133b521a3381 Mon Sep 17 00:00:00 2001 From: EugeneTorap Date: Tue, 2 Apr 2024 19:47:58 +0300 Subject: [PATCH] chore: Bump to Python3.10 (#24112) Co-authored-by: Maxime Beauchemin --- .asf.yaml | 16 +++++----- .github/ISSUE_TEMPLATE/bug-report.yml | 1 - .github/actions/setup-backend/action.yml | 2 +- .github/supersetbot/src/docker.js | 2 +- .github/workflows/no-op.yml | 30 +++++++++++++++++++ .github/workflows/pre-commit.yml | 2 +- .github/workflows/superset-cli.yml | 2 +- .github/workflows/superset-helm-lint.yml | 2 +- .../superset-python-integrationtest.yml | 6 ++-- .github/workflows/superset-python-misc.yml | 4 +-- .../workflows/superset-python-presto-hive.yml | 4 +-- .../workflows/superset-python-unittest.yml | 2 +- .github/workflows/superset-translations.yml | 2 +- Dockerfile | 2 +- Makefile | 6 ++-- RELEASING/Dockerfile.from_local_tarball | 2 +- RELEASING/Dockerfile.from_svn_tarball | 2 +- RELEASING/Dockerfile.make_docs | 2 +- RELEASING/Dockerfile.make_tarball | 2 +- UPDATING.md | 3 ++ docker-compose-non-dev.yml | 2 +- docker-compose.yml | 2 +- docs/docs/contributing/local-backend.mdx | 2 +- docs/docs/installation/docker.mdx | 2 +- requirements/development.in | 2 +- requirements/development.txt | 4 +-- scripts/build_docker.py | 8 ++--- tox.ini | 2 +- 28 files changed, 75 insertions(+), 43 deletions(-) diff --git a/.asf.yaml b/.asf.yaml index 4385e2ed02e97..9b2bfae806ada 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -67,15 +67,15 @@ github: - cypress-matrix (2, chrome) - cypress-matrix (3, chrome) - frontend-build - - pre-commit (3.9) - - python-lint (3.9) - - test-mysql (3.9) - - test-postgres (3.9) + - pre-commit (3.10) + - python-lint (3.10) + - test-mysql (3.10) - test-postgres (3.10) - - test-postgres-hive (3.9) - - test-postgres-presto (3.9) - - test-sqlite (3.9) - - unit-tests (3.9) + - test-postgres (3.11) + - test-postgres-hive (3.10) + - test-postgres-presto (3.10) + - test-sqlite (3.10) + - unit-tests (3.10) required_pull_request_reviews: dismiss_stale_reviews: false diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 32198231b9d75..a4766d1649dbc 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -54,7 +54,6 @@ body: attributes: label: Python version options: - - "3.9" - "3.10" - "3.11" - Not applicable diff --git a/.github/actions/setup-backend/action.yml b/.github/actions/setup-backend/action.yml index 1b29caf893350..5f6ba8d1a02f0 100644 --- a/.github/actions/setup-backend/action.yml +++ b/.github/actions/setup-backend/action.yml @@ -4,7 +4,7 @@ inputs: python-version: description: 'Python version to set up.' required: true - default: '3.9' + default: '3.10' cache: description: 'Cache dependencies. Options: pip' required: false diff --git a/.github/supersetbot/src/docker.js b/.github/supersetbot/src/docker.js index 03eb1a315fea2..e09942d2b9d56 100644 --- a/.github/supersetbot/src/docker.js +++ b/.github/supersetbot/src/docker.js @@ -2,7 +2,7 @@ import { spawnSync } from 'child_process'; const REPO = 'apache/superset'; const CACHE_REPO = `${REPO}-cache`; -const BASE_PY_IMAGE = '3.9-slim-bookworm'; +const BASE_PY_IMAGE = '3.10-slim-bookworm'; export function runCmd(command, raiseOnFailure = true) { const { stdout, stderr } = spawnSync(command, { shell: true, encoding: 'utf-8', env: process.env }); diff --git a/.github/workflows/no-op.yml b/.github/workflows/no-op.yml index 1c68c4e1f5d85..2dbd82eb384d5 100644 --- a/.github/workflows/no-op.yml +++ b/.github/workflows/no-op.yml @@ -82,3 +82,33 @@ jobs: run: | echo "This is a no-op step for unit-tests to ensure a successful status when skipped." exit 0 + test-mysql: + strategy: + matrix: + python-version: ["3.9"] + runs-on: ubuntu-latest + steps: + - name: No-op for test-mysql + run: | + echo "This is a no-op step for test-mysql to ensure a successful status when skipped." + exit 0 + test-postgres: + strategy: + matrix: + python-version: ["3.9"] + runs-on: ubuntu-latest + steps: + - name: No-op for test-postgres + run: | + echo "This is a no-op step for test-postgres to ensure a successful status when skipped." + exit 0 + test-sqlite: + strategy: + matrix: + python-version: ["3.9"] + runs-on: ubuntu-latest + steps: + - name: No-op for test-sqlite + run: | + echo "This is a no-op step for test-sqlite to ensure a successful status when skipped." + exit 0 diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 2d377accdf0fc..27af14d224d6b 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ["3.9"] + python-version: ["3.10"] steps: - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" uses: actions/checkout@v4 diff --git a/.github/workflows/superset-cli.yml b/.github/workflows/superset-cli.yml index 07aa01ebfa802..f0e037197ee1a 100644 --- a/.github/workflows/superset-cli.yml +++ b/.github/workflows/superset-cli.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ["3.9"] + python-version: ["3.10"] env: PYTHONPATH: ${{ github.workspace }} SUPERSET_CONFIG: tests.integration_tests.superset_test_config diff --git a/.github/workflows/superset-helm-lint.yml b/.github/workflows/superset-helm-lint.yml index 72fd62af78cad..f16dd61fdde3b 100644 --- a/.github/workflows/superset-helm-lint.yml +++ b/.github/workflows/superset-helm-lint.yml @@ -29,7 +29,7 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: "3.9" + python-version: "3.10" - name: Set up chart-testing uses: ./.github/actions/chart-testing-action diff --git a/.github/workflows/superset-python-integrationtest.yml b/.github/workflows/superset-python-integrationtest.yml index 28df703a92e9b..75eea5c70a6e9 100644 --- a/.github/workflows/superset-python-integrationtest.yml +++ b/.github/workflows/superset-python-integrationtest.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ["3.9"] + python-version: ["3.10"] env: PYTHONPATH: ${{ github.workspace }} SUPERSET_CONFIG: tests.integration_tests.superset_test_config @@ -76,7 +76,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ["3.9", "3.10"] + python-version: ["3.10", "3.11"] env: PYTHONPATH: ${{ github.workspace }} SUPERSET_CONFIG: tests.integration_tests.superset_test_config @@ -136,7 +136,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ["3.9"] + python-version: ["3.10"] env: PYTHONPATH: ${{ github.workspace }} SUPERSET_CONFIG: tests.integration_tests.superset_test_config diff --git a/.github/workflows/superset-python-misc.yml b/.github/workflows/superset-python-misc.yml index 1c7b6b6534941..8eb34d939ab57 100644 --- a/.github/workflows/superset-python-misc.yml +++ b/.github/workflows/superset-python-misc.yml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ["3.9"] + python-version: ["3.10"] steps: - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" uses: actions/checkout@v4 @@ -51,7 +51,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ["3.9"] + python-version: ["3.10"] steps: - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" uses: actions/checkout@v4 diff --git a/.github/workflows/superset-python-presto-hive.yml b/.github/workflows/superset-python-presto-hive.yml index dd8a839d62647..dd8d6612aa3b9 100644 --- a/.github/workflows/superset-python-presto-hive.yml +++ b/.github/workflows/superset-python-presto-hive.yml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ["3.9"] + python-version: ["3.10"] env: PYTHONPATH: ${{ github.workspace }} SUPERSET_CONFIG: tests.integration_tests.superset_test_config @@ -90,7 +90,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ["3.9"] + python-version: ["3.10"] env: PYTHONPATH: ${{ github.workspace }} SUPERSET_CONFIG: tests.integration_tests.superset_test_config diff --git a/.github/workflows/superset-python-unittest.yml b/.github/workflows/superset-python-unittest.yml index 535cf0335f291..c5bf8bf46dec6 100644 --- a/.github/workflows/superset-python-unittest.yml +++ b/.github/workflows/superset-python-unittest.yml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ["3.9", "3.10"] + python-version: ["3.10", "3.11"] env: PYTHONPATH: ${{ github.workspace }} steps: diff --git a/.github/workflows/superset-translations.yml b/.github/workflows/superset-translations.yml index b088e5d839975..a96b27f0772a6 100644 --- a/.github/workflows/superset-translations.yml +++ b/.github/workflows/superset-translations.yml @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ["3.9"] + python-version: ["3.10"] steps: - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" uses: actions/checkout@v4 diff --git a/Dockerfile b/Dockerfile index 5e7dceed4d836..61b16677e197d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ ###################################################################### # Node stage to deal with static asset construction ###################################################################### -ARG PY_VER=3.9-slim-bookworm +ARG PY_VER=3.10-slim-bookworm # if BUILDPLATFORM is null, set it to 'amd64' (or leave as is otherwise). ARG BUILDPLATFORM=${BUILDPLATFORM:-amd64} diff --git a/Makefile b/Makefile index 42ec9f5aa4a10..33bb511f2de83 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,8 @@ # limitations under the License. # -# Python version installed; we need 3.9-3.11 -PYTHON=`command -v python3.11 || command -v python3.10 || command -v python3.9` +# Python version installed; we need 3.10-3.11 +PYTHON=`command -v python3.11 || command -v python3.10` .PHONY: install superset venv pre-commit @@ -70,7 +70,7 @@ update-js: venv: # Create a virtual environment and activate it (recommended) - if ! [ -x "${PYTHON}" ]; then echo "You need Python 3.9, 3.10 or 3.11 installed"; exit 1; fi + if ! [ -x "${PYTHON}" ]; then echo "You need Python 3.10 or 3.11 installed"; exit 1; fi test -d venv || ${PYTHON} -m venv venv # setup a python3 virtualenv . venv/bin/activate diff --git a/RELEASING/Dockerfile.from_local_tarball b/RELEASING/Dockerfile.from_local_tarball index e62f409febe62..8f5605b25d646 100644 --- a/RELEASING/Dockerfile.from_local_tarball +++ b/RELEASING/Dockerfile.from_local_tarball @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -FROM python:3.9-buster +FROM python:3.10-slim-bookworm RUN useradd --user-group --create-home --no-log-init --shell /bin/bash superset diff --git a/RELEASING/Dockerfile.from_svn_tarball b/RELEASING/Dockerfile.from_svn_tarball index 308adc73eba08..22883552cabfa 100644 --- a/RELEASING/Dockerfile.from_svn_tarball +++ b/RELEASING/Dockerfile.from_svn_tarball @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -FROM python:3.9-buster +FROM python:3.10-slim-bookworm RUN useradd --user-group --create-home --no-log-init --shell /bin/bash superset diff --git a/RELEASING/Dockerfile.make_docs b/RELEASING/Dockerfile.make_docs index eaa59c34ab4f3..c4bca3bb3a89a 100644 --- a/RELEASING/Dockerfile.make_docs +++ b/RELEASING/Dockerfile.make_docs @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -FROM python:3.9-buster +FROM python:3.10-slim-bookworm ARG VERSION RUN git clone --depth 1 --branch ${VERSION} https://github.com/apache/superset.git /superset diff --git a/RELEASING/Dockerfile.make_tarball b/RELEASING/Dockerfile.make_tarball index 59a306fbf4088..3a963723de093 100644 --- a/RELEASING/Dockerfile.make_tarball +++ b/RELEASING/Dockerfile.make_tarball @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -FROM python:3.9-buster +FROM python:3.10-slim-bookworm RUN apt-get update -y RUN apt-get install -y jq diff --git a/UPDATING.md b/UPDATING.md index 459cc4e452754..ba5f21c9c5362 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -35,6 +35,9 @@ assists people when migrating to a new version. files for production use cases! While we never really supported or should have tried to support docker-compose for production use cases, we now actively have taken a stance against supporting it. See the PR for details. +- [24112](https://github.com/apache/superset/pull/24112): Python 3.10 is now the recommended python version to use, 3.9 still + supported but getting deprecated in the nearish future. CI/CD runs on py310 so you probably want to align. If you + use official dockers, upgrade should happen automatically. - [27697](https://github.com/apache/superset/pull/27697) [minor] flask-session bump leads to them deprecating `SESSION_USE_SIGNER`, check your configs as this flag won't do anything moving forward. diff --git a/docker-compose-non-dev.yml b/docker-compose-non-dev.yml index b49d070118bcb..f537e26c38c15 100644 --- a/docker-compose-non-dev.yml +++ b/docker-compose-non-dev.yml @@ -26,7 +26,7 @@ x-common-build: &common-build context: . target: dev cache_from: - - apache/superset-cache:3.9-slim-bookworm + - apache/superset-cache:3.10-slim-bookworm version: "4.0" services: diff --git a/docker-compose.yml b/docker-compose.yml index 23c040b2f6ec0..9dd0a6ca8f7e9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,7 +30,7 @@ x-common-build: &common-build context: . target: dev cache_from: - - apache/superset-cache:3.9-slim-bookworm + - apache/superset-cache:3.10-slim-bookworm version: "4.0" services: diff --git a/docs/docs/contributing/local-backend.mdx b/docs/docs/contributing/local-backend.mdx index a288bd937ca99..ce62808d0c4fb 100644 --- a/docs/docs/contributing/local-backend.mdx +++ b/docs/docs/contributing/local-backend.mdx @@ -12,7 +12,7 @@ version: 1 Make sure your machine meets the [OS dependencies](/docs/installation/installing-superset-from-pypi#os-dependencies) before following these steps. You also need to install MySQL or [MariaDB](https://mariadb.com/downloads). -Ensure that you are using Python version 3.9 or 3.10, then proceed with: +Ensure that you are using Python version 3.10 or 3.11, then proceed with: ```bash # Create a virtual environment and activate it (recommended) diff --git a/docs/docs/installation/docker.mdx b/docs/docs/installation/docker.mdx index 170ca1461aa88..f307c8a57ad27 100644 --- a/docs/docs/installation/docker.mdx +++ b/docs/docs/installation/docker.mdx @@ -26,7 +26,7 @@ Here are the build presets that are exposed through the `build_docker.py` script - `lean`: The default Docker image, including both frontend and backend. Tags without a build_preset are lean builds, e.g., `latest`. - `dev`: For development, with a headless browser, dev-related utilities and root access. -- `py310`, e.g., Py310: Similar to lean but with a different Python version (in this example, 3.10). +- `py311`, e.g., Py311: Similar to lean but with a different Python version (in this example, 3.11). - `ci`: For certain CI workloads. - `websocket`: For Superset clusters supporting advanced features. - `dockerize`: Used by Helm. diff --git a/requirements/development.in b/requirements/development.in index abd40746767fd..9bad1212b8e1b 100644 --- a/requirements/development.in +++ b/requirements/development.in @@ -36,7 +36,7 @@ pylint pytest pytest-cov pytest-mock -python-ldap>=3.4.3 +python-ldap>=3.4.4 sqloxide statsd tox diff --git a/requirements/development.txt b/requirements/development.txt index 48302d4996f2f..457b1701cdf80 100644 --- a/requirements/development.txt +++ b/requirements/development.txt @@ -1,4 +1,4 @@ -# SHA1:3b6a7d105f9d14b449d4232aa368bd6a40d4c7ef +# SHA1:3ba2a85b7f1506a7fd0c2bba84ec741dbbaf8254 # # This file is autogenerated by pip-compile-multi # To update, run: @@ -226,7 +226,7 @@ pytest-cov==4.0.0 # via -r requirements/development.in pytest-mock==3.10.0 # via -r requirements/development.in -python-ldap==3.4.3 +python-ldap==3.4.4 # via -r requirements/development.in pytz-deprecation-shim==0.1.0.post0 # via tzlocal diff --git a/scripts/build_docker.py b/scripts/build_docker.py index 13453b61f96a7..3351e508dfedd 100755 --- a/scripts/build_docker.py +++ b/scripts/build_docker.py @@ -25,7 +25,7 @@ REPO = "apache/superset" CACHE_REPO = f"{REPO}-cache" -BASE_PY_IMAGE = "3.9-slim-bookworm" +BASE_PY_IMAGE = "3.10-slim-bookworm" def run_cmd(command: str, raise_on_failure: bool = True) -> str: @@ -149,9 +149,9 @@ def get_docker_command( build_target = "dev" elif build_preset == "lean": build_target = "lean" - elif build_preset == "py310": + elif build_preset == "py311": build_target = "lean" - py_ver = "3.10-slim-bookworm" + py_ver = "3.11-slim-bookworm" elif build_preset == "websocket": build_target = "" docker_context = "superset-websocket" @@ -217,7 +217,7 @@ def get_docker_command( @click.command() @click.argument( "build_preset", - type=click.Choice(["lean", "dev", "dockerize", "websocket", "py310", "ci"]), + type=click.Choice(["lean", "dev", "dockerize", "websocket", "py311", "ci"]), ) @click.argument("build_context", type=click.Choice(["push", "pull_request", "release"])) @click.option( diff --git a/tox.ini b/tox.ini index 28102e01438a9..98b5e55fcee62 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,7 @@ # Remember to start celery workers to run celery tests, e.g. # celery --app=superset.tasks.celery_app:app worker -Ofair -c 2 [testenv] -basepython = python3.9 +basepython = python3.10 ignore_basepython_conflict = true commands = superset db upgrade