public inbox for [email protected]
help / color / mirror / Atom feedFrom: Dave Page <[email protected]>
To: pgadmin-hackers <[email protected]>
Cc: Shaheed Haque <[email protected]>
Subject: Making Kerberos optional in the Python wheel
Date: Thu, 4 Mar 2021 10:02:00 +0000
Message-ID: <CA+OCxowzCN8wznYjG_631tB2XYgqv5LCXkD49jkXAUtD7d9t3g@mail.gmail.com> (raw)
There have been a couple of complaints that the latest Python wheel
distribution doesn't install cleanly. This happens when there is no
pre-built gssapi wheel on PyPi that matches the users combination of Python
version and platform, *and* the MIT Kerberos development headers etc. are
not present on the system, so the source wheel cannot be compiled.
This seems like it's a bit onerous on users, especially if they're on
Windows where they'll also need a suitable compiler to be installed. The
attached patch aims to address that by making the Kerberos support optional
(thankfully, Khushboo made the code handle lack of gssapi libraries).
To install without gssapi, users would simply do:
pip install pgadmin4
or
pip install pip install /path/to/pgadmin4-5.0-py3-none-any.whl
To install with gssapi:
pip install pgadmin4['kerberos']
or
pip install pip install /path/to/pgadmin4-5.0-py3-none-any.whl['kerberos']
The patch also cleans up some old cruft that was required for now
unsupported Python versions.
Thoughts?
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EDB: http://www.enterprisedb.com
Attachments:
[application/octet-stream] optional_kerberos.diff (3.3K, 3-optional_kerberos.diff)
download | inline diff:
Index: pkg/pip/setup_pip.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- pkg/pip/setup_pip.py (revision ed6ddbb8de4e29e70c49a1cf7dc8810cd79364ae)
+++ pkg/pip/setup_pip.py (date 1614851487405)
@@ -35,23 +35,17 @@
all_requires = req_lines.read().splitlines()
requires = []
-extras_require = {}
-# Remove any requirements with environment specifiers. These
-# must be explicitly listed in extras_require below.
+kerberos_extras = []
+# Ensure the Wheel will use psycopg2-binary, not the source distro, and stick
+# gssapi in it's own list
for index, req in enumerate(all_requires):
- if ";" in req or req.startswith("#") or req == "":
- # Add the pkgs to extras_require
- if ";" in req:
- pkg, env_spec = req.split(";")
- extras_require[env_spec] = extras_require.get(env_spec, [])
- extras_require[env_spec].append(pkg)
- continue
-
- # Ensure the Wheel will use psycopg2-binary, not the source distro
if 'psycopg2' in req:
req = req.replace('psycopg2', 'psycopg2-binary')
- requires.append(req)
+ if 'gssapi' in req:
+ kerberos_extras.append(req)
+ else:
+ requires.append(req)
# Get the version
config = load_source('APP_VERSION', '../web/config.py')
@@ -77,7 +71,6 @@
'Development Status :: 5 - Production/Stable',
# Supported programming languages
- 'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
@@ -92,7 +85,9 @@
install_requires=requires,
- extras_require=extras_require,
+ extras_require={
+ "kerberos": kerberos_extras,
+ },
entry_points={
'console_scripts': ['pgadmin4=pgadmin4.pgAdmin4:main'],
Index: requirements.txt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- requirements.txt (revision ed6ddbb8de4e29e70c49a1cf7dc8810cd79364ae)
+++ requirements.txt (date 1614788829786)
@@ -8,12 +8,6 @@
#
###############################################################################
-
-##############################################################################
-# NOTE: Any requirements with environment specifiers must be explicitly added
-# to pkg/pip/setup_pip.py (in extras_require), otherwise they will be
-# ignored when building a PIP Wheel.
-##############################################################################
cheroot==8.*
Flask==1.*
Flask-Gravatar==0.*
Index: web/regression/requirements.txt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- web/regression/requirements.txt (revision ed6ddbb8de4e29e70c49a1cf7dc8810cd79364ae)
+++ web/regression/requirements.txt (date 1614790784056)
@@ -27,8 +27,3 @@
traceback2==1.4.0
selenium==3.14.0
coverage==5.0.1
-###############################################################
-# Modules specifically required for Python3.3 or lesser version
-###############################################################
-mock===2.0.0; python_version < '3.3'
-
view thread (5+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: Making Kerberos optional in the Python wheel
In-Reply-To: <CA+OCxowzCN8wznYjG_631tB2XYgqv5LCXkD49jkXAUtD7d9t3g@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox