Commit f9142165 by Chris Jerdonek

Changes to setup.py: spec test files now included when testing with Python 3.

parent d36bc2a1
......@@ -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
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment