Permalink
Browse files

Substitute include statements in README, so they will show up on PyPI.

  • Loading branch information...
1 parent d2bf7a3 commit 0537e97cceec13c473a730921b142d5e6126db4d @redtoad committed Sep 18, 2011
Showing with 9 additions and 1 deletion.
  1. +1 −0 MANIFEST.in
  2. +8 −1 setup.py
View
1 MANIFEST.in
@@ -1,4 +1,5 @@
include LICENSE
include MANIFEST.in
include README
+include CHANGES
recursive-include tests *.py *.xml
View
9 setup.py
@@ -2,6 +2,7 @@
from setuptools import setup, find_packages, Command
import os.path, sys
+import re
_here = os.path.abspath(os.path.dirname(__file__))
@@ -18,6 +19,12 @@ def read(fname):
# makes sure that setup can be executed from a different location
return open(os.path.join(_here, fname)).read()
+def readme():
+ # substitute all include statements.
+ def insert_include(matchobj):
+ return read(matchobj.group(1))
+ return re.sub(r'\.\. include:: (\w+)', insert_include, read('README'))
+
reqs = []
# for python2.4
if sys.version_info[:2] < (2, 5):
@@ -44,7 +51,7 @@ def run(self):
license='bsd',
description = 'A Python wrapper for the Amazon Product Advertising API.',
- long_description=read('README'),
+ long_description=readme(),
keywords = 'amazon product advertising api wrapper signed requests',
packages = find_packages(_here, exclude=['tests']),

0 comments on commit 0537e97

Please sign in to comment.