forked from biolab/orange3-single-cell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
145 lines (117 loc) · 4.4 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
#!/usr/bin/env python3
from os import path, walk
import sys
from setuptools import setup, find_packages, Command
import subprocess
NAME = "Orange3-SingleCell"
VERSION = "0.4.0"
DESCRIPTION = "Add-on for bioinformatics analysis of single cell data"
LONG_DESCRIPTION = open(path.join(path.dirname(__file__), 'README.md')).read()
AUTHOR = 'Bioinformatics Laboratory, FRI UL'
AUTHOR_EMAIL = '[email protected]'
URL = "https://github.com/biolab/orange3-single-cell"
DOWNLOAD_URL = "https://github.com/biolab/orange3-single-cell/tarball/{}".format(VERSION)
LICENSE = 'GPLv3+'
KEYWORDS = (
# [PyPi](https://pypi.python.org) packages with keyword "orange3 add-on"
# can be installed using the Orange Add-on Manager
'orange3 add-on',
)
PACKAGES = find_packages()
PACKAGE_DATA = {
'orangecontrib.single_cell': ['tutorials/*.ows'],
'orangecontrib.single_cell.launcher': ['icons/*'],
'orangecontrib.single_cell.widgets': ['icons/*', 'data/*']
}
DATA_FILES = [
# Data files that will be installed outside site-packages folder
]
INSTALL_REQUIRES = sorted(set(
line.partition('#')[0].strip()
for line in open(path.join(path.dirname(__file__), 'requirements.txt'))
) - {''})
ENTRY_POINTS = {
# Entry points that marks this package as an orange add-on. If set, addon will
# be shown in the add-ons manager even if not published on PyPi.
'orange3.addon': (
'single_cell = orangecontrib.single_cell',
),
# Entry point used to specify packages containing tutorials accessible
# from welcome screen. Tutorials are saved Orange Workflows (.ows files).
'orange.widgets.tutorials': (
# Syntax: any_text = path.to.package.containing.tutorials
'vcftutorials = orangecontrib.single_cell.tutorials',
),
# Entry point used to specify packages containing widgets.
'orange.widgets': (
# Syntax: category name = path.to.package.containing.widgets
# Widget category specification can be seen in
# orangecontrib/example/widgets/__init__.py
'Single Cell = orangecontrib.single_cell.widgets',
),
# Register widget help
"orange.canvas.help": (
'html-index = orangecontrib.single_cell.widgets:WIDGET_HELP_PATH',)
}
NAMESPACE_PACKAGES = ["orangecontrib"]
TEST_SUITE = "orangecontrib.single_cell.tests.suite"
def include_documentation(local_dir, install_dir):
global DATA_FILES
if (('bdist_wheel' in sys.argv) or ('install' in sys.argv))\
and not path.exists(local_dir):
print("Directory '{}' does not exist. "
"Please build documentation before running bdist_wheel."
.format(path.abspath(local_dir)))
sys.exit(0)
doc_files = []
for dirpath, dirs, files in walk(local_dir):
doc_files.append((dirpath.replace(local_dir, install_dir),
[path.join(dirpath, f) for f in files]))
DATA_FILES.extend(doc_files)
class CoverageCommand(Command):
"""A setup.py coverage subcommand developers can run locally."""
description = "run code coverage"
user_options = []
initialize_options = finalize_options = lambda self: None
def check_requirements(self):
try:
import coverage
except ImportError as e:
raise e
def run(self):
"""Check coverage on current workdir"""
self.check_requirements()
sys.exit(subprocess.call(r'''
coverage run setup.py test
echo; echo
coverage report
coverage html &&
{ echo; echo "See also: file://$(pwd)/coverage_html_report/index.html"; echo; }
''', shell=True, cwd=path.dirname(path.abspath(__file__))))
if __name__ == '__main__':
include_documentation('doc/build/htmlhelp', 'help/orange3-single_cell')
cmdclass = {
'coverage': CoverageCommand,
}
setup(
name=NAME,
version=VERSION,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
url=URL,
download_url=DOWNLOAD_URL,
license=LICENSE,
packages=PACKAGES,
package_data=PACKAGE_DATA,
data_files=DATA_FILES,
install_requires=INSTALL_REQUIRES,
entry_points=ENTRY_POINTS,
keywords=KEYWORDS,
namespace_packages=NAMESPACE_PACKAGES,
test_suite=TEST_SUITE,
include_package_data=True,
zip_safe=False,
cmdclass=cmdclass
)