forked from ome/omero-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
114 lines (103 loc) · 4.01 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
import os
import sys
from setuptools import setup
from setuptools.command.test import test as test_command
class PyTest(test_command):
user_options = [
('test-path=', 't', "base dir for test collection"),
('test-ice-config=', 'i',
"use specified 'ice config' file instead of default"),
('test-pythonpath=', 'p', "prepend 'pythonpath' to PYTHONPATH"),
('test-marker=', 'm', "only run tests including 'marker'"),
('test-no-capture', 's', "don't suppress test output"),
('test-failfast', 'x', "Exit on first error"),
('test-verbose', 'v', "more verbose output"),
('test-string=', 'k', "filter tests by string"),
('test-quiet', 'q', "less verbose output"),
('junitxml=', None, "create junit-xml style report file at 'path'"),
('pdb', None, "fallback to pdb on error"),
]
def initialize_options(self):
test_command.initialize_options(self)
self.test_pythonpath = None
self.test_string = None
self.test_marker = None
self.test_path = 'test'
self.test_failfast = False
self.test_quiet = False
self.test_verbose = False
self.test_no_capture = False
self.junitxml = None
self.pdb = False
self.test_ice_config = None
def finalize_options(self):
test_command.finalize_options(self)
self.test_args = [self.test_path]
if self.test_string is not None:
self.test_args.extend(['-k', self.test_string])
if self.test_marker is not None:
self.test_args.extend(['-m', self.test_marker])
if self.test_failfast:
self.test_args.extend(['-x'])
if self.test_verbose:
self.test_args.extend(['-v'])
if self.test_quiet:
self.test_args.extend(['-q'])
if self.junitxml is not None:
self.test_args.extend(['--junitxml', self.junitxml])
if self.pdb:
self.test_args.extend(['--pdb'])
self.test_suite = True
if 'ICE_CONFIG' not in os.environ:
os.environ['ICE_CONFIG'] = self.test_ice_config
def run_tests(self):
if self.test_pythonpath is not None:
sys.path.insert(0, self.test_pythonpath)
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
version = '5.7.2.dev0'
url = "https://github.com/ome/omero-scripts/"
setup(
version=version,
name='omero-scripts',
packages=[
'omero.analysis_scripts',
'omero.annotation_scripts',
'omero.export_scripts',
'omero.figure_scripts',
'omero.import_scripts',
'omero.util_scripts'],
description="OMERO scripts",
long_description=read('README.rst'),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Plugins',
'Intended Audience :: Developers',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License v2 '
'or later (GPLv2+)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules'
], # Get strings from
# http://pypi.python.org/pypi?%3Aaction=list_classifiers
author='The Open Microscopy Team',
author_email='[email protected]',
license='GPL-2.0+',
url='%s' % url,
zip_safe=False,
download_url='%s' % url,
cmdclass={'test': PyTest},
python_requires='>=3',
tests_require=['pytest'],
)