From ef09ebe62ae7686c560af0407aae5ab7c14c1338 Mon Sep 17 00:00:00 2001 From: Jason Erickson Date: Fri, 6 Nov 2015 15:01:32 -0700 Subject: [PATCH 1/2] Modify setup.py to support setuptools/wheel To support creation of whl files for PyPI, setuptools need to be imported instead of distutils. Created try/except case to fall back to integrated distutils if setuptools is not installed. --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 51c720a9..f83e8e39 100644 --- a/setup.py +++ b/setup.py @@ -57,7 +57,10 @@ import os import sys import re import subprocess -from distutils.core import setup, Extension +try: + from setuptools import setup, Extension +except ImportError: + from distutils.core import setup, Extension from distutils.command.build_ext import build_ext from distutils.sysconfig import get_python_inc from distutils.ccompiler import get_default_compiler From 88593602de200276da105fc6a791b1e90c35f5dc Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Mon, 7 Mar 2016 10:38:40 +0000 Subject: [PATCH 2/2] setuptools in the news --- NEWS | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS b/NEWS index 173399a0..bed7013b 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ What's new in psycopg 2.6.2 - Raise `!NotSupportedError` on unhandled server response status (:ticket:`#352`). - Fixed `!PersistentConnectionPool` on Python 3 (:ticket:`#348`). +- Added support for setuptools/wheel (:ticket:`#370`). - Fixed `!errorcodes.lookup` initialization thread-safety (:ticket:`#382`).