-
Notifications
You must be signed in to change notification settings - Fork 96
/
setup.py
74 lines (63 loc) · 2.14 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
from setuptools import setup, find_packages
import os
import io
import sys
import contextlib
PACKAGES = find_packages()
# From https://github.com/explosion/spaCy/blob/master/setup.py
@contextlib.contextmanager
def chdir(new_dir):
old_dir = os.getcwd()
try:
os.chdir(new_dir)
sys.path.insert(0, new_dir)
yield
finally:
del sys.path[0]
os.chdir(old_dir)
def setup_package():
root = os.path.abspath(os.path.dirname(__file__))
with open('README.md') as reader:
readme = reader.read()
with open('requirements.txt') as f:
requirements = f.read().splitlines()
dependency_links = []
i = 0
while i < len(requirements):
if requirements[i].startswith('https://'):
dependency_links.append(requirements.pop(i))
else:
i += 1
# From https://github.com/explosion/spaCy/blob/master/setup.py
with chdir(root):
with io.open(os.path.join(root, "quickumls", "about.py"), encoding="utf8") as f:
about = {}
exec(f.read(), about)
setup(
name=about['__title__'],
version=about['__version__'],
description=(
'QuickUMLS is a tool for fast, unsupervised biomedical '
'concept extraction from medical text'
),
packages=PACKAGES,
long_description=readme,
long_description_content_type='text/markdown',
author=about['__author__'],
author_email=about['__email__'],
url='https://github.com/Georgetown-IR-Lab/QuickUMLS',
license=about['__license__'],
install_requires=requirements,
dependency_links=dependency_links,
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 2",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Development Status :: 5 - Production/Stable",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Bio-Informatics",
]
)
if __name__ == '__main__':
setup_package()