Skip to content

Commit

Permalink
Merge pull request #114 from Baaaaam/chg_default_prefix
Browse files Browse the repository at this point in the history
change default prefix
  • Loading branch information
gonuke authored Dec 12, 2016
2 parents 2f58724 + cd3b22d commit 830efd0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Then build and install:
.. code-block:: bash
$ cd cymetric
$ python setup.py install --user
$ python setup.py install
Next, run the tests to ensure everything is working properly:

Expand Down
23 changes: 23 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,28 @@


def main():

arguments = []
for arg in sys.argv[1:]:
if not arg == "--user":
arguments.append(arg)

if not( any("--prefix" in arg for arg in arguments)):
home = os.getenv("HOME")
prefix = '--prefix=' + home + '/.local'
arguments.append(prefix)

if any("--user" in arg for arg in sys.argv):
print("\nWARNING: To be consistent with the Cyclus installation"
" options, '--user' flag have been disabled and"
" installation path set to '~/.local'.")
else:
print("\nWARNING: To be consistent with the Cyclus installation"
" options, the default installation path have been"
" overrided to '~/.local'.")
print("WARNING: To manually specify the install prefix use"
" --prefix=your/install/path flag.\n")

scripts = [os.path.join('scripts', f) for f in os.listdir('scripts')]
scripts = [s for s in scripts if ((IS_NT and s.endswith('.bat'))
or (not IS_NT and
Expand All @@ -62,6 +84,7 @@ def main():
"packages": packages,
"package_dir": pack_dir,
"scripts": scripts,
"script_args": arguments,
}
rtn = core.setup(**setup_kwargs)
return rtn
Expand Down

0 comments on commit 830efd0

Please sign in to comment.