From ef09ebe62ae7686c560af0407aae5ab7c14c1338 Mon Sep 17 00:00:00 2001 From: Jason Erickson Date: Fri, 6 Nov 2015 15:01:32 -0700 Subject: [PATCH] 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