-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
90 lines (79 loc) · 2.66 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
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# >>
# vivint-selenium-docker, 2017
#
# Additional selenium drivers that utilize docker containers for their UI
#
# Blake VandeMerwe
# <<
import re
import sys
from os.path import dirname, join as pjoin
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
ATTRIBUTES = re.compile(r"^__(\w+)__\s+=\s+'(.*?)'$", re.S + re.M)
dname = dirname(__file__)
with open(pjoin(dname, 'selenium_docker', '__init__.py')) as ins_file:
text = ins_file.read()
attrs = ATTRIBUTES.findall(text)
A = dict(attrs)
with open(pjoin(dname, 'requirements.txt')) as ins_file:
requirements = map(str.strip, ins_file.readlines())
class RunTests(TestCommand):
"""
Run the unit tests.
By default, `python setup.py test` fails if tests/ isn't a Python
module (that is, if the tests/ directory doesn't contain an
__init__.py file). But the tests/ directory shouldn't contain an
__init__.py file and tests/ shouldn't be a Python module. See
http://doc.pytest.org/en/latest/goodpractices.html
Running the unit tests manually here enables `python setup.py test`
without tests/ being a Python module.
"""
def run_tests(self):
from unittest import TestLoader, TextTestRunner
tests_dir = pjoin(dirname(__file__), 'tests')
suite = TestLoader().discover(tests_dir)
result = TextTestRunner().run(suite)
sys.exit(0 if result.wasSuccessful() else -1)
long_description = (
'Information and documentation found can be found'
' at %s' % A['url'])
setup(
name='selenium-docker',
version=A['version'],
author=A['author'],
author_email=A['contact'],
url=A['url'],
description='Additional selenium drivers that utilize docker containers for their UI.',
long_description=long_description,
packages=find_packages(),
include_package_data=True,
platforms=['any'],
install_requires=list(requirements),
extras_require={
'dev': [
'pytest',
'pytest-cov',
'sphinx',
'sphinx-rtd-theme',
'tox'
]
},
cmdclass={
'test': RunTests
},
classifiers=[
'Topic :: Software Development :: Libraries',
'Natural Language :: English',
'License :: OSI Approved :: Apache Software License',
'Intended Audience :: Developers',
'Development Status :: 4 - Beta',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6'
]
)