-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathsetup.py
More file actions
87 lines (75 loc) · 2.57 KB
/
setup.py
File metadata and controls
87 lines (75 loc) · 2.57 KB
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
82
83
84
85
86
87
import os
from setuptools import setup, find_packages
from setuptools.command.install import install as _install
# Setup version
VERSION = '2.2.0'
# Read description
with open('README.rst', 'r') as readme:
README_TEXT = readme.read()
def write_version_py():
filename = os.path.join(
os.path.dirname(__file__),
'remoteappmanager',
'version.py')
ver = "__version__ = '{}'\n"
with open(filename, 'w') as fh:
fh.write("# Autogenerated by setup.py\n")
fh.write(ver.format(VERSION))
write_version_py()
# Unfortunately RTD cannot install jupyterhub because jupyterhub needs bower,
# and that is not available. We prevent the request for the unreleased jhub
# by skipping it if we are on RTD
on_rtd = os.environ.get('READTHEDOCS') == 'True'
if on_rtd:
# These are the dependencies of jupyterhub that we need to have in order
# for our code to import on RTD.
requirements = [
"setuptools>=21.0",
"traitlets>=4.1",
"tornado>=4.3",
"requests>=2.20.0",
"escapism>=0.0.1",
"jupyter_client>=4.3.0",
"click>=6.6",
"tabulate>=0.7.5",
"oauthenticator>=0.5",
"sqlalchemy<1.4",
# Pinning jinja2 requirements when building on RTD due to
# regression when using old versions of sphinx<2
# https://github.com/readthedocs/readthedocs.org/issues/9037
"jinja2<3.1.0",
]
else:
with open('requirements.txt', 'r') as REQUIREMENTS:
requirements = [
line.strip() for line in REQUIREMENTS.readlines()
if not line.startswith('#')
]
class install(_install):
def run(self):
if not on_rtd:
import subprocess
subprocess.check_call(['npm', 'run', 'build'])
super().run()
# main setup configuration class
setup(
name='remoteappmanager',
version=VERSION,
author='SimPhoNy Project',
description='Remote application manager sub-executable',
long_description=README_TEXT,
install_requires=requirements,
packages=find_packages(exclude=["selenium_tests"]),
include_package_data=True,
entry_points={
'console_scripts': [
"remoteappmanager = " +
"remoteappmanager.cli.remoteappmanager.__main__:main",
"remoteappadmin = " +
"remoteappmanager.cli.remoteappadmin.__main__:main",
"remoteappdb = remoteappmanager.cli.remoteappdb.__main__:main",
"remoteapprest = remoteappmanager.cli.remoteapprest.__main__:main"
]
},
cmdclass={'install': install}
)