Skip to content

Commit d7bdd1f

Browse files
committed
#netpyne-132: installation refactoring 2
1 parent c47cac7 commit d7bdd1f

1 file changed

Lines changed: 34 additions & 34 deletions

File tree

utilities/install.py

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -87,41 +87,38 @@ def compile_mod():
8787

8888

8989
def main(netpyne_branch, workspace_branch, geppetto_branch=None, skipNpm=False,
90-
skipTest=False, development=False):
90+
skipTest=False, development=False):
9191
cprint("Installing requirements")
92-
print(workspace_branch)
9392
execute(cmd=['pip', 'install', '-r', 'requirements.txt'], cwd=ROOT_DIR)
93+
cprint("Installing UI python package...")
94+
execute(cmd=['pip', 'install', '-e', '.', '--no-deps'], cwd=ROOT_DIR)
9495

9596
if not os.path.exists(DEPS_DIR):
9697
os.mkdir(DEPS_DIR)
9798

98-
99-
if development:
99+
if geppetto_branch:
100+
if geppetto_branch.replace(" ", "") is '':
101+
geppetto_branch = 'development'
100102
os.chdir(DEPS_DIR)
101-
# clone and install netpyne
102-
if geppetto_branch and geppetto_branch != 'master':
103-
cprint("Installing geppetto-meta")
104-
clone(repository=META, folder=META_DIR, branch_or_tag=geppetto_branch)
105-
# installing pygeppetto
106-
cprint("Installing pygeppetto")
107-
execute(cmd=['pip', 'install', '-e', '.'], cwd=os.path.join(DEPS_DIR, META_DIR, PYGEPPETTO_DIR))
108-
# installing jupyter geppetto
109-
cprint("Installing jupyter geppetto")
110-
execute(cmd=['pip', 'install', '-e', '.'], cwd=os.path.join(DEPS_DIR, META_DIR, JUPYTER_DIR))
111-
# installing core dependencies
112-
execute(cmd=['pip', 'install', '-e', '.'], cwd=ROOT_DIR)
113-
if netpyne_branch and netpyne_branch != 'master':
114-
cprint("Installing netpyne")
115-
clone(repository=NETPYNE, branch_or_tag=netpyne_branch)
116-
execute(cmd=['pip', 'install', '-e', '.'], cwd=os.path.join(DEPS_DIR, NETPYNE_DIR))
117-
else:
118-
# install requirements
119-
if geppetto_branch and geppetto_branch != 'master':
120-
sys.exit("ERROR: geppetto-meta branch not supported in production mode")
121-
if netpyne_branch and netpyne_branch != 'master':
122-
sys.exit("ERROR: netpyne branch not supported in production mode")
123-
cprint("Installing UI python package...")
124-
execute(cmd=['pip', 'install', '-e', '.', '--no-deps'], cwd=ROOT_DIR)
103+
cprint("Installing geppetto-meta")
104+
clone(repository=META, folder=META_DIR, branch_or_tag=geppetto_branch)
105+
# installing pygeppetto
106+
cprint("Installing pygeppetto")
107+
execute(cmd=['pip', 'install', '-e', '.'], cwd=os.path.join(DEPS_DIR, META_DIR, PYGEPPETTO_DIR))
108+
# installing jupyter geppetto
109+
cprint("Installing jupyter geppetto")
110+
execute(cmd=['pip', 'install', '-e', '.'], cwd=os.path.join(DEPS_DIR, META_DIR, JUPYTER_DIR))
111+
# installing core dependencies
112+
execute(cmd=['pip', 'install', '-e', '.'], cwd=ROOT_DIR)
113+
if netpyne_branch:
114+
if netpyne_branch.replace(" ", "") is '':
115+
netpyne_branch = 'development'
116+
os.chdir(DEPS_DIR)
117+
cprint("Installing netpyne")
118+
clone(repository=NETPYNE, branch_or_tag=netpyne_branch)
119+
execute(cmd=['pip', 'install', '-e', '.'], cwd=os.path.join(DEPS_DIR, NETPYNE_DIR))
120+
121+
125122

126123
os.chdir(ROOT_DIR)
127124
if workspace_branch:
@@ -225,22 +222,25 @@ def main(netpyne_branch, workspace_branch, geppetto_branch=None, skipNpm=False,
225222
help='Install for development.')
226223

227224
parser.add_argument('--netpyne', '-vn', dest='netpyne_version', action="store",
228-
default=os.getenv('NETPYNE_VERSION', 'development'),
225+
default=os.getenv('NETPYNE_VERSION', None),
229226
help='Specify NetPyNE library branch or tag.')
230227

231228
parser.add_argument('--workspace', '-vw', dest='workspace_version', action="store",
232229
default=os.getenv('WORKSPACE_VERSION', 'master'),
233230
help='Specify workspace branch or tag.')
234231

235232
parser.add_argument('--geppetto', '-vp', dest='geppetto_version', action="store",
236-
default=os.getenv('GEPPETTO_VERSION', 'development'),
233+
default=os.getenv('GEPPETTO_VERSION', None),
237234
help='Specify Pygeppetto library branch or tag (only for dev build).')
238235

239236
args = parser.parse_args(sys.argv[1:])
240237
print('Install arguments:\n', args)
241238

239+
cprint(args.netpyne_version)
240+
sys.exit()
241+
242242
main(skipNpm=args.skipNpm, skipTest=args.skipTest, development=args.development,
243-
netpyne_branch=args.netpyne_version,
244-
workspace_branch=args.workspace_version,
245-
geppetto_branch=args.geppetto_version,
246-
)
243+
netpyne_branch=args.netpyne_version,
244+
workspace_branch=args.workspace_version,
245+
geppetto_branch=args.geppetto_version,
246+
)

0 commit comments

Comments
 (0)