forked from legaultmarc/UKBPheWAS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
99 lines (81 loc) · 2.68 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
93
94
95
96
97
98
99
import os
import subprocess
import setuptools
from setuptools.command.install import install
from setuptools.command.develop import develop
class SetupPackage(object):
def check_r(self):
print("Detecting R installation (and required packages).")
p = subprocess.Popen([
"Rscript",
"-e", "library(rzmq)",
"-e", "library(rjson)",
])
ret = p.wait()
if ret != 0:
raise Exception(
"R or required packages are not installed. Make sure that "
"Rscript is in the path and that rjson and rzmq are "
"installed."
)
print("Rscript in path and required packages installed.")
def make_dealer(self):
dir = os.path.abspath(
os.path.join(os.path.dirname(__file__), "ukbphewas")
)
p = subprocess.Popen([
"make", "-C", dir
])
ret = p.wait()
if ret != 0:
raise Exception(
"Could not compile the ZMQ dealer. Make sure that gcc and "
"libzmq are installed."
)
def run(self):
self.check_r()
self.make_dealer()
class CustomInstall(SetupPackage, install):
def run(self):
SetupPackage.run(self)
install.run(self)
class CustomDevelop(SetupPackage, develop):
def run(self):
SetupPackage.run(self)
develop.run(self)
def setup_packages():
setuptools.setup(
name="ukbphewas",
version="2.0.0",
author="Marc-André Legault",
author_email="[email protected] ",
description="Package to run PheWAS analyses in the UK Biobank.",
url="https://github.com/legaultmarc",
packages=setuptools.find_packages(),
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"
],
python_requires='>=3.6',
include_package_data=True,
install_requires=["pandas>=0.25.2", "pyzmq>=18.1.0"],
zip_safe=False,
cmdclass={
"install": CustomInstall,
"develop": CustomDevelop,
},
entry_points={
"console_scripts": [
"ukbphewas=ukbphewas.conductor:main"
]
},
)
if __name__ == "__main__":
setup_packages()