-
Notifications
You must be signed in to change notification settings - Fork 15
/
setup.py
executable file
·136 lines (119 loc) · 4.59 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 University of Dundee & Open Microscopy Environment
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""
SCC distribution script
"""
from setuptools import setup
from setuptools.command.test import test as TestCommand
import os
import sys
class PyTest(TestCommand):
user_options = [
('test-path=', 't', "base dir for test collection"),
('test-pythonpath=', 'p', "prepend 'pythonpath' to PYTHONPATH"),
('test-string=', 'k', "only run tests including 'string'"),
('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-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):
TestCommand.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
def finalize_options(self):
TestCommand.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.test_no_capture:
self.test_args.extend(['-s'])
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
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
with open(os.path.join('scc', 'RELEASE-VERSION')) as version_file:
VERSION = version_file.read().strip()
LONG_DESCRIPTION = open("README.rst", "r").read()
CLASSIFIERS = ["Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v2"
" (GPLv2)",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Software Development :: Version Control"]
setup(name='scc',
# Simple strings
author='The Open Microscopy Team',
author_email='[email protected]',
description='OME tools for managing the git(hub) workflow',
license='GPLv2',
url='https://github.com/ome/scc',
# More complex variables
packages=['scc'],
include_package_data=True,
install_requires=['yaclifw>=0.2.0,<0.3',
'urllib3<2',
'PyGithub>=1.54',
'future',
'PyYAML>=5.1',
'six',
'ruamel.yaml',
'ruamel.yaml.jinja2'],
entry_points={'console_scripts': ['scc = scc.main:entry_point']},
zip_safe=True,
# Using global variables
long_description=LONG_DESCRIPTION,
classifiers=CLASSIFIERS,
version=VERSION,
python_requires=">=3.5",
cmdclass={'test': PyTest},
tests_require=[
'pytest<3.3',
'restview',
'mox3'
],
)