From 88f61490f7c664c77db188dfeadf7fb0a499c176 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 4 Nov 2020 17:58:05 +0000 Subject: [PATCH 1/2] Let users choose between psycopg2 binary or source --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f836357..3bd68f8 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,6 @@ requires = [ 'django', - 'psycopg2-binary', ] @@ -25,6 +24,10 @@ def read(filename): description='Redshift database backend for Django', long_description=read('README.rst') + read('CHANGES.rst'), install_requires=requires, + extra_requires={ + 'psycopg2-binary': ['psycopg2-binary'], + 'psycopg2': ['psycopg2'], + }, python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", classifiers=[ 'Development Status :: 5 - Production/Stable', From 460ee0c28f7449319df4ae0b6b2c2359e7ff2069 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Thu, 5 Nov 2020 11:40:27 +0000 Subject: [PATCH 2/2] Update documentation --- doc/basic.rst | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/basic.rst b/doc/basic.rst index 4224272..8438497 100644 --- a/doc/basic.rst +++ b/doc/basic.rst @@ -11,6 +11,20 @@ Please install django-redshift-backend with using pip (8.1.1 or later). $ pip install django-redshift-backend +This backend requires ``psycopg2``, which may be installed from source or wheel (pre-built binaries). +If you don't want to specify it separately, you may install it using extra: + +.. code-block:: bash + + # For pre-built binary + $ pip install django-redshift-backend[psycopg2-binary] + + # For the source distribution + $ pip install django-redshift-backend[psycopg2] + +Please refer to the `psycopg2 documentation`_ for more details on the topic. + +.. _psycopg2 documentation: https://www.psycopg.org/docs/install.html#psycopg-vs-psycopg-binary Django settings =============== @@ -30,4 +44,3 @@ ENGINE for DATABASES is 'django_redshift_backend'. You can set the name in your For more information, please refer :doc:`refs`. -