forked from HypothesisWorks/hypothesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
123 lines (102 loc) · 4.17 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
# coding=utf-8
#
# This file is part of Hypothesis, which may be found at
# https://github.com/HypothesisWorks/hypothesis-python
#
# Most of this work is copyright (C) 2013-2018 David R. MacIver
# (david@drmaciver.com), but it contains contributions by others. See
# CONTRIBUTING.rst for a full list of people who may hold copyright, and
# consult the git log if you need to determine who owns an individual
# contribution.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
#
# END HEADER
from __future__ import division, print_function, absolute_import
import os
import sys
import warnings
import setuptools
def local_file(name):
return os.path.relpath(os.path.join(os.path.dirname(__file__), name))
SOURCE = local_file('src')
README = local_file('README.rst')
setuptools_version = tuple(map(int, setuptools.__version__.split('.')[:2]))
if setuptools_version < (36, 2):
# Warning only - very bad if uploading bdist but fine if installing sdist.
warnings.warn(
'This version of setuptools is too old to correctly store '
'conditional dependencies in binary wheels. For more info, see: '
'https://hynek.me/articles/conditional-python-dependencies/'
)
# Assignment to placate pyflakes. The actual version is from the exec that
# follows.
__version__ = None
with open(local_file('src/hypothesis/version.py')) as o:
exec(o.read())
assert __version__ is not None
# We only support the releases of Django that are supported by the Django
# core team. See https://www.djangoproject.com/download/#supported-versions
django_pin = 'django>=1.8'
if setuptools_version >= (8, 0):
# New versions of setuptools allow us to set very precise pins; older
# versions of setuptools are coarser. We special-case this so users with
# old tools can still install an sdist from PyPI.
django_pin += ',!=1.9.*,!=1.10.*'
extras = {
'datetime': ['pytz'],
'pytz': ['pytz'],
'fakefactory': ['Faker>=0.7'],
'numpy': ['numpy>=1.9.0'],
'pytest': ['pytest>=2.8.0'],
'django': ['pytz', django_pin],
}
extras['faker'] = extras['fakefactory']
extras['all'] = sorted(sum(extras.values(), []))
install_requires = ['attrs>=16.0.0', 'coverage']
# Using an environment marker on enum34 makes the dependency condition
# independent of the build environemnt, which is important for wheels.
# https://www.python.org/dev/peps/pep-0345/#environment-markers
if sys.version_info[0] < 3 and setuptools_version < (8, 0):
# Except really old systems, where we give up and install unconditionally
install_requires.append('enum34')
else:
install_requires.append('enum34; python_version=="2.7"')
setuptools.setup(
name='hypothesis',
version=__version__,
author='David R. MacIver',
author_email='david@drmaciver.com',
packages=setuptools.find_packages(SOURCE),
package_dir={'': SOURCE},
url='https://github.com/HypothesisWorks/hypothesis-python',
license='MPL v2',
description='A library for property based testing',
zip_safe=False,
extras_require=extras,
install_requires=install_requires,
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Operating System :: Unix',
'Operating System :: POSIX',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Testing',
],
entry_points={
'pytest11': ['hypothesispytest = hypothesis.extra.pytestplugin'],
},
long_description=open(README).read(),
)