summaryrefslogtreecommitdiffstats
path: root/specs
diff options
context:
space:
mode:
authorChristian Heimes <cheimes@redhat.com>2016-01-15 13:49:36 +0100
committerChristian Heimes <cheimes@redhat.com>2016-01-25 15:53:38 +0100
commit0d2d97f9bf6802f6f81090eca6e135e50fea7883 (patch)
tree2775d8abf2bbd20897bb61cb468644fd80c9ab23 /specs
parent9609f4e6035d3cdff19a0f78caee2d08b095c8ba (diff)
downloadpki-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
Diffstat (limited to 'specs')
-rw-r--r--specs/pki-core.spec21
1 files changed, 21 insertions, 0 deletions
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