From b12f5f8394ff60f96feb9584ab0b9768ae502103 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Mon, 1 Dec 2025 15:35:22 -0500 Subject: [PATCH] fix: CI failures caused by a ruff version mismatch (#36358) --- .github/workflows/pre-commit.yml | 4 +++- .pre-commit-config.yaml | 13 ++++++++++--- .../pythonpath_dev/superset_config_docker_light.py | 1 + pyproject.toml | 1 + requirements/development.txt | 2 +- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index d2095e8aec4..093956054d5 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -71,7 +71,9 @@ jobs: GIT_DIFF_EXIT_CODE=$? if [ "${PRE_COMMIT_EXIT_CODE}" -ne 0 ] || [ "${GIT_DIFF_EXIT_CODE}" -ne 0 ]; then if [ "${PRE_COMMIT_EXIT_CODE}" -ne 0 ]; then - echo "❌ Pre-commit check failed (exit code: ${EXIT_CODE})." + echo "❌ Pre-commit check failed (exit code: ${PRE_COMMIT_EXIT_CODE})." + echo "🔍 Modified files:" + git diff --name-only else echo "❌ Git working directory is dirty." echo "📌 This likely means that pre-commit made changes that were not committed." diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4069fc6ebaf..e95821998da 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -106,12 +106,19 @@ repos: files: helm verbose: false args: ["--log-level", "error"] - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.9.7 + # Using local hooks ensures ruff version matches requirements/development.txt + - repo: local hooks: - id: ruff-format + name: ruff-format + entry: ruff format + language: system + types: [python] - id: ruff - args: [--fix] + name: ruff + entry: ruff check --fix --show-fixes + language: system + types: [python] - repo: local hooks: - id: pylint diff --git a/docker/pythonpath_dev/superset_config_docker_light.py b/docker/pythonpath_dev/superset_config_docker_light.py index 9a5ae0ae67a..1f053c2ce36 100644 --- a/docker/pythonpath_dev/superset_config_docker_light.py +++ b/docker/pythonpath_dev/superset_config_docker_light.py @@ -19,6 +19,7 @@ # Import all settings from the main config first from flask_caching.backends.filesystemcache import FileSystemCache + from superset_config import * # noqa: F403 # Override caching to use simple in-memory cache instead of Redis diff --git a/pyproject.toml b/pyproject.toml index b7a85f799d2..710806dc6f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -352,6 +352,7 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" "superset/translations/utils.py" = ["TID251"] "superset/extensions/__init__.py" = ["TID251"] "superset/utils/json.py" = ["TID251"] +"docker/*" = ["I"] # Docker config files have non-standard imports that vary by environment [tool.ruff.lint.isort] case-sensitive = false diff --git a/requirements/development.txt b/requirements/development.txt index 04c37be6b0b..af663457ea0 100644 --- a/requirements/development.txt +++ b/requirements/development.txt @@ -886,7 +886,7 @@ rsa==4.9.1 # via # -c requirements/base-constraint.txt # google-auth -ruff==0.8.0 +ruff==0.9.7 # via apache-superset secretstorage==3.4.1 # via keyring