From ded446fe8aedfea9d7f2cb7c8a804cc48424d591 Mon Sep 17 00:00:00 2001 From: Dave Page Date: Thu, 11 Apr 2019 10:08:44 +0100 Subject: [PATCH] Depend on psycopg2-binary in the Python wheel, rather than psycopg2. Fixes #4165 --- docs/en_US/release_notes_4_6.rst | 1 + pkg/pip/setup_pip.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/docs/en_US/release_notes_4_6.rst b/docs/en_US/release_notes_4_6.rst index e320adb63..8c671ca42 100644 --- a/docs/en_US/release_notes_4_6.rst +++ b/docs/en_US/release_notes_4_6.rst @@ -10,6 +10,7 @@ release of pgAdmin4 4.5 Features ******** +| `Feature #4165 `_ - Depend on psycopg2-binary in the Python wheel, rather than psycopg2. Bug fixes ********* diff --git a/pkg/pip/setup_pip.py b/pkg/pip/setup_pip.py index c64d78891..81f90a449 100644 --- a/pkg/pip/setup_pip.py +++ b/pkg/pip/setup_pip.py @@ -37,6 +37,11 @@ with open(req_file, 'r') as reqf: for index, req in enumerate(required): if ";" in req or req.startswith("#") or req == "": required.remove(req) + continue + + # Ensure the Wheel will use psycopg2-binary, not the source distro + if 'psycopg2' in req: + required[index] = req.replace('psycopg2', 'psycopg2-binary') # Get the app version if sys.version_info[:2] >= (3, 3):