Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hschilling committed Apr 21, 2015
1 parent 8b4d196 commit 3d77ac6
Showing 1 changed file with 6 additions and 28 deletions.
34 changes: 6 additions & 28 deletions openmdao.devtools/src/openmdao/devtools/loc_bld_tst.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ def _run_install_script(startdir, install_script_path, args=()):
py = sys.executable.replace('\\','/')
envdict = os.environ.copy()

# import os
# os.environ['PATH'] = '/home/ubuntu/anaconda/bin:' + os.environ['PATH']

print 'inside _run_install_script PATH', os.environ['PATH']


# if we're running from inside of a virtualenv, we need to
# remove VIRTUAL_ENV from the environment before spawning the
# subprocess, else the build will end up inside of devenv
Expand Down Expand Up @@ -116,8 +110,12 @@ def _run_install_script(startdir, install_script_path, args=()):
def _run_sub(outname, cmd, env=None):
f = open(outname, 'wb')
try:
p = subprocess.Popen(cmd, stdout=f, stderr=subprocess.STDOUT,
shell=True, env=env, executable='/bin/bash')
if sys.platform.startswith('win'):
p = subprocess.Popen(cmd, stdout=f, stderr=subprocess.STDOUT,
shell=True, env=env)
else:
p = subprocess.Popen(cmd, stdout=f, stderr=subprocess.STDOUT,
shell=True, env=env, executable='/bin/bash')
_wait(p)
finally:
f.close()
Expand Down Expand Up @@ -185,7 +183,6 @@ def build_and_test(fname=None, workdir='.', keep=False,
if build_type == 'release':
envdir, retcode = install_release(fname)
else: # dev test
# envdir, retcode = install_dev_env(fname, branch=options.branch)
envdir, retcode = install_dev_env(fname, branch=branch, anaconda=anaconda)
finally:
os.chdir(workdir)
Expand Down Expand Up @@ -314,31 +311,15 @@ def install_dev_env(url, branch=None, anaconda=False):

print "building openmdao development environment in %s" % treedir

# gopath = os.path.join(treedir, 'go-openmdao-dev.py')

# retcode = _run_gofile(startdir, gopath)

install_script_path = os.path.join(treedir, 'install_openmdao_dev.py')

print 'calling _run_install_script'
retcode = _run_install_script(startdir, install_script_path)



if anaconda:
envdir = treedir
else:
envdir = os.path.join(treedir, 'devenv')



# envdir = treedir # qqq in the new version






print 'new openmdao environment built in %s' % envdir

return (envdir, retcode)
Expand All @@ -365,9 +346,6 @@ def activate_and_test(envdir, testargs=(), anaconda=False):
print "running tests from %s" % envdir
# print "running tests from %s" % devbinpath
env = os.environ.copy()
# for name in ['VIRTUAL_ENV', '_OLD_VIRTUAL_PATH', '_OLD_VIRTUAL_PROMPT']:
# if name in env:
# del env[name]
print "command = ", command
return _run_sub('test.out', command, env=env)
else:
Expand Down

0 comments on commit 3d77ac6

Please sign in to comment.