From 30f59ec0276ce9ec034b7a9157e95064c44078c1 Mon Sep 17 00:00:00 2001 From: Jakub Kadlcik Date: Thu, 30 Jan 2020 13:30:14 +0100 Subject: [PATCH] Use pycodestyle pacakge when pep8 is not available --- hacking/titotest-fedora-rawhide/Dockerfile | 2 +- test/unit/pep8_tests.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hacking/titotest-fedora-rawhide/Dockerfile b/hacking/titotest-fedora-rawhide/Dockerfile index 0fffc04..e6f3a54 100644 --- a/hacking/titotest-fedora-rawhide/Dockerfile +++ b/hacking/titotest-fedora-rawhide/Dockerfile @@ -15,7 +15,7 @@ RUN dnf -y install \ python3-mock \ python3-nose \ python3-blessed \ - python3-pep8 \ + python3-pycodestyle \ rsync \ createrepo_c diff --git a/test/unit/pep8_tests.py b/test/unit/pep8_tests.py index 05c7717..e878b42 100644 --- a/test/unit/pep8_tests.py +++ b/test/unit/pep8_tests.py @@ -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