diff mbox series

[ovs-dev] python: Remove hacking dependency and use recent flake8.

Message ID 20240410135624.609728-1-dceara@redhat.com
State Accepted
Commit 241365b6d10fe565b5ae198bc5bd9120f604e8fa
Delegated to: Ilya Maximets
Headers show
Series [ovs-dev] python: Remove hacking dependency and use recent flake8. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation fail test: fail

Commit Message

Dumitru Ceara April 10, 2024, 1:56 p.m. UTC
The previously enabled 'hacking' checks were only applicable to Python 2
code.  OVS doesn't support Python 2 for a while now so it's fine to
remove the dependency on hacking.

A similar change landed in OVN a while ago:
https://github.com/ovn-org/ovn/commit/271186fa7d76

Signed-off-by: Dumitru Ceara <dceara@redhat.com>
---
 .ci/linux-prepare.sh                    | 2 +-
 Documentation/intro/install/general.rst | 5 +----
 Makefile.am                             | 6 ------
 3 files changed, 2 insertions(+), 11 deletions(-)

Comments

Simon Horman April 10, 2024, 4:24 p.m. UTC | #1
On Wed, Apr 10, 2024 at 03:56:24PM +0200, Dumitru Ceara wrote:
> The previously enabled 'hacking' checks were only applicable to Python 2
> code.  OVS doesn't support Python 2 for a while now so it's fine to
> remove the dependency on hacking.
> 
> A similar change landed in OVN a while ago:
> https://github.com/ovn-org/ovn/commit/271186fa7d76
> 
> Signed-off-by: Dumitru Ceara <dceara@redhat.com>

Acked-by: Simon Horman <horms@ovn.org>
Ilya Maximets April 10, 2024, 8:28 p.m. UTC | #2
On 4/10/24 18:24, Simon Horman wrote:
> On Wed, Apr 10, 2024 at 03:56:24PM +0200, Dumitru Ceara wrote:
>> The previously enabled 'hacking' checks were only applicable to Python 2
>> code.  OVS doesn't support Python 2 for a while now so it's fine to
>> remove the dependency on hacking.
>>
>> A similar change landed in OVN a while ago:
>> https://github.com/ovn-org/ovn/commit/271186fa7d76
>>
>> Signed-off-by: Dumitru Ceara <dceara@redhat.com>
> 
> Acked-by: Simon Horman <horms@ovn.org>

Thanks, Dumitru and Simon!

Applied to all branches down to 2.17.

Best regards, Ilya Maximets.
diff mbox series

Patch

diff --git a/.ci/linux-prepare.sh b/.ci/linux-prepare.sh
index 5028bdc442dc..2a191b57fb8f 100755
--- a/.ci/linux-prepare.sh
+++ b/.ci/linux-prepare.sh
@@ -23,7 +23,7 @@  cd ..
 #     https://github.com/pypa/pip/issues/10655
 pip3 install --disable-pip-version-check --user wheel
 pip3 install --disable-pip-version-check --user \
-    flake8 'hacking>=3.0' netaddr pyparsing sarif-tools sphinx setuptools
+    flake8 netaddr pyparsing sarif-tools sphinx setuptools
 
 # Install python test dependencies
 pip3 install -r python/test_requirements.txt
diff --git a/Documentation/intro/install/general.rst b/Documentation/intro/install/general.rst
index 17c154268054..23585117647d 100644
--- a/Documentation/intro/install/general.rst
+++ b/Documentation/intro/install/general.rst
@@ -176,10 +176,7 @@  following to obtain better warnings:
 
 - clang, version 3.4 or later
 
-- flake8 along with the hacking flake8 plugin (for Python code). The automatic
-  flake8 check that runs against Python code has some warnings enabled that
-  come from the "hacking" flake8 plugin. If it's not installed, the warnings
-  just won't occur until it's run on a system with "hacking" installed.
+- flake8 (for Python code)
 
 - the python packages listed in "python/test_requirements.txt" (compatible
   with pip). If they are installed, the pytest-based Python unit tests will
diff --git a/Makefile.am b/Makefile.am
index 45fce1243a72..e6c90a911aa8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -402,16 +402,10 @@  ALL_LOCAL += flake8-check
 #   F811 redefinition of unused <name> from line <N> (only from flake8 v2.0)
 # D*** -- warnings from flake8-docstrings plugin
 # H*** -- warnings from flake8 hacking plugin (custom style checks beyond PEP8)
-#   H231 Python 3.x incompatible 'except x,y:' construct
-#   H232 Python 3.x incompatible octal 077 should be written as 0o77
-#   H233 Python 3.x incompatible use of print operator
-#   H238 old style class declaration, use new style (inherit from `object`)
-FLAKE8_SELECT = H231,H232,H233,H238
 FLAKE8_IGNORE = E121,E123,E125,E126,E127,E128,E129,E131,E203,E722,W503,W504,F811,D,H,I
 flake8-check: $(FLAKE8_PYFILES)
 	$(FLAKE8_WERROR)$(AM_V_GEN) \
 	  src='$^' && \
-	  flake8 $$src --select=$(FLAKE8_SELECT) $(FLAKE8_FLAGS) && \
 	  flake8 $$src --ignore=$(FLAKE8_IGNORE) $(FLAKE8_FLAGS) && \
 	  touch $@
 endif