-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
executable file
·150 lines (132 loc) · 4.17 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#!/usr/bin/env python
"""Development.
Install using
python setup.py install
### release new version
git commit -am "version bump";git push origin master
python setup.py --version
git tag -a v$(python setup.py --version) -m "upgrade";git push --tags
"""
import sys
if sys.version_info.major != 3:
raise RuntimeError(
f"Python 3 required. found {sys.version_info.major}"
)
if sys.version_info.minor > 9:
raise RuntimeError(
f"Python <=3.9 required, because of pysam compatibility issues. found {sys.version_info.minor}"
)
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
requirements = {
"base": [
# 'roux'
"roux==0.1.1",
## requirements from roux
# 'seaborn',
# 'numpy>=1.17.3',
# 'pandas>=0.25.3',
# 'pyyaml>=5.1',
# 'matplotlib>=2.2',
"papermill",
"biopython",
"regex", # expanded regex package
"scipy",
"pyensembl==2.2.9",
"pysam==0.22.0", # to convert sam to bam
## workflow
"papermill",
"argh==0.29.*", # for command line
# aes
"jinja2", # for pandas dataframe formatting
"ipywidgets", # for tqdm
# 'app':[
# "importlib-metadata==4.13.0", # to avoid celery error
# ],
# ],
# 'viz':[
"igv-notebook==0.5.2",
"pyfaidx==0.8.0", ## for indexing fasta file
],
"gui": [
"mercury==2.3.7",
"dna_features_viewer==3.1.3",
"chrov==0.0.2",
],
## development and maintenance
"dev": [
"pytest",
"jupyter",
"ipywidgets",
"ipykernel",
"black",
"coveralls == 3.*",
"flake8",
"isort",
"pytest-cov == 2.*",
"testbook",
# 'papermill',
"lazydocs", #'regex', ## docs
# 'sphinx','recommonmark',
],
}
extras_require = {k: l for k, l in requirements.items() if not k == "base"}
## all: extra except dev
extras_require["all"] = [l for k, l in extras_require.items() if not k == "dev"]
### flatten
extras_require["all"] = [s for l in extras_require["all"] for s in l]
### unique
extras_require["all"] = list(set(extras_require["all"]))
## install dependency added as a submodule
# git submodule add --depth 1 --name bwa https://github.com/lh3/bwa.git beditor/bwa
import subprocess
from os.path import dirname
from setuptools.command.install import install
class InstallCommand(install):
def run(self):
cwd = dirname(__file__)
com = f"cd {cwd if cwd!='' else '.'}/beditor/bwa;make"
print(com)
from glob import glob
print(glob(f"{cwd}/beditor/bwa/*"))
r = subprocess.run(com, shell=True)
assert r.returncode == 0, r.stderr
super().run()
# main setup
setuptools.setup(
name="beditor",
author="Rohan Dandage",
version="2.0.1",
url="https://github.com/rraadd88/beditor",
download_url="https://github.com/rraadd88/beditor/archive/master.zip",
description="A computational workflow for designing libraries of guide RNAs for CRISPR base editing",
long_description="https://github.com/rraadd88/beditor/blob/master/README.md",
keywords=["CRISPR", "genome", "biology"],
license="General Public License v. 3",
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
install_requires=requirements["base"],
extras_require=extras_require,
platforms="Tested on Ubuntu 22.04 64bit",
packages=setuptools.find_packages(
".",
exclude=["test", "tests", "unit", "deps", "data", "examples"],
# include=['beditor/bwa','beditor.bwa.bwakit','beditor.data'], # ignore warning in building because otherwise there is a module not found error
),
include_package_data=True,
entry_points={
"console_scripts": [
"beditor = beditor.run:parser.dispatch",
],
},
cmdclass={"install": InstallCommand},
package_data={
"data": ["beditor/data/*"],
"bwa": ["beditor/bwa/*"],
},
)