From 52e3fee5ef5217eed5efcb2289b6171b5d26fef3 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Fri, 21 Feb 2020 06:09:58 +0900 Subject: Switch to hacking 3.0.1 In hacking 2.0 or later, local-check-factory was removed as it is not compatible with flake8 3.x and it is advised to use flake8's local plugins [1]. neutron-lib provided a factory to register common hacking rules, but it no longer works with hacking 2, so we need to define rules defined in neutron-lib as flake8 local check plugin [2] explicitly. This needs to be done in each neutron related project, so it is the downside of the migration to hacking 2.x (I explored a way to continue to use the factory but failed to find a good way to achieve this) but I believe it is good to migrate the newer libraries. * flake8ext decorator in neutron/hacking/checks.py is also replaced with hacking.core.flake8ext to avoid the copy-and-paste code. * neutron-lib dependency is updated as neutron-lib 2.3 added hacking 3 support. * Python modules related to coding style checks (listed in blacklist.txt in openstack/requirements repo) are dropped from lower-constraints.txt as they are not actually used in tests (other than pep8). * HackingDocTestCase is now converted into normal test cases. HackingDocTestCase depends on the internal of hacking and pycodestyle so it looks better to use normal style of writing tests. [1] https://docs.openstack.org/releasenotes/hacking/unreleased.html#relnotes-2-0-0 [2] https://flake8.pycqa.org/en/3.7.0/user/configuration.html#using-local-plugins Change-Id: I92cf50a84bb587a0649a7cffee15cce4ce37d086 --- test-requirements.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test-requirements.txt') diff --git a/test-requirements.txt b/test-requirements.txt index b3101e6ebf..6a8a310089 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,12 +1,11 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking>=1.1.0,<1.2.0 # Apache-2.0 +hacking>=3.0.1,<3.1.0 # Apache-2.0 bandit!=1.6.0,>=1.1.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD flake8-import-order==0.12 # LGPLv3 -pycodestyle>=2.0.0 # MIT python-subunit>=1.0.0 # Apache-2.0/BSD testtools>=2.2.0 # MIT testresources>=2.0.0 # Apache-2.0/BSD -- cgit v1.2.1