forked from regro/regolith
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·81 lines (71 loc) · 2.56 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env python
# coding=utf-8
"""The regolith installer."""
from __future__ import print_function
from pathlib import Path
import os
import sys
import platform
try:
from setuptools import setup
from setuptools.command.develop import develop
HAVE_SETUPTOOLS = True
except ImportError:
from distutils.core import setup
HAVE_SETUPTOOLS = False
from regolith import __version__ as RG_VERSION
PW_AFFECTED_OSX_SYSTEMS = ["darwin"]
def main():
try:
if "--name" not in sys.argv:
print(logo)
except UnicodeEncodeError:
pass
with open(os.path.join(os.path.dirname(__file__), "README.rst"), "r") as f:
readme = f.read()
skw = dict(
name="regolith",
description="A research group content management system",
long_description=readme,
license="CC0",
version='0.5.1',
author="Anthony Scopatz",
maintainer="Anthony Scopatz",
author_email="scopatz@gmail.com",
url="https://github.com/scopatz/regolith",
platforms="Cross Platform",
python_requires='>=3.8',
classifiers=["Programming Language :: Python :: 3"],
packages=["regolith", "regolith.builders", "regolith.helpers"],
package_dir={"regolith": "regolith"},
package_data={
"regolith": [
"templates/*",
"static/*.*",
"static/img/*.*",
"*.xsh",
]
},
scripts=["scripts/regolith"],
zip_safe=False,
)
if HAVE_SETUPTOOLS:
skw["setup_requires"] = []
# skw['install_requires'] = ['Jinja2', 'pymongo']
if platform.system().lower() in PW_AFFECTED_OSX_SYSTEMS:
#The following lines find the python.app script, parses the script to find the path of its executable, and sets
#the sys.executable to that executable. The shebang line created will be that of the new sys.executable
import subprocess
py_app_path = subprocess.check_output('which python.app', shell=True)
py_app_path = py_app_path.decode('utf-8')[:-1]
py_app_contents = subprocess.check_output('cat ' + py_app_path, shell=True)
py_app_contents = py_app_contents.decode('utf-8')
new_sys_executable = py_app_contents.splitlines()[-1]
new_sys_executable = new_sys_executable.split(' ')[0]
sys.executable = new_sys_executable
skw['scripts'] = skw['scripts'] + ['scripts/helper_gui'] + ['scripts/profile_regolith'] + ['scripts/profile_helper_gui']
setup(**skw)
logo = """
"""
if __name__ == "__main__":
main()