Fix: "python ABS/PATH/TO/ipython.py" fails

The following line in setupbase.py was the problem.  It assumes
that your CWD is always at the repository root.  This patch removes
this assumption.

    execfile(pjoin('IPython','core','release.py'), globals())
This commit is contained in:
Takafumi Arakaki 2013-05-04 22:38:32 +02:00
parent fa872236a2
commit 4aa2bca46c

View File

@ -40,6 +40,7 @@ from setupext import install_data_ext
# A few handy globals # A few handy globals
isfile = os.path.isfile isfile = os.path.isfile
pjoin = os.path.join pjoin = os.path.join
repo_root = os.path.dirname(os.path.abspath(__file__))
def oscmd(s): def oscmd(s):
print(">", s) print(">", s)
@ -72,7 +73,7 @@ def file_doesnt_endwith(test,endings):
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# release.py contains version, authors, license, url, keywords, etc. # release.py contains version, authors, license, url, keywords, etc.
execfile(pjoin('IPython','core','release.py'), globals()) execfile(pjoin(repo_root, 'IPython','core','release.py'), globals())
# Create a dict with the basic information # Create a dict with the basic information
# This dict is eventually passed to setup after additional keys are added. # This dict is eventually passed to setup after additional keys are added.
@ -373,8 +374,6 @@ def check_for_dependencies():
# VCS related # VCS related
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
here = os.path.abspath(os.path.dirname(__file__))
# utils.submodule has checks for submodule status # utils.submodule has checks for submodule status
execfile(pjoin('IPython','utils','submodule.py'), globals()) execfile(pjoin('IPython','utils','submodule.py'), globals())
@ -401,7 +400,7 @@ class UpdateSubmodules(Command):
failure = e failure = e
print(e) print(e)
if not check_submodule_status(here) == 'clean': if not check_submodule_status(repo_root) == 'clean':
print("submodules could not be checked out") print("submodules could not be checked out")
sys.exit(1) sys.exit(1)
@ -462,7 +461,7 @@ def require_submodules(command):
"""decorator for instructing a command to check for submodules before running""" """decorator for instructing a command to check for submodules before running"""
class DecoratedCommand(command): class DecoratedCommand(command):
def run(self): def run(self):
if not check_submodule_status(here) == 'clean': if not check_submodule_status(repo_root) == 'clean':
print("submodules missing! Run `setup.py submodule` and try again") print("submodules missing! Run `setup.py submodule` and try again")
sys.exit(1) sys.exit(1)
command.run(self) command.run(self)