From 0dddc59a366426a4669e183486242c7ebe855b92 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Mon, 2 Dec 2024 12:37:17 -0800 Subject: [PATCH 1/7] feat: use uv in CI --- .github/actions/setup-backend/action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup-backend/action.yml b/.github/actions/setup-backend/action.yml index db3ff7a7824bb..8b73ad27b1681 100644 --- a/.github/actions/setup-backend/action.yml +++ b/.github/actions/setup-backend/action.yml @@ -42,12 +42,12 @@ runs: - name: Install dependencies run: | if [ "${{ inputs.install-superset }}" = "true" ]; then - sudo apt-get update && sudo apt-get -y install libldap2-dev libsasl2-dev build-essential - pip install --upgrade pip setuptools wheel + sudo apt-get update && sudo apt-get -y install libldap2-dev libsasl2-dev + pip install --upgrade pip setuptools wheel uv if [ "${{ inputs.requirements-type }}" = "dev" ]; then - pip install -r requirements/development.txt + uv --no-venv pip install -r requirements/development.txt elif [ "${{ inputs.requirements-type }}" = "base" ]; then - pip install -r requirements/base.txt + uv --no-venv pip install -r requirements/base.txt fi fi shell: bash From dafbc1ffdb772c09bea8efde761cae8b60d33ac4 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Mon, 2 Dec 2024 12:38:00 -0800 Subject: [PATCH 2/7] touch superset/ to trigger CI --- superset/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/superset/__init__.py b/superset/__init__.py index cbab58e0d2c90..c97580b122cea 100644 --- a/superset/__init__.py +++ b/superset/__init__.py @@ -34,7 +34,8 @@ # All of the fields located here should be considered legacy. The correct way # to declare "global" dependencies is to define it in extensions.py, # then initialize it in app.create_app(). These fields will be removed -# in subsequent PRs as things are migrated towards the factory pattern +# in subsequent PRs as things are migrated towards the factory +# pattern app: Flask = current_app cache = cache_manager.cache conf = LocalProxy(lambda: current_app.config) From 3775a77e662d261694fc8d8e78a6aea333850a93 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Mon, 2 Dec 2024 13:53:13 -0800 Subject: [PATCH 3/7] --system --- .github/actions/setup-backend/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-backend/action.yml b/.github/actions/setup-backend/action.yml index 8b73ad27b1681..6d60b2cb61401 100644 --- a/.github/actions/setup-backend/action.yml +++ b/.github/actions/setup-backend/action.yml @@ -45,9 +45,9 @@ runs: sudo apt-get update && sudo apt-get -y install libldap2-dev libsasl2-dev pip install --upgrade pip setuptools wheel uv if [ "${{ inputs.requirements-type }}" = "dev" ]; then - uv --no-venv pip install -r requirements/development.txt + uv --system pip install -r requirements/development.txt elif [ "${{ inputs.requirements-type }}" = "base" ]; then - uv --no-venv pip install -r requirements/base.txt + uv --system pip install -r requirements/base.txt fi fi shell: bash From 22c4eb3763e0bfb9a2084476f5088c436c842445 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Mon, 2 Dec 2024 13:56:50 -0800 Subject: [PATCH 4/7] --system in the right spot --- .github/actions/setup-backend/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-backend/action.yml b/.github/actions/setup-backend/action.yml index 6d60b2cb61401..1910f48514580 100644 --- a/.github/actions/setup-backend/action.yml +++ b/.github/actions/setup-backend/action.yml @@ -45,9 +45,9 @@ runs: sudo apt-get update && sudo apt-get -y install libldap2-dev libsasl2-dev pip install --upgrade pip setuptools wheel uv if [ "${{ inputs.requirements-type }}" = "dev" ]; then - uv --system pip install -r requirements/development.txt + uv pip install --system -r requirements/development.txt elif [ "${{ inputs.requirements-type }}" = "base" ]; then - uv --system pip install -r requirements/base.txt + uv pip install --system -r requirements/base.txt fi fi shell: bash From 0f51844085b1cf2e934c5da4802401566b871efc Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Mon, 2 Dec 2024 14:02:19 -0800 Subject: [PATCH 5/7] touching up python versions --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4833e0f269afb..105f4239c46a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ name = "apache-superset" description = "A modern, enterprise-ready business intelligence web application" readme = "README.md" dynamic = ["version", "scripts", "entry-points"] -requires-python = "~=3.9" +requires-python = ">=3.9" license = { file="LICENSE.txt" } authors = [ { name = "Apache Software Foundation", email = "dev@superset.apache.org" }, @@ -276,8 +276,8 @@ exclude = [ line-length = 88 indent-width = 4 -# Assume Python 3.8 -target-version = "py310" + +target-version = "py39" [tool.ruff.lint] # Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. From 5b947f5dd3adcca1fc007536449555abd43076a2 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Mon, 2 Dec 2024 15:00:53 -0800 Subject: [PATCH 6/7] rm unrelated changes --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 105f4239c46a7..4833e0f269afb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ name = "apache-superset" description = "A modern, enterprise-ready business intelligence web application" readme = "README.md" dynamic = ["version", "scripts", "entry-points"] -requires-python = ">=3.9" +requires-python = "~=3.9" license = { file="LICENSE.txt" } authors = [ { name = "Apache Software Foundation", email = "dev@superset.apache.org" }, @@ -276,8 +276,8 @@ exclude = [ line-length = 88 indent-width = 4 - -target-version = "py39" +# Assume Python 3.8 +target-version = "py310" [tool.ruff.lint] # Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. From 0a6c3adbf5a886fe98c9e7814e416dae07878047 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Mon, 2 Dec 2024 18:01:01 -0800 Subject: [PATCH 7/7] add uv to Dockerfil --- Dockerfile | 4 ++-- docker/pip-install.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9a89cef3572ea..60ba12eabff32 100644 --- a/Dockerfile +++ b/Dockerfile @@ -85,7 +85,7 @@ RUN if [ "$BUILD_TRANSLATIONS" = "true" ]; then \ # Transition to Python base image FROM python:${PY_VER} AS python-base -RUN pip install --no-cache-dir --upgrade setuptools pip +RUN pip install --no-cache-dir --upgrade setuptools pip uv ###################################################################### # Final lean image... @@ -191,7 +191,7 @@ RUN --mount=type=bind,source=./docker,target=/docker \ # Install Playwright and its dependencies RUN --mount=type=cache,target=/root/.cache/pip \ - pip install playwright \ + uv pip install --system playwright \ && playwright install-deps # Optionally install Chromium diff --git a/docker/pip-install.sh b/docker/pip-install.sh index 2defc7d1e792a..7e69a6efba164 100755 --- a/docker/pip-install.sh +++ b/docker/pip-install.sh @@ -47,10 +47,10 @@ fi # Choose whether to use pip cache if $USE_CACHE; then echo "Using pip cache..." - pip install "${ARGS[@]}" + uv pip install --system "${ARGS[@]}" else echo "Disabling pip cache..." - pip install --no-cache-dir "${ARGS[@]}" + uv pip install --system --no-cache-dir "${ARGS[@]}" fi # Remove build-essential if it was installed