From 3d995628ec8cfce38f3746643d343bb246d150e1 Mon Sep 17 00:00:00 2001 From: Chris Jerdonek Date: Mon, 23 Jul 2012 06:04:01 -0700 Subject: Remove the --force2to3 option from setup.py. See this link for the underlying reason: https://bitbucket.org/tarek/distribute/issue/292/allow-use_2to3-with-python-2 --- setup.py | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 2c18af5..136e886 100644 --- a/setup.py +++ b/setup.py @@ -73,8 +73,6 @@ import shutil import sys -OPTION_FORCE_2TO3 = '--force2to3' - py_version = sys.version_info # distutils does not seem to support the following setup() arguments. @@ -280,19 +278,6 @@ PACKAGES = [ ] -def parse_args(sys_argv): - """ - Modify sys_argv in place and return whether to force use of 2to3. - - """ - should_force2to3 = False - if len(sys_argv) > 1 and sys_argv[1] == OPTION_FORCE_2TO3: - sys_argv.pop(1) - should_force2to3 = True - - return should_force2to3 - - # The purpose of this function is to follow the guidance suggested here: # # http://packages.python.org/distribute/python3.html#note-on-compatibility-with-setuptools @@ -300,13 +285,16 @@ def parse_args(sys_argv): # The guidance is for better compatibility when using setuptools (e.g. with # earlier versions of Python 2) instead of Distribute, because of new # keyword arguments to setup() that setuptools may not recognize. -def get_extra_args(should_force2to3): +def get_extra_args(): """ Return a dictionary of extra args to pass to setup(). """ extra = {} - if py_version >= (3, ) or should_force2to3: + # TODO: it might be more correct to check whether we are using + # Distribute instead of setuptools, since use_2to3 doesn't take + # effect when using Python 2, even when using Distribute. + if py_version >= (3, ): # Causes 2to3 to be run during the build step. extra['use_2to3'] = True @@ -319,8 +307,6 @@ def main(sys_argv): # TODO: include the following in a verbose mode. print("pystache: using: version %s of %s" % (repr(dist.__version__), repr(dist))) - should_force2to3 = parse_args(sys_argv) - command = sys_argv[-1] if command == 'publish': @@ -332,7 +318,7 @@ def main(sys_argv): long_description = read(DESCRIPTION_PATH) template_files = ['*.mustache', '*.txt'] - extra_args = get_extra_args(should_force2to3) + extra_args = get_extra_args() setup(name='pystache', version=VERSION, -- cgit v1.2.1