-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
106 lines (90 loc) · 3.77 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
import sys, os
from setuptools import setup
from setuptools.command.test import test as TestCommand
PROJECT_ROOT, _ = os.path.split(__file__)
PROJECT_NAME = 'jenkinsflow'
COPYRIGHT = u"Copyright (c) 2012 - 2015 Lars Hupfeldt Nielsen, Hupfeldt IT"
PROJECT_AUTHORS = u"Lars Hupfeldt Nielsen"
PROJECT_EMAILS = 'lhn@hupfeldtit.dk'
PROJECT_URL = "https://github.com/lhupfeldt/jenkinsflow"
SHORT_DESCRIPTION = 'Python API with high level build flow constructs (parallel/serial) for Jenkins (and Hudson).'
LONG_DESCRIPTION = open(os.path.join(PROJECT_ROOT, "README.rst")).read()
on_rtd = os.environ.get('READTHEDOCS') == 'True'
is_ci = os.environ.get('CI', 'false').lower() == 'true'
_here = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(_here, 'py_version_check.py')) as ff:
exec(ff.read())
class Test(TestCommand):
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import test.run
if is_ci:
print("Running under CI")
# Note 'mock' is also hardcoded in .travis.yml
sys.exit(test.run.cli(apis='mock,script', mock_speedup=10))
sys.exit(test.run.cli(apis='mock,script'))
flow_requires = ['atomicfile>=1.0,<=2.0']
cli_requires = ['click>=6.0']
job_load_requires = ['tenjin>=1.1.1']
jenkins_api_requires = ['requests>=2.20,<=3.0']
# You need to install python(3)-devel to be be able to install psutil, see INSTALL.md
script_api_requires = ['psutil>=5.6.6', 'setproctitle>=1.1.10']
visual_requires = ['bottle>=0.12.1']
if not on_rtd:
install_requires = flow_requires + cli_requires + job_load_requires + jenkins_api_requires + script_api_requires + visual_requires
else:
install_requires = flow_requires + cli_requires + jenkins_api_requires + script_api_requires
tests_require = [
'pytest>=5.3.5,<5.4', 'pytest-cov>=2.4.0,<3', 'pytest-instafail>=0.3.0', 'pytest-xdist>=1.16,<2',
'click>=6.0', 'tenjin>=1.1.1', 'bottle>=0.12', 'objproxies>=0.9.4',
# The test also tests creation of the documentation
'sphinx>=2.2.1', 'sphinxcontrib-programoutput>=0.13',
]
extras = {
'test': tests_require,
}
if __name__ == "__main__":
setup(
name=PROJECT_NAME.lower(),
version_command=('git describe', 'pep440-git'),
author=PROJECT_AUTHORS,
author_email=PROJECT_EMAILS,
packages=['jenkinsflow', 'jenkinsflow.utils', 'jenkinsflow.cli'],
package_dir={'jenkinsflow':'.', 'jenkinsflow.utils': 'utils', 'jenkinsflow.cli': 'cli'},
zip_safe=True,
include_package_data=False,
python_requires='>=3.6.0',
install_requires=install_requires,
setup_requires='setuptools-version-command>=2.2',
test_suite='test',
tests_require=tests_require,
extras_require=extras,
cmdclass={'test': Test},
url=PROJECT_URL,
description=SHORT_DESCRIPTION,
long_description=LONG_DESCRIPTION,
long_description_content_type='text/x-rst',
license='BSD',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
# 'Programming Language :: Python :: 3.8',
'Topic :: Software Development :: Testing',
],
entry_points='''
[console_scripts]
jenkinsflow=jenkinsflow.cli.cli:cli
''',
)