Re: [pgadmin-hackers] [pgAdmin4] [PATCH] Simplify Server's python setup - Mailing list pgadmin-hackers

From Dave Page
Subject Re: [pgadmin-hackers] [pgAdmin4] [PATCH] Simplify Server's python setup
Date
Msg-id CA+OCxoxtaEuNX1F-m7LWyRtEziZ9ucMcSi=xtY4fGn8ztu=qhQ@mail.gmail.com
Whole thread Raw
In response to [pgadmin-hackers] [pgAdmin4] [PATCH] Simplify Server's python setup  (Jan Alexander Steffens <jan.steffens@gmail.com>)
Responses Re: [pgadmin-hackers] [pgAdmin4] [PATCH] Simplify Server's python setup  (Jan Alexander Steffens <jan.steffens@gmail.com>)
List pgadmin-hackers
Hi

On Wed, Jan 25, 2017 at 9:21 AM, Jan Alexander Steffens
<jan.steffens@gmail.com> wrote:
> Hi,
>
> in the process of packaging pgAdmin4 in Arch Linux I ran into trouble
> getting it to start, which I reduced to a bad sys.path.
>
> The attached patch simplifies the Python initialization. If the program name
> is set to match the venv's interpreter executable, Py_Initialize will set up
> sys.path to match the virtualenv.
>
> This means that, assuming the venv is in the right directory, no further
> configuration of the PythonPath should be necessary.
>
> I tested this using Python 2.7.13 and Python 3.6. I could not test this on
> Windows or OSX, but I made an effort at supporting them. Since this patch
> offloads all the path gathering to Python itself, the differences between
> the platforms are minimal.
>
> If relevant, the script I use to package is at
> https://pkgbuild.com/~heftig/packages/pgadmin4/PKGBUILD . The interesting
> stuff is in the build() and package() functions, which should be
> self-explanatory.

As far as I can see, this breaks usage in development environments, or
any configurations where the Python code may be separated from the
runtime. Am I missing something?

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

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


pgadmin-hackers by date:

Previous
From: Dave Page
Date:
Subject: Re: [pgadmin-hackers] User Research Findings into PgAdmin
Next
From: Dave Page
Date:
Subject: Re: [pgadmin-hackers] PATCH: To fix the issue in Database node (pgAdmin4)