From 574fc1bdee9d897c9bc9ac9dfbd95b2b01978ec1 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Mon, 9 Feb 2026 13:43:58 +0000 Subject: [PATCH] pre-commit: Bump versions The older version used are not compatible with the default Python on Fedora 43. Bumping hacking (and by extension flake8) brings up 3 new issues that we resolve here. Signed-off-by: Stephen Finucane Change-Id: Iba6de2d3e2ddb4ae5d73694f01367261371a5e92 --- .pre-commit-config.yaml | 8 ++++---- manila/tests/fake_utils.py | 2 -- manila/tests/scheduler/filters/test_affinity.py | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 70f5408d50..ad4d9b4856 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,13 @@ --- repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: mixed-line-ending args: ['--fix', 'lf'] exclude: '.*\.(svg)$' - - id: check-byte-order-marker + - id: fix-byte-order-marker - id: check-executables-have-shebangs - id: check-merge-conflict - id: debug-statements @@ -15,7 +15,7 @@ repos: files: .*\.(yaml|yml)$ exclude: '^(zuul.d|rally-jobs)/.*$' - repo: https://github.com/PyCQA/doc8 - rev: v1.1.1 + rev: v2.0.0 hooks: - id: doc8 args: ['--ignore', 'D001'] @@ -25,7 +25,7 @@ repos: - id: bashate args: ['--ignore', 'E006,E042,E043'] - repo: https://opendev.org/openstack/hacking - rev: 6.1.0 + rev: 8.0.0 hooks: - id: hacking additional_dependencies: [] diff --git a/manila/tests/fake_utils.py b/manila/tests/fake_utils.py index 3da33edd74..50ca13fac2 100644 --- a/manila/tests/fake_utils.py +++ b/manila/tests/fake_utils.py @@ -59,8 +59,6 @@ def fake_execute(*cmd_parts, **kwargs): It optionally executes a preconfigued function to return expected data. """ - global _fake_execute_repliers - process_input = kwargs.get('process_input', None) check_exit_code = kwargs.get('check_exit_code', 0) delay_on_retry = kwargs.get('delay_on_retry', True) diff --git a/manila/tests/scheduler/filters/test_affinity.py b/manila/tests/scheduler/filters/test_affinity.py index 424f4c9bd7..c8f1194d37 100644 --- a/manila/tests/scheduler/filters/test_affinity.py +++ b/manila/tests/scheduler/filters/test_affinity.py @@ -105,7 +105,7 @@ class AffinityFilterTestCase(test.TestCase): self.assertRaises(affinity.SchedulerHintsNotSet, self.filter._validate, hints) - @ mock.patch('manila.share.api.API.get') + @mock.patch('manila.share.api.API.get') def test_affinity_filter(self, mock_share_get): mock_share_get.side_effect = self._fake_get @@ -118,7 +118,7 @@ class AffinityFilterTestCase(test.TestCase): self.assertNotIn('host2', valid_hosts) self.assertNotIn('host3', valid_hosts) - @ mock.patch('manila.share.api.API.get') + @mock.patch('manila.share.api.API.get') def test_anti_affinity_filter(self, mock_share_get): mock_share_get.side_effect = self._fake_get