diff options
author | Christian Heimes <cheimes@redhat.com> | 2016-01-15 13:49:36 +0100 |
---|---|---|
committer | Christian Heimes <cheimes@redhat.com> | 2016-01-25 15:53:38 +0100 |
commit | 0d2d97f9bf6802f6f81090eca6e135e50fea7883 (patch) | |
tree | 2775d8abf2bbd20897bb61cb468644fd80c9ab23 | |
parent | 9609f4e6035d3cdff19a0f78caee2d08b095c8ba (diff) | |
download | pki-0d2d97f9bf6802f6f81090eca6e135e50fea7883.tar.gz pki-0d2d97f9bf6802f6f81090eca6e135e50fea7883.tar.xz pki-0d2d97f9bf6802f6f81090eca6e135e50fea7883.zip |
Run flake8 and pylint --py3k tests during RPM build
pki-core.spec now ensures that Python code stays compatible with Python
3 and is nicely formatted, too.
https://fedorahosted.org/pki/ticket/1738
-rw-r--r-- | scripts/compose_functions | 2 | ||||
-rw-r--r-- | specs/pki-core.spec | 21 |
2 files changed, 22 insertions, 1 deletions
diff --git a/scripts/compose_functions b/scripts/compose_functions index c4ae173e4..e7acec9e1 100644 --- a/scripts/compose_functions +++ b/scripts/compose_functions @@ -42,7 +42,7 @@ export PKI_DOGTAG_DIR PKI_REDHAT_DIR="${PKI_DIR}/redhat" export PKI_REDHAT_DIR -PKI_FILE_LIST="CMakeLists.txt COPYING CPackConfig.cmake ConfigureChecks.cmake DefineOptions.cmake README cmake_uninstall.cmake.in config.h.cmake scripts/pylint-build-scan.py scripts/dogtag.pylintrc" +PKI_FILE_LIST="CMakeLists.txt COPYING CPackConfig.cmake ConfigureChecks.cmake DefineOptions.cmake README cmake_uninstall.cmake.in config.h.cmake scripts/pylint-build-scan.py scripts/dogtag.pylintrc tox.ini" export PKI_FILE_LIST PKI_CMAKE_DIR="cmake" diff --git a/specs/pki-core.spec b/specs/pki-core.spec index df2e3aa9e..6aea274e5 100644 --- a/specs/pki-core.spec +++ b/specs/pki-core.spec @@ -103,6 +103,8 @@ BuildRequires: resteasy >= 3.0.6-2 %if ! 0%{?rhel} BuildRequires: pylint +BuildRequires: python-flake8 +BuildRequires: python3-flake8 %endif BuildRequires: python-nss @@ -722,6 +724,25 @@ if [ $? -ne 0 ]; then echo "pylint failed. RC: $?" exit 1 fi + +python2 ../pylint-build-scan.py rpm --prefix %{buildroot} -- --py3k +if [ $? -ne 0 ]; then + echo "pylint --py3k failed. RC: $?" + exit 1 +fi + +flake8 --config ../tox.ini %{buildroot} +if [ $? -ne 0 ]; then + echo "flake8 for Python 2 failed. RC: $?" + exit 1 +fi + +python3-flake8 --config ../tox.ini %{buildroot} +if [ $? -ne 0 ]; then + echo "flake8 for Python 3 failed. RC: $?" + exit 1 +fi + %endif %{__rm} -rf %{buildroot}%{_datadir}/pki/server/lib |