-
Notifications
You must be signed in to change notification settings - Fork 16
/
setup.py
88 lines (70 loc) · 2.53 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
from glob import glob
import os
from setuptools import setup, find_packages
import sys
tests_require = ["selenium < 4", "werkzeug"]
if sys.version_info < (3, 3):
tests_require.append("mock")
driver_verification_tests_require = [
"flaky",
"flask",
"py",
"pytest ~= 3.0, != 3.3.*, < 3.7",
"werkzeug"]
if sys.version_info < (3, 3):
driver_verification_tests_require.append("mock")
tests_require += driver_verification_tests_require
def read(filename):
"""
Returns the contents of the given package file.
Args:
filename (str): The name of the file to read, relative to the current
directory.
Returns:
str: The contents of the given package file.
"""
path = os.path.join(os.path.dirname(__file__), filename)
with open(path) as f:
return f.read()
def get_version():
""" str: The package version. """
global_vars = {}
# Compile and execute the individual file to prevent
# the package from being automatically loaded.
source = read(os.path.join("capybara", "version.py"))
code = compile(source, "version.py", "exec")
exec(code, global_vars)
return global_vars['__version__']
setup(
name="capybara-py",
version=get_version(),
description="Acceptance test framework for web applications",
long_description=read("README.rst"),
url="https://github.com/elliterate/capybara.py",
author="Ian Lesperance",
author_email="ian@elliterate.com",
license="MIT",
keywords="capybara",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.5",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing"],
packages=find_packages(exclude=["tests", "tests.*"]),
data_files=(
glob("capybara/tests/app/static/*") +
glob("capybara/tests/app/templates/*") +
glob("capybara/tests/fixtures/*")),
install_requires=["cssselect", "lxml", "xpath-py ~= 0.1.2"],
setup_requires=["pytest-runner"],
tests_require=tests_require,
extras_require={
"development": ["bumpversion", "Sphinx"],
# Expose test dependencies for external scripts, like pip.
"test": tests_require})