From f914216596c5a06871d514d36849ae46c71b8819 Mon Sep 17 00:00:00 2001 From: Chris Jerdonek Date: Mon, 9 Apr 2012 02:59:16 -0700 Subject: Changes to setup.py: spec test files now included when testing with Python 3. --- setup.py | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 796654e..574acdc 100644 --- a/setup.py +++ b/setup.py @@ -40,9 +40,13 @@ import sys try: - from setuptools import setup, find_packages + import setuptools as dist except ImportError: - from distutils.core import setup + from distutils import core as dist + +# TODO: use the logging module instead. +print("Using: version %s of %s" % (repr(dist.__version__), repr(dist))) +setup = dist.setup def publish(): @@ -70,19 +74,17 @@ 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: +# We follow the guidance here for compatibility with using setuptools instead +# of Distribute under Python 2 (on the subject of new, unrecognized keyword +# arguments to setup()): # # http://packages.python.org/distribute/python3.html#note-on-compatibility-with-setuptools # if sys.version_info < (3, ): 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 = { + # Causes 2to3 to be run during the build step. 'use_2to3': True, 'convert_2to3_doctests': ['README.rst'], } @@ -96,11 +98,14 @@ setup(name='pystache', author_email='chris@ozmm.org', maintainer='Chris Jerdonek', url='http://github.com/defunkt/pystache', - packages=find_packages(), + packages=dist.find_packages(), package_data = { # Include the README so doctests can be run. # TODO: is there a better way to include the README? - 'pystache': ['../README.rst'], + # TODO: experiment with the data_files keyword argument. + 'pystache': ['../README.rst', + '../ext/spec/specs/*.json', + '../ext/spec/specs/*.yml'], # Include template files so tests can be run. 'examples': template_files, 'pystache.tests.data': template_files, @@ -114,10 +119,13 @@ setup(name='pystache', 'Development Status :: 4 - Beta', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', + 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.4', 'Programming Language :: Python :: 2.5', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.2', ), **extra ) -- cgit v1.2.1