Use pycodestyle pacakge when pep8 is not available

This commit is contained in:
Jakub Kadlcik 2020-01-30 13:30:14 +01:00
parent 176d546872
commit 30f59ec027
2 changed files with 10 additions and 2 deletions

View file

@ -15,7 +15,7 @@ RUN dnf -y install \
python3-mock \
python3-nose \
python3-blessed \
python3-pep8 \
python3-pycodestyle \
rsync \
createrepo_c

View file

@ -21,7 +21,15 @@ Python 3 is picky about indentation:
http://docs.python.org/3.3/reference/lexical_analysis.html
"""
import pep8
try:
# python-pep8 package is retired in Fedora because upstream
# moved to pycodestyle. Please see
# https://bugzilla.redhat.com/show_bug.cgi?id=1667200
import pep8
except ImportError:
import pycodestyle as pep8
from tito.compat import * # NOQA
from unit.fixture import TitoUnitTestFixture, REPO_DIR