[PATCH 1 of 2 v2] setup: import setup from setuptools when building wheels

Nathan Goldbaum nathan12343 at gmail.com
Fri Oct 9 16:45:13 UTC 2015


# HG changeset patch
# User Nathan Goldbaum <ngoldbau at ucsc.edu>
# Date 1444408995 18000
#      Fri Oct 09 11:43:15 2015 -0500
# Node ID 490624ac27dac6156a18446fe8d6091761e5ac74
# Parent  a024e2db4553492e173032f52464e2c4efe0d4fa
setup: import setup from setuptools when building wheels

This should hopefully prevent side-effects from using setuptools except when
a user has *explicitly* asked to produce a wheel

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -70,7 +70,11 @@ import re
 import shutil
 import tempfile
 from distutils import log
-from distutils.core import setup, Command, Extension
+if 'bdist_wheel' in sys.argv:
+    from setuptools import setup
+else:
+    from distutils.core import setup
+from distutils.core import Command, Extension
 from distutils.dist import Distribution
 from distutils.command.build import build
 from distutils.command.build_ext import build_ext


More information about the Mercurial-devel mailing list