[PATCH] Issue #740: Solving UI dependencies checking.

From: Paulo Vital <pvital@linux.vnet.ibm.com> Commit 9fbb105 added pip commands on Makefile to install some Python modules during the UI compilation. However, the compilation step of the UI files is executed before the block where the commands were added, resulting in compilation fail if the system doesn't have the modules installed. In addition, pip commands need to be executed as root and, as good practice, the compilation should be executed as normal user. Removing from Makefile the pip commands to instal the Python modules and adding checks in configure.ac to see if they are installed. Also, edit the README.md to explain how to install the modules as dependencies to build Wok. Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- Makefile.am | 2 -- configure.ac | 7 +++++++ docs/README.md | 6 ++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8d2f346..3d3b5d6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -65,8 +65,6 @@ all-local: $(MKDIR_P) $$dir ; \ ln -sf ../../../po/$$L.gmo $$dir/wok.mo ; \ done < po/LINGUAS - pip install cython --no-input - pip install libsass --no-input --upgrade # # Packaging helpers diff --git a/configure.ac b/configure.ac index a3a0fc2..dd3955e 100644 --- a/configure.ac +++ b/configure.ac @@ -38,6 +38,7 @@ AM_INIT_AUTOMAKE([-Wno-portability]) AM_PATH_PYTHON([2.6]) AC_PATH_PROG([PEP8], [pep8], [/usr/bin/pep8]) AC_PYTHON_MODULE([unittest]) +AC_PYTHON_MODULE([cython], [fatal]) AC_SUBST([HAVE_PYMOD_UNITTEST]) AC_SUBST([PYTHON_VERSION]) AM_GNU_GETTEXT([external]) @@ -50,6 +51,12 @@ if test "x$PYFLAKES" = "x"; then AC_MSG_WARN([pyflakes not found]) fi +# Checking for libsass +AC_PATH_PROG([LIBSASS], [sassc]) +if test "x$LIBSASS" = "x"; then + AC_MSG_ERROR([sassc not found. Please execute "pip install libsass"]) +fi + AC_ARG_ENABLE( [sample], [AS_HELP_STRING( diff --git a/docs/README.md b/docs/README.md index 650ab83..c6c5601 100644 --- a/docs/README.md +++ b/docs/README.md @@ -55,6 +55,8 @@ Install Dependencies python-psutil python-ldap python-lxml \ libxslt nginx openssl python-dev python-pip + $ sudo pip install cython libsass + # If using RHEL, install the following additional packages: $ sudo yum install python-unittest2 python-ordereddict @@ -81,6 +83,8 @@ channel at RHN Classic or Red Hat Satellite. python-psutil python-ldap python-lxml nginx \ libxslt openssl python-dev python-pip + $ sudo pip install cython libsass + Packages version requirement: python-jsonschema >= 1.3.0 python-psutil >= 0.6.0 @@ -97,6 +101,8 @@ channel at RHN Classic or Red Hat Satellite. libxslt-tools python-xml nginx openssl python-dev \ python-pip + $ sudo pip install cython libsass + Packages version requirement: python-psutil >= 0.6.0 -- 2.4.3

Hi Paulo, Thanks for this fix! Just a quick change, I believe it is safe to change python-dev to to python-devel. Fedora 22 can't find python-dev, while other distros point to python-devel. Regards, Samuel -----Original Message----- From: kimchi-devel-bounces@ovirt.org [mailto:kimchi-devel-bounces@ovirt.org] On Behalf Of pvital@linux.vnet.ibm.com Sent: quarta-feira, 14 de outubro de 2015 10:39 To: Kimchi Devel <kimchi-devel@ovirt.org> Subject: [Kimchi-devel] [PATCH] Issue #740: Solving UI dependencies checking. From: Paulo Vital <pvital@linux.vnet.ibm.com> Commit 9fbb105 added pip commands on Makefile to install some Python modules during the UI compilation. However, the compilation step of the UI files is executed before the block where the commands were added, resulting in compilation fail if the system doesn't have the modules installed. In addition, pip commands need to be executed as root and, as good practice, the compilation should be executed as normal user. Removing from Makefile the pip commands to instal the Python modules and adding checks in configure.ac to see if they are installed. Also, edit the README.md to explain how to install the modules as dependencies to build Wok. Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- Makefile.am | 2 -- configure.ac | 7 +++++++ docs/README.md | 6 ++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8d2f346..3d3b5d6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -65,8 +65,6 @@ all-local: $(MKDIR_P) $$dir ; \ ln -sf ../../../po/$$L.gmo $$dir/wok.mo ; \ done < po/LINGUAS - pip install cython --no-input - pip install libsass --no-input --upgrade # # Packaging helpers diff --git a/configure.ac b/configure.ac index a3a0fc2..dd3955e 100644 --- a/configure.ac +++ b/configure.ac @@ -38,6 +38,7 @@ AM_INIT_AUTOMAKE([-Wno-portability]) AM_PATH_PYTHON([2.6]) AC_PATH_PROG([PEP8], [pep8], [/usr/bin/pep8]) AC_PYTHON_MODULE([unittest]) +AC_PYTHON_MODULE([cython], [fatal]) AC_SUBST([HAVE_PYMOD_UNITTEST]) AC_SUBST([PYTHON_VERSION]) AM_GNU_GETTEXT([external]) @@ -50,6 +51,12 @@ if test "x$PYFLAKES" = "x"; then AC_MSG_WARN([pyflakes not found]) fi +# Checking for libsass +AC_PATH_PROG([LIBSASS], [sassc]) +if test "x$LIBSASS" = "x"; then + AC_MSG_ERROR([sassc not found. Please execute "pip install +libsass"]) fi + AC_ARG_ENABLE( [sample], [AS_HELP_STRING( diff --git a/docs/README.md b/docs/README.md index 650ab83..c6c5601 100644 --- a/docs/README.md +++ b/docs/README.md @@ -55,6 +55,8 @@ Install Dependencies python-psutil python-ldap python-lxml \ libxslt nginx openssl python-dev python-pip + $ sudo pip install cython libsass + # If using RHEL, install the following additional packages: $ sudo yum install python-unittest2 python-ordereddict @@ -81,6 +83,8 @@ channel at RHN Classic or Red Hat Satellite. python-psutil python-ldap python-lxml nginx \ libxslt openssl python-dev python-pip + $ sudo pip install cython libsass + Packages version requirement: python-jsonschema >= 1.3.0 python-psutil >= 0.6.0 @@ -97,6 +101,8 @@ channel at RHN Classic or Red Hat Satellite. libxslt-tools python-xml nginx openssl python-dev \ python-pip + $ sudo pip install cython libsass + Packages version requirement: python-psutil >= 0.6.0 -- 2.4.3 _______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

