-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
91 lines (77 loc) · 2.91 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
82
83
84
85
86
87
88
89
90
91
__author__ = "Jeremy Nelson"
from setuptools import setup, find_packages
from setuptools.command.install import install
import os
import re
import sys
import subprocess
CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
BASE_DIR = os.path.abspath(os.path.dirname(CURRENT_DIR))
if os.path.exists(os.path.join(CURRENT_DIR, "VERSION")):
version_filepath = os.path.join(CURRENT_DIR, "VERSION")
if os.path.exists(os.path.join(BASE_DIR, "VERSION")):
version_filepath = os.path.join(BASE_DIR, "VERSION")
with open(version_filepath) as version:
__version__ = version.read().strip()
class BIBFRAMEDatastoreInstall(install):
JAVA_CHECK = re.compile(r"java version \"(.+)\"")
def __check_java__(self):
"""Method checks for a Java 7+ JVM to run other dependencies"""
raw_output = subprocess.getoutput("java -version")
result = BIBFRAMEDatastoreInstall.JAVA_CHECK.search(raw_output)
if result is not None:
version = result.groups()[0].split(".")
if int(version[1]) >= 7:
return True
return False
def __install_tomcat__(self, **kwargs):
pass
def run(self):
install.run(self)
if not self.__check_java__():
raise ValueError("Missing Java or Java version < 7")
setup(
name='bibframe_datastore',
author=__author__,
author_email='[email protected]',
cmdclass={'install': BIBFRAMEDatastoreInstall},
description='BIBFRAME Datastore Installation',
url='https://github.com/jermnelson/bibframe-datastore',
install_requires=[
'elasticsearch',
'falcon',
'flask',
'rdflib',
'requests',
],
license='GPLv3',
keywords=['bibframe',
'libraries',
'linked-data',
'library of congress',
'semantic web'],
py_modules=['app'],
version=__version__,
packages = find_packages(exclude=['repository',
'search',
'triplestore',
'tests']),
# packages=['app',
# 'semantic_server',
# 'semantic_server.analytics',
# 'semantic_server.analytics.resources',
# 'semantic_server.analytics.utilities',
# 'semantic_server.repository.resources',
# 'semantic_server.repository.utilities',
# 'semantic_server.repository.utilities.migrating',
# ],
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Console',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3.4',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application']
)