From 1faf113297667b108d64a266ee4ca0866caada5d Mon Sep 17 00:00:00 2001 From: Chris Jerdonek Date: Wed, 11 Apr 2012 03:47:12 -0700 Subject: Included license text in project description. --- setup.py | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'setup.py') 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 -- cgit v1.2.1