|
a |
|
b/setup.py |
|
|
1 |
import os |
|
|
2 |
import sys |
|
|
3 |
|
|
|
4 |
import setuptools |
|
|
5 |
from setuptools.command.install import install |
|
|
6 |
|
|
|
7 |
import deidentify |
|
|
8 |
|
|
|
9 |
VERSION = deidentify.__version__ |
|
|
10 |
|
|
|
11 |
with open("README.md", "r") as fh: |
|
|
12 |
readme = fh.read() |
|
|
13 |
|
|
|
14 |
|
|
|
15 |
class VerifyVersionCommand(install): |
|
|
16 |
"""Custom command to verify that the git tag matches the version of the python package""" |
|
|
17 |
|
|
|
18 |
def run(self): |
|
|
19 |
tag = os.getenv('RELEASE_VERSION') |
|
|
20 |
|
|
|
21 |
if tag != VERSION: |
|
|
22 |
info = "Git tag: {} does not match the version of this package: {}".format(tag, VERSION) |
|
|
23 |
sys.exit(info) |
|
|
24 |
else: |
|
|
25 |
info = "Git tag: {} matches package version: {}".format(tag, VERSION) |
|
|
26 |
print(info) |
|
|
27 |
|
|
|
28 |
|
|
|
29 |
setuptools.setup( |
|
|
30 |
name="deidentify", |
|
|
31 |
version=VERSION, |
|
|
32 |
author="Jan Trienes", |
|
|
33 |
author_email="jan.trienes@nedap.com", |
|
|
34 |
description="De-identify free-text medical records", |
|
|
35 |
long_description=readme, |
|
|
36 |
long_description_content_type="text/markdown", |
|
|
37 |
url="https://github.com/nedap/deidentify", |
|
|
38 |
packages=setuptools.find_packages(exclude=['tests', 'tests.*']), |
|
|
39 |
package_data={ |
|
|
40 |
'': ['LICENSE'], |
|
|
41 |
'deidentify': [ |
|
|
42 |
'surrogates/generators/resources/*.csv', |
|
|
43 |
'surrogates/generators/resources/*.txt' |
|
|
44 |
] |
|
|
45 |
}, |
|
|
46 |
license="MIT License", |
|
|
47 |
classifiers=[ |
|
|
48 |
"Programming Language :: Python :: 3", |
|
|
49 |
"Programming Language :: Python :: 3.6", |
|
|
50 |
"Programming Language :: Python :: 3.7", |
|
|
51 |
"Programming Language :: Python :: 3.8", |
|
|
52 |
"Programming Language :: Python :: 3.9", |
|
|
53 |
"Operating System :: OS Independent", |
|
|
54 |
"License :: OSI Approved :: MIT License", |
|
|
55 |
], |
|
|
56 |
python_requires='>=3.7', |
|
|
57 |
install_requires=[ |
|
|
58 |
'requests', |
|
|
59 |
'flair>=0.4.3,<0.11', |
|
|
60 |
'torch>=1.1.0', |
|
|
61 |
'spacy>=2.2.1,<3', |
|
|
62 |
'tqdm>=4.29', |
|
|
63 |
'deduce>=1.0.2', |
|
|
64 |
'loguru>=0.2.5', |
|
|
65 |
'sklearn-crfsuite>=0.3.6', |
|
|
66 |
'unidecode>=1.0.23', |
|
|
67 |
'pandas>=0.23.4', |
|
|
68 |
'nameparser>=1.0', |
|
|
69 |
'py-dateinfer>=0.4.5' |
|
|
70 |
], |
|
|
71 |
cmdclass={ |
|
|
72 |
'verify': VerifyVersionCommand, |
|
|
73 |
} |
|
|
74 |
) |