Re: More RHEL 6 build issues

2017-07-12 Thread Dave Page
Hi

On Tue, Jul 11, 2017 at 5:40 PM, Devrim Gündüz  wrote:

>
> Hi Dave,
>
> On Tue, 2017-07-11 at 12:26 +0100, Dave Page wrote:
> > Anyway; the attached patch fixes the issue for me. I wonder if this is
> some
> > CentOS weirdness...
>
> Thanks, that fixed this issue. We have now another one:
>
> Exception occurred:
>   File 
> "/usr/lib/python2.6/site-packages/pgadmin4-web/flask_sqlalchemy/__init__.py",
> line 25, in 
> from sqlalchemy import orm, event, inspect
> ImportError: cannot import name event


I have no idea what would cause that. Are you using a version of any Python
component that differs from whats in requirements.txt?

The reason I ask is that we have automated regression tests on Python 2.6,
and they're passing just fine - so whatever you do on CentOS 6 should as
well.

You can see from the test output at
https://jenkins.pgadmin.org/job/pgadmin4-master-python26/lastSuccessfulBuild/consoleText
what packages are being used (the installations are fairly near the top).

Note that the second PIP run (which starts with pyperclip) is for the
components in web/regression/requirements.txt, which are only required to
run the regression tests.

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: More RHEL 6 build issues

2017-07-11 Thread Devrim Gündüz

Hi Dave,

On Tue, 2017-07-11 at 12:26 +0100, Dave Page wrote:
> Anyway; the attached patch fixes the issue for me. I wonder if this is some
> CentOS weirdness...

Thanks, that fixed this issue. We have now another one:

Exception occurred:
  File 
"/usr/lib/python2.6/site-packages/pgadmin4-web/flask_sqlalchemy/__init__.py", 
line 25, in 
from sqlalchemy import orm, event, inspect
ImportError: cannot import name event


Regards,
-- 
Devrim Gündüz
EnterpriseDB: https://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR


signature.asc
Description: This is a digitally signed message part


Re: More RHEL 6 build issues

2017-07-11 Thread Dave Page
On Tue, Jul 11, 2017 at 12:09 PM, Devrim Gündüz  wrote:

>
> Hi,
>
> Sorry, I missed this part:
>
> On Tue, 2017-07-11 at 11:44 +0100, Dave Page wrote:
> > It was fixed in the code:
> >
> >  # HTMLMIN doesn't work with Python 2.6.
> > if not config.DEBUG and sys.version_info >= (2,7):
> > HTMLMIN(app)
> >
> > Though, we do have an unconditional import (both in
> > web/pgadmin/__init__.py).
> >
> > Does the app run?
>
> We even cannot build it.
>
>
I just tried it on CentOS 6 here, and the app runs, but the docs don't
build. That's weird, considering
https://jenkins.pgadmin.org/job/pgadmin4-master-python26/lastSuccessfulBuild/
.

Anyway; the attached patch fixes the issue for me. I wonder if this is some
CentOS weirdness...

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/__init__.py b/web/pgadmin/__init__.py
index 4389e96b..55c59732 100644
--- a/web/pgadmin/__init__.py
+++ b/web/pgadmin/__init__.py
@@ -16,7 +16,6 @@ from importlib import import_module
 
 from flask import Flask, abort, request, current_app, session
 from flask_babel import Babel, gettext
-from flask_htmlmin import HTMLMIN
 from flask_login import user_logged_in
 from flask_security import Security, SQLAlchemyUserDatastore
 from flask_mail import Mail
@@ -146,6 +145,9 @@ def create_app(app_name=None):
 if not app_name:
 app_name = config.APP_NAME
 
+if not config.DEBUG and sys.version_info >= (2,7):
+from flask_htmlmin import HTMLMIN
+
 """Create the Flask application, startup logging and dynamically load
 additional modules (blueprints) that are found in this directory."""
 app = PgAdmin(__name__, static_url_path='/static')

Re: More RHEL 6 build issues

