[pgAdmin4] [PATCH] Simplify Server's python setup

From: Jan Alexander Steffens <jan(dot)steffens(at)gmail(dot)com>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: [pgAdmin4] [PATCH] Simplify Server's python setup
Date: 2017-01-25 09:21:45
Message-ID: CAMQ-g0dHUN2SFioNg93hCTJkRR3LsVZ-ZvhUh6in+O4UAU2Qow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

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.

Thanks,
Jan Steffens

Attachment Content-Type Size
0001-Simplify-Server-s-python-setup.patch text/x-patch 11.6 KB

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2017-01-25 09:25:15 Re: User Research Findings into PgAdmin
Previous Message Dave Page 2017-01-25 09:05:18 pgAdmin 4 commit: Update copyright year. Fixes #2109