From 3280aa8617b649a701705e4119a42ee18257eace Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 8 Mar 2017 23:00:05 -0800 Subject: [PATCH] Avoid dependency cycle by using distutils when setuptools isn't available (#184) * Use distutils instead of setuptools to avoid dependency cycle. * Change distutils requirement to fallback. --- setup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 62970d4d2..a8111299f 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,13 @@ from __future__ import with_statement -from setuptools import setup +# Six is a dependency of setuptools, so using setuptools creates a +# circular dependency when building a Python stack from source. We +# therefore allow falling back to distutils to install six. +try: + from setuptools import setup +except ImportError: + from distutils.core import setup import six