2017-07-11 Thread Dave Page
On Tue, Jul 11, 2017 at 12:07 PM, Devrim Gündüz  wrote:

>
> Hi,
>
> On Tue, 2017-07-11 at 11:44 +0100, Dave Page wrote:
> > Never modify config.py! You should be using config_distro.py.
>
> Err, this was what you asked me to do when we had similar issues before. I
> apply these patches to RHEL 6:
>
> https://git.postgresql.org/gitweb/?p=pgrpms.git;a=blob;f=
> rpm/redhat/master/pgadmin4-v1/master/pgadmin4-rhel6-sphinx.patch;h=
> 1fb17567e013ad339223581b60069814b8107f17;hb=refs/heads/master
> https://git.postgresql.org/gitweb/?p=pgrpms.git;a=blob;f=
> rpm/redhat/master/pgadmin4-v1/master/pgadmin4-rhel6-htmlminify.patch;h=
> 14ea8989b6b82fc7e1c1605019fa316d624cb59e;hb=refs/heads/master
>
> We do this *before* building the package. Isn't that ok?


Pretty sure I said to do that in config_distro.py. We never want to modify
config.py.

In any case, those changes shouldn't be required any more.

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: More RHEL 6 build issues

2017-07-11 Thread Devrim Gündüz

Hi,

Sorry, I missed this part:

On Tue, 2017-07-11 at 11:44 +0100, Dave Page wrote:
> It was fixed in the code:
> 
>  # HTMLMIN doesn't work with Python 2.6.
>     if not config.DEBUG and sys.version_info >= (2,7):
>     HTMLMIN(app)
> 
> Though, we do have an unconditional import (both in
> web/pgadmin/__init__.py).
> 
> Does the app run?

We even cannot build it.

Regards,
-- 
Devrim Gündüz
EnterpriseDB: https://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR


signature.asc
Description: This is a digitally signed message part


Re: More RHEL 6 build issues

2017-07-11 Thread Devrim Gündüz

Hi,

On Tue, 2017-07-11 at 11:44 +0100, Dave Page wrote:
> Never modify config.py! You should be using config_distro.py.

Err, this was what you asked me to do when we had similar issues before. I
apply these patches to RHEL 6:

https://git.postgresql.org/gitweb/?p=pgrpms.git;a=blob;f=rpm/redhat/master/pgadmin4-v1/master/pgadmin4-rhel6-sphinx.patch;h=1fb17567e013ad339223581b60069814b8107f17;hb=refs/heads/master
https://git.postgresql.org/gitweb/?p=pgrpms.git;a=blob;f=rpm/redhat/master/pgadmin4-v1/master/pgadmin4-rhel6-htmlminify.patch;h=14ea8989b6b82fc7e1c1605019fa316d624cb59e;hb=refs/heads/master

We do this *before* building the package. Isn't that ok?

Regards,
-- 
Devrim Gündüz
EnterpriseDB: https://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR


signature.asc
Description: This is a digitally signed message part


Re: More RHEL 6 build issues

2017-07-11 Thread Dave Page
On Tue, Jul 11, 2017 at 11:21 AM, Devrim Gündüz  wrote:

>
> Hi,
>
> I thought we fixed it at some point, but I'm recently getting this again:
>
> in the web/config.py, I changed
> MINIFY_PAGE = True
>
> to False.
>

Never modify config.py! You should be using config_distro.py.


>
> Still getting
>
> sphinx-1.0-build -b html -d _build/doctrees   . _build/html
> Making output directory...
> Running Sphinx v1.0.8
>
> Exception occurred:
>   File "/usr/lib/python2.6/site-packages/pgadmin4-web/flask_htmlmin.py",
> line 1, in 
> from htmlmin.main import minify
> ImportError: No module named main
>

It was fixed in the code:

 # HTMLMIN doesn't work with Python 2.6.
if not config.DEBUG and sys.version_info >= (2,7):
HTMLMIN(app)

Though, we do have an unconditional import (both in
web/pgadmin/__init__.py).

Does the app run?

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company