diff options
-rwxr-xr-x | __root__/run-setup | 2 | ||||
-rw-r--r-- | __root__/setup.py | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/__root__/run-setup b/__root__/run-setup index b9ae606..6c839d1 100755 --- a/__root__/run-setup +++ b/__root__/run-setup @@ -4,4 +4,4 @@ use_dir="$( ls -l "$(echo "${0}" | sed 's|\./||')" | cut -d'>' -f2 | awk '{print $NF}' )" )" -(cd "${use_dir}"; python setup.py "$@") +python "${use_dir}/setup.py" "$@" # setup.py now chdir's on its own diff --git a/__root__/setup.py b/__root__/setup.py index df3ccf0..2bd577d 100644 --- a/__root__/setup.py +++ b/__root__/setup.py @@ -14,9 +14,10 @@ except ImportError: from collections import Callable from glob import glob -from os import getcwd, getenv, sep, walk -from os.path import (join as path_join, basename as path_basename, - dirname as path_dirname, normpath as path_norm, +from os import chdir, getcwd, getenv, sep, walk +from os.path import (join as path_join, + basename as path_basename, dirname as path_dirname, + abspath as path_abs, normpath as path_norm, isabs as path_isabs, isdir as path_isdir, isfile as path_isfile, splitext as path_splitext) from shutil import copy, copymode @@ -44,6 +45,9 @@ PREFER_GITHUB = True DEBUG = getenv("SETUPDEBUG") DBGPFX = str(__file__) +here = path_abs(path_dirname(__file__)) +chdir(here) # memoize the trick in run-setup.py + play better with pip install + # # Custom machinery extending setuptools/distutils with mechanism # for parameterization (mainly paths) and even content of these files @@ -102,7 +106,7 @@ class LazyRead(object): Note: only direct use, str methods and '+' operator supported. """ def __init__(self, filename, postproc=lambda c: c): - self._filename = filename + self._filename = path_norm(path_join(here, filename)) # chdir'd, but... self._postproc = postproc self._content = None @property |