summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2019-11-04 22:02:10 -0500
committerBenjamin Peterson <benjamin@python.org>2019-11-04 19:02:10 -0800
commit7385912842ff399224e560ff87ec8c8bd4f8d675 (patch)
tree847d118b6992ef9c0fc6ae5a9b9babc388cd8129
parentefd43d0f55fa082f3f0f547a6b8366241696a5fe (diff)
downloadsix-git-7385912842ff399224e560ff87ec8c8bd4f8d675.tar.gz
Revert "Remove distutils fallback and outdated comment (#269)" (#304)
This reverts commit d5efa74e2dfde8d4ddba13e127cd85c687e6016b. The original intention of providing a distutils fallback has not gone away. These three extra lines will almost never be used, as most people have setuptools or install with pip anyway, and at the same time it serves as a very low-maintenance solution for people who *do* want to bootstrap setuptools. Bootstrapping setuptools without vendored six (and pyparsing) is a valid use case. Although setuptools by default ships with vendored dependencies, it supports removing the contents of the _vendored/ directory and falling back to an installed version of six.py -- and thirdparty vendors of setuptools, such as Arch Linux and OpenSUSE, actually make use of this and need to be able to bootstrap the dependency tree of setuptools itself.
-rw-r--r--setup.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index ee4142c..97c685b 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