allow installation via direct execution of setup.py from outside the package directory

This commit is contained in:
Tobias Oberstein 2016-01-15 11:15:22 +01:00
parent 07e9ec0257
commit 73ec7da13e

View file

@ -16,6 +16,7 @@
## ##
############################################################################### ###############################################################################
import os
import re import re
from setuptools import setup, find_packages from setuptools import setup, find_packages
@ -31,7 +32,7 @@ Authors:
- Tobias Oberstein (maintainer) - 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() verstrline = open(VERSIONFILE, "rt").read()
VSRE = r"^__version__ = u['\"]([^'\"]*)['\"]" VSRE = r"^__version__ = u['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M) mo = re.search(VSRE, verstrline, re.M)