summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2012-04-11 03:47:12 -0700
committerChris Jerdonek <chris.jerdonek@gmail.com>2012-04-11 03:47:12 -0700
commit1faf113297667b108d64a266ee4ca0866caada5d (patch)
treee438a541feb909696dba9e283e1aec508ec651aa /setup.py
parentcf08262d444231333d8ae1fb3583b136aea07edd (diff)
downloadpystache-1faf113297667b108d64a266ee4ca0866caada5d.tar.gz
Included license text in project description.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py34
1 files changed, 30 insertions, 4 deletions
diff --git a/setup.py b/setup.py
index 9026154..29a00b6 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@
# coding: utf-8
"""
-This script supports distributing pystache and testing it from a source distribution.
+This script supports distributing Pystache and testing it from a source distribution.
Below are instructions to pystache maintainers on how to push a new
version of pystache to PyPI--
@@ -54,8 +54,29 @@ else:
# TODO: use the logging module instead of printing.
print("Using: version %s of %s" % (repr(dist.__version__), repr(dist)))
+
VERSION = '0.5.1-alpha' # Also change in pystache/init.py.
+HISTORY_PATH = 'HISTORY.rst'
+LICENSE_PATH = 'LICENSE'
+README_PATH = 'README.rst'
+
+
+def read(path):
+ """
+ Read and return the contents of a text file as a unicode string.
+
+ """
+ # This function implementation was chosen to be compatible across Python 2/3.
+ f = open(path, 'rb')
+ # We avoid use of the with keyword for Python 2.4 support.
+ try:
+ b = f.read()
+ finally:
+ f.close()
+
+ return b.decode('utf-8')
+
def publish():
"""
@@ -70,9 +91,14 @@ def make_long_description():
Return the long description for the package.
"""
- long_description = open('README.rst').read() + '\n\n' + open('HISTORY.rst').read()
+ license = """\
+License
+=======
+
+""" + read(LICENSE_PATH)
- return long_description
+ sections = [read(README_PATH), read(HISTORY_PATH), license]
+ return '\n\n'.join(sections)
if sys.argv[-1] == 'publish':
@@ -94,7 +120,7 @@ else:
extra = {
# Causes 2to3 to be run during the build step.
'use_2to3': True,
- 'convert_2to3_doctests': ['README.rst'],
+ 'convert_2to3_doctests': [README_PATH],
}
# We use the package simplejson for older Python versions since Python