From c5326ce49980b513c6ad7003994e56fa6ed98257 Mon Sep 17 00:00:00 2001 From: Chris Jerdonek Date: Sat, 7 Apr 2012 10:59:36 -0700 Subject: Eliminate a unit test warning while running tests with earlier versions of Python. --- setup.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 91434d2..056c321 100644 --- a/setup.py +++ b/setup.py @@ -70,6 +70,22 @@ if sys.argv[-1] == 'publish': long_description = make_long_description() template_files = ['*.mustache', '*.txt'] +# We follow the suggestion here for compatibility with earlier versions +# of Python: +# +# http://packages.python.org/distribute/python3.html#note-on-compatibility-with-setuptools +# +if sys.version_info < (2, 7): + extra = {} +else: + # For testing purposes, we also use use_2to3 with Python 2.7. This + # lets us troubleshoot the absence of package resources in the build + # directory more easily (e.g. the absence of README.rst), since we can + # troubleshoot it while using Python 2.7 instead of Python 3. + extra = { + 'use_2to3': True, + } + setup(name='pystache', version='0.5.0-rc', license='MIT', @@ -87,7 +103,6 @@ setup(name='pystache', 'pystache.tests.data.locator': template_files, }, test_suite='pystache.tests', - use_2to3=True, entry_points = { 'console_scripts': ['pystache=pystache.commands:main'], }, @@ -99,5 +114,6 @@ setup(name='pystache', 'Programming Language :: Python :: 2.5', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', - ) + ), + **extra ) -- cgit v1.2.1