From 73ec7da13e668ae6555f20daa673c29659f390a4 Mon Sep 17 00:00:00 2001 From: Tobias Oberstein Date: Fri, 15 Jan 2016 11:15:22 +0100 Subject: [PATCH] allow installation via direct execution of setup.py from outside the package directory --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 73f7e6a..c14779a 100644 --- a/setup.py +++ b/setup.py @@ -16,6 +16,7 @@ ## ############################################################################### +import os import re from setuptools import setup, find_packages @@ -31,7 +32,7 @@ Authors: - Tobias Oberstein (maintainer) """ -VERSIONFILE = "scour/__init__.py" +VERSIONFILE = os.path.join(os.path.dirname(os.path.realpath(__file__)), "scour", "__init__.py") verstrline = open(VERSIONFILE, "rt").read() VSRE = r"^__version__ = u['\"]([^'\"]*)['\"]" mo = re.search(VSRE, verstrline, re.M)