Commits

Ferran Pegueroles committed f8c88c8 Draft

setup.py can work without text file

Comments (0)

Files changed (1)

 import os
 from setuptools import setup
 
-README = os.path.join(os.path.dirname(__file__), 'README.rst')
 
-LONG_DESCRIPTION = open(README).read() + '\n\n'
+def read(fname):
+    full_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), fname)
+    if os.path.exists(full_path):
+        return open(full_path).read()
+
 
 setup(name='peerreach',
       version="0.2",
       author_email='ferran@pegueroles.com',
       description='Access peerreach api',
       url='https://bitbucket.org/ferranp/peerreach',
-      long_description=LONG_DESCRIPTION,
+      long_description=read('README.rst'),
       license='GPL',
       download_url='https://bitbucket.org/ferranp/loadcsv/downloads',
       packages=['peerreach'],