From 20a35a7721531cf8e2d951f54b4c83631bea16b7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 08:03:03 +0000 Subject: [PATCH] ci(deps): lock file maintenance (main) (#2702) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci(deps): lock file maintenance * Update Python compatibility markers and modernize code Update resolution markers to support Python 3.12 as primary version with 3.11 as fallback. Modernize Python 3.10+ syntax by replacing typing constructs with built-in generics (Optional → None union, List → list, Tuple → tuple). Update imports to use traceback at module level and refactor error handling from assert to raise AssertionError. Simplify failure summary output by removing truncation logic. Replace uv.lock with updated dependencies reflecting Python version changes. * chore: update pre-commit dependencies Update ruff to v0.15.12, gitleaks to v8.30.1, and mypy to v1.20.2. Also remove unnecessary space in string join operation in test fixture. * Fix CLI tool invocations with missing configuration flags Update pytest, prek, and ruff commands to include their required configuration flags. Add `--group tests` to pytest invocation, add `-c .pre-commit-config.yaml` to prek invocation, and add `--config pyproject.toml` to ruff invocation. Also remove extra space in string join operation for consistency. * test: Update pytest invocation with test dependency group The pytest command in the CLI test now includes the `--group tests` flag to ensure the test dependencies are available when running pytest through the uv package manager. * Refactor imports in class_generator_template.j2 Reorganize imports to improve readability and add conditional import for MissingRequiredArgumentError. The exception import is now only included when there are required arguments that will actually use it, reducing unnecessary dependencies in generated classes with no required arguments. * Remove extra blank line in class_generator_template.j2 * Improve file formatting with prek and ruff fallback Add ruff as a fallback formatter when prek fails. Extract project root path calculation to module level and pass configuration paths explicitly to prek. Introduce _run_ruff_fallback() helper that runs ruff check and ruff format sequentially. Update logging to clarify fallback behavior and fix typo in prek stdout log message. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Meni Yakove --- .pre-commit-config.yaml | 6 +++--- class_generator/tests/test_class_generator.py | 2 ++ tests/scripts/generate_pytest_test.py | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ca34ab9b50..0aeefcb69e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,18 +46,18 @@ repos: ] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.12.2 + rev: v0.15.12 hooks: - id: ruff - id: ruff-format - repo: https://github.com/gitleaks/gitleaks - rev: v8.27.2 + rev: v8.30.1 hooks: - id: gitleaks - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.16.1 + rev: v1.20.2 hooks: - id: mypy exclude: ^(tests/|examples/|docs/) diff --git a/class_generator/tests/test_class_generator.py b/class_generator/tests/test_class_generator.py index bf10c08cc8..00ad485f1c 100644 --- a/class_generator/tests/test_class_generator.py +++ b/class_generator/tests/test_class_generator.py @@ -18,11 +18,13 @@ "Deployment", "Image", "ImageContentSourcePolicy", + "Ingress", "Machine", "NMState", "OAuth", "Pipeline", "Pod", + "RouteAdvertisements", "Secret", "ServiceMeshMember", "ServingRuntime", diff --git a/tests/scripts/generate_pytest_test.py b/tests/scripts/generate_pytest_test.py index 35a716177e..17d59f74b8 100644 --- a/tests/scripts/generate_pytest_test.py +++ b/tests/scripts/generate_pytest_test.py @@ -745,7 +745,7 @@ def run_ruff_on_files(filepaths: list[str]) -> bool: # Run ruff format and check on all files for op in ("format", "check"): - cmd_str = f"uvx ruff {op} {' '.join(filepaths)}" + cmd_str = f"uvx ruff --config pyproject.toml {op} {' '.join(filepaths)}" rc, _, _ = run_command( command=shlex.split(cmd_str), verify_stderr=False,