forked from 8400TheHealthNetwork/HebSafeHarbor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
61 lines (51 loc) · 2.07 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
import os
from os import path
from setuptools import setup, find_packages
this_directory = path.abspath(path.dirname(__file__))
parent_directory = os.path.abspath(os.path.join(this_directory, os.pardir))
VERSION = {}
with open(f"{this_directory}/hebsafeharbor/version.py", "r") as version_file:
exec(version_file.read(), VERSION)
def get_requirements_from_files(*files):
install_requires = {}
for filename in files:
if os.path.isfile(filename):
with open(filename) as f:
for line in f.readlines():
line = line.strip()
if line and not line.startswith("#"):
if "#" in line:
req, version = line.split("#")[0].strip().split("==")
else:
req, version = line, None
# requirement versions must be specified with "==", otherwise the line above will fail
if req not in install_requires:
install_requires[req] = version
reqs = []
for k, v in sorted(install_requires.items()):
if v:
reqs.append(f"{k}=={v}")
else:
reqs.append(k)
return reqs
install_requires_ = get_requirements_from_files('requirements.txt')
for requirement in install_requires_:
print("adding requirement: " + requirement)
with open(path.join(this_directory, "README.MD"), encoding="utf-8") as f:
long_description = f.read()
setup(
name="hebsafeharbor",
author="hebsafeharbor",
version=VERSION["VERSION"],
author_email="[email protected]",
url="https://github.com/8400TheHealthNetwork/HebSafeHarbor",
license="MIT License (MIT)",
include_package_data=True,
long_description=long_description,
long_description_content_type="text/markdown",
description="De-identification toolkit for clinical text in Hebrew",
keywords=["hebrew nlp spacy SpaCy phi pii"],
packages=find_packages(exclude=["demo"]),
install_requires=install_requires_,
python_requires=">=3.8.0",
)