From 78b7b44a988f25c4a6a854e73898a89bdc0a3ab2 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Mon, 2 Jun 2014 14:39:16 +0200 Subject: Proper path to README.txt in setup.py The setup.py will fail when invoked from any other working directory than the main directory of the project. This can be problematic for some deployment tools. Ideally, setup.py should contain no code. --- setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8633c85..4c7d7d6 100644 --- a/setup.py +++ b/setup.py @@ -7,9 +7,13 @@ XStatic - setup.py Works with: setuptools """ +import os.path # The README.txt file should be written in reST so that PyPI can use # it to generate your project's PyPI page. -long_description = open('README.txt').read() +readme_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), + 'README.txt') +with open(readme_path) as f: + long_description = f.read() from setuptools import setup, find_packages -- cgit v1.2.1