Samuel, Yeah, python-dev is available only in Debian/Ubuntu. For Fedora and OpenSUSE the correct name is python-devel. But I think this can be fixed in a different patch. :-D Paulo. On Wed, 2015-10-14 at 17:04 +0000, Samuel Henrique De Oliveira Guimaraes wrote:
Hi Paulo,
Thanks for this fix! Just a quick change, I believe it is safe to change python-dev to to python-devel. Fedora 22 can't find python -dev, while other distros point to python-devel.
Regards, Samuel
-----Original Message----- From: kimchi-devel-bounces@ovirt.org [mailto: kimchi-devel-bounces@ovirt.org] On Behalf Of pvital@linux.vnet.ibm.com Sent: quarta-feira, 14 de outubro de 2015 10:39 To: Kimchi Devel <kimchi-devel@ovirt.org> Subject: [Kimchi-devel] [PATCH] Issue #740: Solving UI dependencies checking.
From: Paulo Vital <pvital@linux.vnet.ibm.com>
Commit 9fbb105 added pip commands on Makefile to install some Python modules during the UI compilation. However, the compilation step of the UI files is executed before the block where the commands were added, resulting in compilation fail if the system doesn't have the modules installed. In addition, pip commands need to be executed as root and, as good practice, the compilation should be executed as normal user.
Removing from Makefile the pip commands to instal the Python modules and adding checks in configure.ac to see if they are installed. Also, edit the README.md to explain how to install the modules as dependencies to build Wok.
Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- Makefile.am | 2 -- configure.ac | 7 +++++++ docs/README.md | 6 ++++++ 3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/Makefile.am b/Makefile.am index 8d2f346..3d3b5d6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -65,8 +65,6 @@ all-local: $(MKDIR_P) $$dir ; \ ln -sf ../../../po/$$L.gmo $$dir/wok.mo ; \ done < po/LINGUAS - pip install cython --no-input - pip install libsass --no-input --upgrade
# # Packaging helpers diff --git a/configure.ac b/configure.ac index a3a0fc2..dd3955e 100644 --- a/configure.ac +++ b/configure.ac @@ -38,6 +38,7 @@ AM_INIT_AUTOMAKE([-Wno-portability]) AM_PATH_PYTHON([2.6]) AC_PATH_PROG([PEP8], [pep8], [/usr/bin/pep8]) AC_PYTHON_MODULE([unittest]) +AC_PYTHON_MODULE([cython], [fatal]) AC_SUBST([HAVE_PYMOD_UNITTEST]) AC_SUBST([PYTHON_VERSION]) AM_GNU_GETTEXT([external]) @@ -50,6 +51,12 @@ if test "x$PYFLAKES" = "x"; then AC_MSG_WARN([pyflakes not found]) fi
+# Checking for libsass +AC_PATH_PROG([LIBSASS], [sassc]) +if test "x$LIBSASS" = "x"; then + AC_MSG_ERROR([sassc not found. Please execute "pip install +libsass"]) fi + AC_ARG_ENABLE( [sample], [AS_HELP_STRING( diff --git a/docs/README.md b/docs/README.md index 650ab83..c6c5601 100644 --- a/docs/README.md +++ b/docs/README.md @@ -55,6 +55,8 @@ Install Dependencies python-psutil python-ldap python-lxml \ libxslt nginx openssl python-dev python-pip
+ $ sudo pip install cython libsass +
# If using RHEL, install the following additional packages: $ sudo yum install python-unittest2 python-ordereddict @@ -81,6 +83,8 @@ channel at RHN Classic or Red Hat Satellite. python-psutil python-ldap python-lxml nginx \ libxslt openssl python-dev python-pip
+ $ sudo pip install cython libsass + Packages version requirement: python-jsonschema >= 1.3.0 python-psutil >= 0.6.0 @@ -97,6 +101,8 @@ channel at RHN Classic or Red Hat Satellite. libxslt-tools python-xml nginx openssl python-dev \ python-pip
+ $ sudo pip install cython libsass + Packages version requirement: python-psutil >= 0.6.0
-- 2.4.3
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

Applied. Thanks. Regards, Aline Manera
participants (4)
-
Aline Manera
-
Paulo Ricardo Paz Vital
-
pvital@linux.vnet.ibm.com
-
Samuel Henrique De Oliveira Guimaraes