-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
92 lines (77 loc) · 3.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# How to build source distribution
# python setup.py sdist --format bztar
# python setup.py sdist --format gztar
# python setup.py sdist --format zip
import os
from setuptools import setup, find_packages
from distutils.core import Extension
MAJOR = 0
MINOR = 1
MICRO = 0
VERSION = "{}.{}.{}".format(MAJOR, MINOR, MICRO)
def write_version_file(fn=None):
if fn is None:
fn = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
os.path.join("cohort_manager", "version.py")
)
content = ("# THIS FILE WAS GENERATED FROM SETUP.PY\n"
"cohort_manager_version = \"{version}\"\n")
a = open(fn, "w")
try:
a.write(content.format(version=VERSION))
finally:
a.close()
def string_search_extension():
extension_info = {
"sources": ["cohort_manager/src/query.cpp",
"cohort_manager/src/py_stringsearch.cpp"],
}
return Extension("cohort_manager.c_string_search", **extension_info)
def setup_package():
# Saving the version into a file
write_version_file()
setup(
name="cohort_manager",
version=VERSION,
description="Tool to manage collections of phenotype data.",
long_description=("This package provides an API and a REPL interface "
"to access standardized variables."),
author=u"Marc-André Legault",
author_email="legaultmarc@gmail.com",
url="https://github.com/legaultmarc/cohort_manager",
license="MIT",
packages=find_packages(exclude=["tests", ]),
entry_points={
"console_scripts": [
"cohort-repl=cohort_manager.scripts.cohort_repl:entry_point",
"cohort-drugs-import=cohort_manager.scripts.cohort_drugs_import:parse_args",
"cohort-import=cohort_manager.scripts.cohort_import:parse_args",
"cohort-sim=cohort_manager.scripts.cohort_sim:parse_args",
"cohort-snomed-ct=cohort_manager.scripts.cohort_snomed_ct:parse_args",
"cohort-genetest=cohort_manager.scripts.cohort_genetest:parse_args",
],
},
classifiers=["Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: Unix",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Bio-Informatics"],
test_suite="cohort_manager.tests.test_suite",
keywords="bioinformatics genomics phewas epidemiology cohort",
install_requires=["numpy >= 1.8.1", "pandas >= 0.15", "six >= 1.10",
"psycopg2 >= 2.6", "scipy >= 0.18",
"Unidecode >= 0.4.17"],
zip_safe=False,
ext_modules=[
string_search_extension(),
]
)
if __name__ == "__main__":
setup_package()