summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2012-04-09 02:59:16 -0700
committerChris Jerdonek <chris.jerdonek@gmail.com>2012-04-09 02:59:16 -0700
commitf914216596c5a06871d514d36849ae46c71b8819 (patch)
tree8dc3cb5834e1f3e0d66eb7436e4a2466dc344451 /setup.py
parentd36bc2a1520bb0d6148e6472674808e3c7168e17 (diff)
downloadpystache-f914216596c5a06871d514d36849ae46c71b8819.tar.gz
Changes to setup.py: spec test files now included when testing with Python 3.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py28
1 files changed, 18 insertions, 10 deletions
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
)