summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2012-07-23 06:04:01 -0700
committerChris Jerdonek <chris.jerdonek@gmail.com>2012-07-23 06:04:01 -0700
commit3d995628ec8cfce38f3746643d343bb246d150e1 (patch)
tree893972e0bc4db4dcc859ac2a9dbf501bb22ed854 /setup.py
parent88516160909af9ce0c66d05ef1761946335641be (diff)
downloadpystache-3d995628ec8cfce38f3746643d343bb246d150e1.tar.gz
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
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py26
1 files changed, 6 insertions, 20 deletions
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,