From 0c5406da76c5c077c055e6462296f6eec6024878 Mon Sep 17 00:00:00 2001 From: Brian Rosmaita Date: Tue, 19 Jan 2021 16:08:54 -0500 Subject: [PATCH] Ensure pep8/fast8 run in python 3.6 Running pep8 under py38 is resulting in "AttributeError: 'FlakesChecker' object has no attribute 'CONSTANT'". The least intrusive fix seems to be to pin the tox pep8/fast8 testenvs to python3.6. Also, keep pycodestyle under 2.6.0 so we don't have to make any purely stylistic changes in stable/train to get pep8 to pass. Change-Id: I17b30c43aa00214d56c51bde3b9d43c0db1695ac --- test-requirements.txt | 2 +- tox.ini | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index 9b283076e73..32874d92761 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -11,7 +11,7 @@ fixtures>=3.0.0 # Apache-2.0/BSD mock>=2.0.0 # BSD os-api-ref>=1.4.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0 -pycodestyle>=2.0.0 # MIT License +pycodestyle>=2.0.0,<2.6.0 # MIT License PyMySQL>=0.7.6 # MIT License psycopg2>=2.7 # LGPL/ZPL SQLAlchemy-Utils>=0.33.11 # BSD License diff --git a/tox.ini b/tox.ini index 33c40d14d89..084febc461f 100644 --- a/tox.ini +++ b/tox.ini @@ -73,7 +73,7 @@ setenv = OS_TEST_PATH = ./cinder/tests/compliance [testenv:pep8] -basepython = python3 +basepython = python3.6 commands = flake8 {posargs} . doc8 @@ -81,7 +81,7 @@ commands = {toxinidir}/tools/check_exec.py {toxinidir}/cinder {toxinidir}/doc/source/ {toxinidir}/releasenotes/notes [testenv:fast8] -basepython = python3 +basepython = python3.6 # Use same environment directory as pep8 env to save space and install time envdir = {toxworkdir}/pep8 commands =