forked from AllenInstitute/asap-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
67 lines (58 loc) · 2.28 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
#!/usr/bin/env python
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import logging
class PyTest(TestCommand, object):
user_options = [('pytest-args=', 'a', "Arguments to pass to pytest")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = ""
def run(self):
try:
import cv2 # noqa: F401
import em_stitch # noqa: F401
self.distribution.install_requires = [
i for i in self.distribution.install_requires
if not i.startswith('em_stitch')]
except ImportError:
pass
print(self.distribution.install_requires)
super(PyTest, self).run()
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import shlex
import pytest
self.pytest_args += " --cov=rendermodules --cov-report html "\
"--junitxml=test-reports/test.xml"
FORMAT = "[%(filename)s:%(lineno)s - %(funcName)20s() ] %(message)s"
logging.basicConfig(format=FORMAT)
errno = pytest.main(shlex.split(self.pytest_args))
sys.exit(errno)
with open('test_requirements.txt', 'r') as f:
test_required = f.read().splitlines()
with open('requirements.txt', 'r') as f:
required = f.read().splitlines()
setup(name='asap-modules',
use_scm_version=True,
description=(
'A set of python modules for doing higher level processing steps '
'using render, developed for processing array tomography '
'and EM images. See http://github.com/saalfeldlab/render'),
author=(
'Gayathri Mahalingam, Russel Torres, Daniel Kapner, '
'Sharmishtaa Seshamani, Forrest Collman, Eric Perlman, Sam Kinn'),
author_email='[email protected]',
url='https://github.com/AllenInstitute/asap/',
packages=find_packages(),
package_data={
'': [
'*.bsh',
'LICENSE',
'README.rst',
'*.md',
'asap/point_match_optimization/*.html']},
install_requires=required,
setup_requires=['flake8', 'setuptools_scm'],
tests_require=test_required,
cmdclass={'test': PyTest})