Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b9phl-0008My-6O for pgadmin-hackers@arkaria.postgresql.org; Mon, 06 Jun 2016 08:16:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b9phk-00053a-Fg for pgadmin-hackers@arkaria.postgresql.org; Mon, 06 Jun 2016 08:16:12 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b9phX-0004pa-3L for pgadmin-hackers@postgresql.org; Mon, 06 Jun 2016 08:15:59 +0000 Received: from mail-qg0-x22d.google.com ([2607:f8b0:400d:c04::22d]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1b9phT-0008IU-JT for pgadmin-hackers@postgresql.org; Mon, 06 Jun 2016 08:15:57 +0000 Received: by mail-qg0-x22d.google.com with SMTP id 93so38580478qgx.2 for ; Mon, 06 Jun 2016 01:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=c1MbyQ7ALcyg+kBQW5ubCiO17OjAKRz86MP1iYS2Mn8=; b=HAv7Y0Czjr4FoxXowfiKhTvG00uaQn72HAsyKU2hcsaw0dojodIQcfEtKyY/bjEcWa +sTmkecISnJ+F9XAei4RS3PllVGdUioyT+J44VTaLTKp1XGJeYTzEhnTsAa9+NVLEBbB TieHJg4Y5cwkHy8xjQ3jRBwdLV379OvkI5yU4lC0gwH4JCgVJ/AyQr2lE7PWkBct78gm 0jHys4sp/byk4qmrpridGEt150gnR1s2c6WBI38KUmrEpx0mH7rDh+WzYaKT0yr+9WSu sH1+Aerw7EK3bfKOHAgGpooiu36GqW0cUPTmtTDAlaGg4LDtqb0v31oBXSPn31X7Bg23 LJPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=c1MbyQ7ALcyg+kBQW5ubCiO17OjAKRz86MP1iYS2Mn8=; b=OyicXwTV3r7cUNAa/okGHEQ6rMT0QCTnMoNAo1ngTgsdZi4IJI5ViX3KNSfzLglHvt 3d3+RhSOYa/l+3BPG5LEzJ8kPpGgeK0NWTlhIwq0GgJFD6PuohAuwfmTVT9BbX3eMkUT iChV2hIE1ZyzEOKjPOXxvOaZlYgUQWOq805c2icawDqfFSFKML/fDWGTGWE8HnREdz6k fXWQicz7RYftdb+z5dPEpYj2s8YvUpk02hYnhqqErPUZ5T+ctiKDkW7n3wQx8dRJT9B1 Bcv43CH9WcENAHU9PDndYXkWUCBLnhAtd3tDG7WGMNy9hkSj3Tg7RSqsDBR2Zu+ZG8gL IVrg== X-Gm-Message-State: ALyK8tKMjEZH+QFLljIqPOr34wH9KiTpUW88Krr2krubnV4oXngWrOSEJyN0qhGqTDXRaFgoZ4VFUjRHHkJCPd+/ MIME-Version: 1.0 X-Received: by 10.140.21.164 with SMTP id 33mr14051314qgl.80.1465200954738; Mon, 06 Jun 2016 01:15:54 -0700 (PDT) Received: by 10.140.101.198 with HTTP; Mon, 6 Jun 2016 01:15:54 -0700 (PDT) In-Reply-To: References: Date: Mon, 6 Jun 2016 13:45:54 +0530 Message-ID: Subject: Re: Patch for pgAdmin4 RPM package From: Sandeep Thakkar To: Dave Page Cc: pgadmin-hackers , Hamid Quddus , =?UTF-8?B?RGV2cmltIEfDnE5Ew5xa?= Content-Type: multipart/alternative; boundary=001a11c13aca6ea4b4053497ae9b X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org --001a11c13aca6ea4b4053497ae9b Content-Type: text/plain; charset=UTF-8 Yeah, I got the point. To distinguish between v1 and v2, we can have blank __init__.py in the v1 and v2 directories. I tried it and could successfully import the pgAdmin4 using "import pgadmin4_web_v1.pgAdmin4" and "import pgadmin4_web_v2.pgAdmin4". Please note that I had to rename hyphen to underscore in the directories to achieve this. But, I spent enough time to find the API that can get me the location for "pgadmin4_web_v1.pgAdmin4" module, but couldn't find it. Do you have an idea? On Fri, Jun 3, 2016 at 8:24 PM, Dave Page wrote: > My point is that the runtime uses the platform supplied Python > interpreter, which presumably knows where to search for packages. Mind you, > I suppose the issue there is that it wouldn't be able to distinguish > between v1 and v2 then... > > I don't have a major issue with your suggested code - I just want to make > sure we need it. > > > On Fri, Jun 3, 2016 at 3:39 PM, Sandeep Thakkar < > sandeep.thakkar@enterprisedb.com> wrote: > >> Do you mean to say when a python app is launched, it imports some modules >> automatically and in that sense it knows about where it's site-packages >> are? May be, but how the pgAdmin4 runtime will know where the Web App is >> installed? >> >> The changes that I have done to the runtime is to let it know the path of >> the Web App which is present in >> "/site-packages/pgadmin4-web-v1/pgAdmin4.py" The changes done are not to >> set the PythonPath like we did for appbundle because I thought it is not >> needed and it will automatically load the modules from the site-packages, >> but it is to set the ApplicationPath. >> >> I missed something? or misunderstood something? >> >> On Fri, Jun 3, 2016 at 7:39 PM, Dave Page wrote: >> >>> Hi, >>> >>> Well, I have to wonder why we need the changes to the runtime? We're >>> linking the runtime with the same build of Python that's already on the >>> system - doesn't it know where it's site-packages are already? I could see >>> us needing this is we were using a distro-independent build of Python and >>> wanted to find the OS site-packages location, but we're not. >>> >>> >>> On Fri, Jun 3, 2016 at 10:15 AM, Sandeep Thakkar < >>> sandeep.thakkar@enterprisedb.com> wrote: >>> >>>> Hi Dave, >>>> >>>> how about changes in the pgadmin4 source code for conf.py and >>>> Server.cpp? Looks okay? >>>> >>>> On Fri, Jun 3, 2016 at 2:41 PM, Sandeep Thakkar < >>>> sandeep.thakkar@enterprisedb.com> wrote: >>>> >>>>> Thanks Dave. >>>>> >>>>> On Fri, Jun 3, 2016 at 2:08 PM, Dave Page wrote: >>>>> >>>>>> Hi >>>>>> >>>>>> On Thu, Jun 2, 2016 at 4:23 PM, Sandeep Thakkar >>>>>> wrote: >>>>>> > Hi Devrim, Hi Dave, >>>>>> > >>>>>> > I have updated the patch. The earlier patch may fail because of app >>>>>> bundle >>>>>> > commit in git. >>>>>> > >>>>>> > For testing, you may define the source tarball location as : >>>>>> > Source0: >>>>>> > >>>>>> http://bugatti.pn.in.enterprisedb.com/temp/pgadmin4/%{name}-v%{version}.tar.gz >>>>>> > >>>>>> > Known issue that I'm still working on: >>>>>> > 1. web rpm has a dependency on doc. But, even if I install doc, the >>>>>> web >>>>>> > still complains. Here is the scenario: >>>>>> > [root@localhost tmp]# rpm -ivh >>>>>> > dist/noarch/pgadmin4-web-1.0_dev-1.rhel7.noarch.rpm >>>>>> > error: Failed dependencies: >>>>>> > pgadmin4-doc = 1.0_dev is needed by >>>>>> pgadmin4-web-1.0_dev-1.rhel7.noarch >>>>>> > ... ( trimmed the python dependencies list here...) >>>>>> > >>>>>> > [root@localhost tmp]# rpm -ivh >>>>>> > dist/noarch/pgadmin4-docs-1.0_dev-1.rhel7.noarch.rpm >>>>>> > Preparing... >>>>>> ################################# >>>>>> > [100%] >>>>>> > Updating / installing... >>>>>> > 1:pgadmin4-docs-1.0_dev-1.rhel7 >>>>>> ################################# >>>>>> > [100%] >>>>>> > >>>>>> > >>>>>> > [root@localhost tmp]# yum list | grep pgadmin4-docs >>>>>> > pgadmin4-docs.noarch 1.0_dev-1.rhel7 >>>>>> > installed >>>>>> > >>>>>> > >>>>>> > [root@localhost tmp]# rpm -ivh >>>>>> > dist/noarch/pgadmin4-web-1.0_dev-1.rhel7.noarch.rpm >>>>>> > error: Failed dependencies: >>>>>> > pgadmin4-doc = 1.0_dev is needed by >>>>>> pgadmin4-web-1.0_dev-1.rhel7.noarch >>>>>> >>>>>> You have a typo - the Requires line is for pgadmin4-doc, but the RPM >>>>>> is pgadmin4-docs. >>>>>> >>>>>> Oh, right. >>>>> >>>>> >>>>>> Other review comments: >>>>>> >>>>>> - We have multiple identical pgadmin4.spec.in's in the patch. We need >>>>>> to get that down to a single file. >>>>>> >>>>>> - In fact, why do we need a directory for each distro at all? As far >>>>>> as I can see, the only difference is the $DIST definition, which is >>>>>> surely something we can get programmatically very easily. It seems to >>>>>> me we could reduce this all to 3 files - Makefile, README and >>>>>> pgadmin4.spec.in >>>>>> >>>>>> Agree. I copied the structure from somewhere thinking this is good to >>>>> have more OS specific changes. >>>>> >>>>> >>>>>> - make rpm has a dependency on make prep. This has 2 issues as far as >>>>>> I can see: >>>>>> >>>>>> - It does a git pull, which is bad. If I'm making an RPM from within >>>>>> the source tree, I want it for the current source. The git pull only >>>>>> makes sense for external builds, i.e. in a much larger automated build >>>>>> system. >>>>>> >>>>>> - It goes and grabs the source code and patches from the FTP site. >>>>>> Again, this is not what I want for an "in-tree" build. I want to use >>>>>> the source code as I have it now. >>>>>> >>>>>> Okay. got it. Will remove downloading the tarballs and build the >>>>> cloned source. >>>>> >>>>> >>>>>> -- >>>>>> Dave Page >>>>>> Blog: http://pgsnake.blogspot.com >>>>>> Twitter: @pgsnake >>>>>> >>>>>> EnterpriseDB UK: http://www.enterprisedb.com >>>>>> The Enterprise PostgreSQL Company >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Sandeep Thakkar >>>>> >>>>> >>>> >>>> >>>> -- >>>> Sandeep Thakkar >>>> Lead Software Engineer >>>> >>>> >>>> Phone: +91.20.30589505 >>>> >>>> Website: www.enterprisedb.com >>>> EnterpriseDB Blog: http://blogs.enterprisedb.com/ >>>> Follow us on Twitter: http://www.twitter.com/enterprisedb >>>> >>>> This e-mail message (and any attachment) is intended for the use of the >>>> individual or entity to whom it is addressed. This message contains >>>> information from EnterpriseDB Corporation that may be privileged, >>>> confidential, or exempt from disclosure under applicable law. If you are >>>> not the intended recipient or authorized to receive this for the intended >>>> recipient, any use, dissemination, distribution, retention, archiving, or >>>> copying of this communication is strictly prohibited. If you have received >>>> this e-mail in error, please notify the sender immediately by reply e-mail >>>> and delete this message. >>>> >>> >>> >>> >>> -- >>> Dave Page >>> Blog: http://pgsnake.blogspot.com >>> Twitter: @pgsnake >>> >>> EnterpriseDB UK: http://www.enterprisedb.com >>> The Enterprise PostgreSQL Company >>> >> >> >> >> -- >> Sandeep Thakkar >> Lead Software Engineer >> >> >> Phone: +91.20.30589505 >> >> Website: www.enterprisedb.com >> EnterpriseDB Blog: http://blogs.enterprisedb.com/ >> Follow us on Twitter: http://www.twitter.com/enterprisedb >> >> This e-mail message (and any attachment) is intended for the use of the >> individual or entity to whom it is addressed. This message contains >> information from EnterpriseDB Corporation that may be privileged, >> confidential, or exempt from disclosure under applicable law. If you are >> not the intended recipient or authorized to receive this for the intended >> recipient, any use, dissemination, distribution, retention, archiving, or >> copying of this communication is strictly prohibited. If you have received >> this e-mail in error, please notify the sender immediately by reply e-mail >> and delete this message. >> > > > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > -- Sandeep Thakkar --001a11c13aca6ea4b4053497ae9b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Yeah, I got the point. To distinguish between v1 and v2, w= e can have blank __init__.py in the v1 and v2 directories. I tried it and c= ould successfully import the pgAdmin4 using "import pgadmin4_web_v1.pg= Admin4" and "import pgadmin4_web_v2.pgAdmin4".=C2=A0 Please = note that I had to rename hyphen to underscore in the directories to achiev= e this.=C2=A0

But, I spent enough time to find the API that ca= n get me the location for "pgadmin4_web_v1.pgAdmin4" module, but = couldn't find it. Do you have an idea?


On Fri, Jun 3, 2016 at = 8:24 PM, Dave Page <dpage@pgadmin.org> wrote:
My point is that the runtime uses the = platform supplied Python interpreter, which presumably knows where to searc= h for packages. Mind you, I suppose the issue there is that it wouldn't= be able to distinguish between v1 and v2 then...

I don&= #39;t have a major issue with your suggested code - I just want to make sur= e we need it.

On Fri, Jun 3, 2016 at 3:39 PM, Sandeep Thakkar= <sandeep.thakkar@enterprisedb.com> wrote:
Do you mean to say when a = python app is launched, it imports some modules automatically and in that s= ense it knows about where it's site-packages are? May be, but how the p= gAdmin4 runtime will know where the Web App is installed?=C2=A0

The changes that I have done to the runtime is to let it know the p= ath of the Web App which is present in "/site-packages/pgadmin4-web-v1= /pgAdmin4.py" The changes done are not to set the PythonPath like we d= id for appbundle because I thought it is not needed and it will automatical= ly load the modules from the site-packages, but it is to set the Applicatio= nPath.

I missed something? or misunderstood someth= ing?=C2=A0

On Fri, Jun 3, 2016 at 7:39 PM, Dave Page <dpage@pgadmi= n.org> wrote:
Hi,

Well, I have to wonder why we need the changes t= o the runtime? We're linking the runtime with the same build of Python = that's already on the system - doesn't it know where it's site-= packages are already? I could see us needing this is we were using a distro= -independent build of Python and wanted to find the OS site-packages locati= on, but we're not.


On Fri, Jun 3, 2016 at 10:15 AM, S= andeep Thakkar <sandeep.thakkar@enterprisedb.com> wrote:
Hi Dave,=C2= =A0

how about changes in the pgadmin4 source code for co= nf.py and Server.cpp? Looks okay?

On Fri, Jun 3, 2016 at 2:41 PM, Sande= ep Thakkar <sandeep.thakkar@enterprisedb.com>= wrote:
Thanks Dave.=C2= =A0

= On Fri, Jun 3, 2016 at 2:08 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On Thu, Jun 2, 2016 at 4:23 PM, Sandeep Thakkar
<s= andeep.thakkar@enterprisedb.com> wrote:
> Hi Devrim, Hi Dave,
>
> I have updated the patch. The earlier patch may fail because of app bu= ndle
> commit in git.
>
> For testing, you may define the source tarball location as :
> Source0:
> http://bu= gatti.pn.in.enterprisedb.com/temp/pgadmin4/%{name}-v%{version}.tar.gz >
> Known issue that I'm still working on:
> 1. web rpm has a dependency on doc. But, even if I install doc, the we= b
> still complains. Here is the scenario:
> [root@localhost tmp]# rpm -ivh
> dist/noarch/pgadmin4-web-1.0_dev-1.rhel7.noarch.rpm
> error: Failed dependencies:
> pgadmin4-doc =3D 1.0_dev is needed by pgadmin4-web-1.0_dev-1.rhel7.noa= rch
> ... ( trimmed the python dependencies list here...)
>
> [root@localhost tmp]# rpm -ivh
> dist/noarch/pgadmin4-docs-1.0_dev-1.rhel7.noarch.rpm
> Preparing...=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 #################################
> [100%]
> Updating / installing...
>=C2=A0 =C2=A0 1:pgadmin4-docs-1.0_dev-1.rhel7=C2=A0 =C2=A0 ############= #####################
> [100%]
>
>
> [root@localhost tmp]# yum list | grep pgadmin4-docs
> pgadmin4-docs.noarch=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 1.0_dev-1.rhel7
> installed
>
>
> [root@localhost tmp]# rpm -ivh
> dist/noarch/pgadmin4-web-1.0_dev-1.rhel7.noarch.rpm
> error: Failed dependencies:
> pgadmin4-doc =3D 1.0_dev is needed by pgadmin4-web-1.0_dev-1.rhel7.noa= rch

You have a typo - the Requires line is for pgadmin4-doc, but th= e RPM
is pgadmin4-docs.

Oh, right.
=C2=A0
Other review comments:

- We have multiple identical pgadmin4.spec.in's in the patch. We need=
to get that down to a single file.

- In fact, why do we need a directory for each distro at all? As far
as I can see, the only difference is the $DIST definition, which is
surely something we can get programmatically very easily. It seems to
me we could reduce this all to 3 files - Makefile, README and
pg= admin4.spec.in

Agree. I copied the structure from somewhere t= hinking this is good to have more OS specific changes.
=C2= =A0
- make rpm has a dependency on make prep. This has 2 issues as far as I can= see:

=C2=A0 - It does a git pull, which is bad. If I'm making an RPM from wi= thin
the source tree, I want it for the current source. The git pull only
makes sense for external builds, i.e. in a much larger automated build
system.

=C2=A0 - It goes and grabs the source code and patches from the FTP site. Again, this is not what I want for an "in-tree" build. I want to = use
the source code as I have it now.

Okay. got it. Will remov= e downloading the tarballs and build the cloned source.
=C2= =A0
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

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


--
Sandeep Thakkar




-= -
Sandeep Thakkar
Lead Software Engineer


Phone: +91.20.30589505

Website: www.enterprisedb.com
EnterpriseDB Blog:
http://blogs.enterprisedb.com/
Follow us on Twitter: http://www.t= witter.com/enterprisedb

This e-mail message (and any attachment)= is intended for the use of the individual or entity to whom it is addresse= d. This message contains information from EnterpriseDB Corporation that may= be privileged, confidential, or exempt from disclosure under applicable la= w. If you are not the intended recipient or authorized to receive this for = the intended recipient, any use, dissemination, distribution, retention, ar= chiving, or copying of this communication is strictly prohibited. If you ha= ve received this e-mail in error, please notify the sender immediately by r= eply e-mail and delete this message.



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

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



--
Sandeep = Thakkar
Lead Software Engineer
<= br>
Phone: +91.20.30589505

Website: www.enterprisedb.com
EnterpriseDB = Blog: http://b= logs.enterprisedb.com/
Follow us on Twitter: http://www.twitter.com/enterpris= edb

This e-mail message (and any attachment) is intended for the= use of the individual or entity to whom it is addressed. This message cont= ains information from EnterpriseDB Corporation that may be privileged, conf= idential, or exempt from disclosure under applicable law. If you are not th= e intended recipient or authorized to receive this for the intended recipie= nt, any use, dissemination, distribution, retention, archiving, or copying = of this communication is strictly prohibited. If you have received this e-m= ail in error, please notify the sender immediately by reply e-mail and dele= te this message.



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

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



--
Sandeep Thakkar

--001a11c13aca6ea4b4053497ae9b--