Nir Soffer has uploaded a new change for review.

Change subject: build: Remove pep8 and pyflakes requirement
......................................................................

build: Remove pep8 and pyflakes requirement

We use to build-require both pep8 and pyflakes, which cause trouble when
using older version. This leads to build failures, or to horrible code
tyring to make old buggy pyflakes happy.

Vdsm does not require pep8 or pyflakes for building packages; these are
development tools that should be installed on a development machine or
on CI environment, using the versions supported by current vdsm code.

In the makefile, "make check" during make rpm was disabled on EL,
because incompatible or missing pep8 and pyflakes versions; This hack
was removed, so make rpm will do the same thing all platforms.

In the makfile, we run pep8 or pyflakes checks only if these tools are
installed.

4 copies of incompatible pep8 and pyflakes version were removed from the
packages list.

Finally, we install the correct version of these tools in the CI
environment using pip.

Change-Id: I6f0cdf21f18604c3fe81fa724aab0e613fb04289
Signed-off-by: Nir Soffer <nsof...@redhat.com>
---
M Makefile.am
M automation/build-artifacts.sh
M automation/check-merged.packages.el7
M automation/check-merged.packages.fc23
M automation/check-patch.packages.el7
M automation/check-patch.packages.fc23
M automation/check-patch.sh
M vdsm.spec.in
8 files changed, 23 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/52/56152/1

diff --git a/Makefile.am b/Makefile.am
index 4ce5ec5..b124ffb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -102,19 +102,27 @@
 
 .PHONY: pyflakes
 pyflakes: all
-       python -c 'import pyflakes; print("pyflakes-%s" % pyflakes.__version__)'
-       ( find . -path './.git' -prune -type f -o \
-               -name '*.py' && \
-               echo $(WHITELIST) ) | xargs $(PYFLAKES)
+       if [ -n "$(PYFLAKES)" ]; then \
+               python -c 'import pyflakes; print("pyflakes-%s" % 
pyflakes.__version__)'; \
+               ( find . -path './.git' -prune -type f -o \
+                       -name '*.py' && \
+                       echo $(WHITELIST) ) | xargs $(PYFLAKES); \
+       else \
+           echo "Warning: pyflakes is not installed, skipping check"; \
+       fi
 
 .PHONY: pep8
 pep8: all
-       $(PEP8) --version
-       for x in $(PEP8_BLACKLIST); do \
-           exclude="$${exclude},$${x}" ; \
-       done ; \
-       $(PEP8) --exclude="$${exclude}" --filename '*.py' . \
-       $(WHITELIST)
+       if [ -n "$(PEP8)" ]; then \
+               $(PEP8) --version; \
+               for x in $(PEP8_BLACKLIST); do \
+                       exclude="$${exclude},$${x}" ; \
+               done ; \
+               $(PEP8) --exclude="$${exclude}" --filename '*.py' . \
+               $(WHITELIST); \
+       else \
+           echo "Warning: pep8 is not installed, skipping check"; \
+       fi
 
 .PHONY: python3
 python3: all
diff --git a/automation/build-artifacts.sh b/automation/build-artifacts.sh
index 0ee45c3..9576756 100755
--- a/automation/build-artifacts.sh
+++ b/automation/build-artifacts.sh
@@ -16,7 +16,7 @@
 make
 # tests will be done elsewhere
 yum-builddep ./vdsm.spec
-make PYFLAKES=true PEP8=true NOSE_EXCLUDE=.* rpm
+make PYFLAKES="" PEP8="" NOSE_EXCLUDE=.* rpm
 
 find "$BUILDS" \
     -iname \*.rpm \
diff --git a/automation/check-merged.packages.el7 
b/automation/check-merged.packages.el7
index feebc90..6ae3d94 100644
--- a/automation/check-merged.packages.el7
+++ b/automation/check-merged.packages.el7
@@ -8,7 +8,6 @@
 make
 mom
 policycoreutils-python
-pyflakes
 python-blivet
 python-coverage
 python-devel
@@ -16,7 +15,6 @@
 python-ioprocess
 python-netaddr
 python-nose
-python-pep8
 python-pthreading
 python-rtslib
 python-six
diff --git a/automation/check-merged.packages.fc23 
b/automation/check-merged.packages.fc23
index dd5c7f2..5387eea 100644
--- a/automation/check-merged.packages.fc23
+++ b/automation/check-merged.packages.fc23
@@ -8,7 +8,6 @@
 make
 mom
 policycoreutils-python
-pyflakes
 python-blivet
 python-coverage
 python-devel
@@ -16,7 +15,6 @@
 python-ioprocess
 python-netaddr
 python-nose
-python-pep8
 python-pthreading
 python-rtslib
 python-six
diff --git a/automation/check-patch.packages.el7 
b/automation/check-patch.packages.el7
index feebc90..bba5556 100644
--- a/automation/check-patch.packages.el7
+++ b/automation/check-patch.packages.el7
@@ -8,7 +8,6 @@
 make
 mom
 policycoreutils-python
-pyflakes
 python-blivet
 python-coverage
 python-devel
@@ -16,9 +15,9 @@
 python-ioprocess
 python-netaddr
 python-nose
-python-pep8
 python-pthreading
 python-rtslib
+python-setuptools
 python-six
 python34-nose
 python34-six
diff --git a/automation/check-patch.packages.fc23 
b/automation/check-patch.packages.fc23
index fa342d4..e0dd375 100644
--- a/automation/check-patch.packages.fc23
+++ b/automation/check-patch.packages.fc23
@@ -7,7 +7,6 @@
 make
 mom
 policycoreutils-python
-pyflakes
 python-blivet
 python-coverage
 python-devel
@@ -15,7 +14,6 @@
 python-ioprocess
 python-netaddr
 python-nose
-python-pep8
 python-pthreading
 python-six
 python3-netaddr
diff --git a/automation/check-patch.sh b/automation/check-patch.sh
index 4c43c5a..14ba792 100755
--- a/automation/check-patch.sh
+++ b/automation/check-patch.sh
@@ -4,6 +4,9 @@
 
 set -xe
 
+easy_install pip
+pip install -U pep8==1.5.7 pyflakes==1.1.0
+
 ./autogen.sh --system --enable-hooks
 
 # Run nosetests only over fedora mock to save Jenkins resources
diff --git a/vdsm.spec.in b/vdsm.spec.in
index f737d5e..3f235e7 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -28,13 +28,6 @@
 # touch configure.ac or Makefile.am.
 %{!?enable_autotools:%global enable_autotools 0}
 
-# Skips check since rhel default repos lack pep8 and pyflakes
-%if ! 0%{?rhel}
-%{!?with_check:%global with_check 1}
-%else
-%{!?with_check:%global with_check 0}
-%endif
-
 # Required paths
 %if 0%{?fedora}
 %global _polkitdir %{_datadir}/polkit-1/rules.d
@@ -102,11 +95,6 @@
 BuildRequires: automake
 BuildRequires: gettext-devel
 BuildRequires: libtool
-%endif
-
-%if 0%{?with_check}
-BuildRequires: pyflakes
-BuildRequires: python-pep8
 %endif
 
 BuildRequires: systemd-units
@@ -749,9 +737,7 @@
                  %{buildroot}%{_sysconfdir}/libvirt/hooks/qemu
 
 %check
-%if 0%{?with_check}
 make check
-%endif
 
 %clean
 rm -rf %{buildroot}


-- 
To view, visit https://gerrit.ovirt.org/56152
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6f0cdf21f18604c3fe81fa724aab0e613fb04289
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsof...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to