Skip to content

Commit

Permalink
Merge pull request ipython#3276 from tkf/fix-setupbase
Browse files Browse the repository at this point in the history
Remove assumption that setup is being run from repo root.
  • Loading branch information
fperez committed May 10, 2013
2 parents 813a538 + 029c043 commit 12fe966
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions setupbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
# A few handy globals
isfile = os.path.isfile
pjoin = os.path.join
repo_root = os.path.dirname(os.path.abspath(__file__))

def oscmd(s):
print(">", s)
Expand Down Expand Up @@ -72,7 +73,7 @@ def file_doesnt_endwith(test,endings):
#---------------------------------------------------------------------------

# 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
# This dict is eventually passed to setup after additional keys are added.
Expand Down Expand Up @@ -373,8 +374,6 @@ def check_for_dependencies():
# VCS related
#---------------------------------------------------------------------------

here = os.path.abspath(os.path.dirname(__file__))

# utils.submodule has checks for submodule status
execfile(pjoin('IPython','utils','submodule.py'), globals())

Expand All @@ -401,7 +400,7 @@ def run(self):
failure = 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")
sys.exit(1)

Expand Down Expand Up @@ -462,7 +461,7 @@ def require_submodules(command):
"""decorator for instructing a command to check for submodules before running"""
class DecoratedCommand(command):
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")
sys.exit(1)
command.run(self)
Expand Down

0 comments on commit 12fe966

Please sign in to comment.