2013-02-18 21:09:40 +00:00
|
|
|
#!/usr/bin/env python
|
2014-08-27 15:17:06 +00:00
|
|
|
from __future__ import unicode_literals
|
2018-10-19 21:09:19 +00:00
|
|
|
import codecs
|
2020-02-29 09:41:06 +00:00
|
|
|
from io import open
|
2018-10-19 21:09:19 +00:00
|
|
|
import os
|
|
|
|
import re
|
2017-09-27 23:04:58 +00:00
|
|
|
import setuptools
|
2013-02-18 21:09:40 +00:00
|
|
|
from setuptools import setup, find_packages
|
2017-09-27 23:04:58 +00:00
|
|
|
import sys
|
|
|
|
|
2020-04-29 03:38:33 +00:00
|
|
|
PY2 = sys.version_info[0] == 2
|
|
|
|
|
2018-10-19 21:09:19 +00:00
|
|
|
# Borrowed from pip at https://github.com/pypa/pip/blob/62c27dee45625e1b63d1e023b0656310f276e050/setup.py#L11-L15
|
|
|
|
here = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
|
|
|
|
def read(*parts):
|
|
|
|
# intentionally *not* adding an encoding option to open, See:
|
|
|
|
# https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690
|
2020-02-29 09:41:06 +00:00
|
|
|
with open(os.path.join(here, *parts), 'r') as fp:
|
2018-10-19 21:09:19 +00:00
|
|
|
return fp.read()
|
|
|
|
|
|
|
|
|
2019-07-01 03:31:21 +00:00
|
|
|
def get_version():
|
|
|
|
version_file = read('moto', '__init__.py')
|
|
|
|
version_match = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]',
|
|
|
|
version_file, re.MULTILINE)
|
|
|
|
if version_match:
|
|
|
|
return version_match.group(1)
|
|
|
|
raise RuntimeError('Unable to find version string.')
|
|
|
|
|
|
|
|
|
2013-10-04 00:34:13 +00:00
|
|
|
install_requires = [
|
2016-03-18 19:12:24 +00:00
|
|
|
"boto>=2.36.0",
|
2019-07-29 23:36:57 +00:00
|
|
|
"boto3>=1.9.201",
|
|
|
|
"botocore>=1.12.201",
|
2017-08-17 14:34:03 +00:00
|
|
|
"requests>=2.5",
|
2014-09-10 15:23:12 +00:00
|
|
|
"xmltodict",
|
2017-09-07 18:30:46 +00:00
|
|
|
"six>1.9",
|
2014-09-10 15:23:12 +00:00
|
|
|
"werkzeug",
|
2016-10-18 23:47:02 +00:00
|
|
|
"pytz",
|
2020-01-31 20:49:10 +00:00
|
|
|
"python-dateutil<3.0.0,>=2.1",
|
2018-05-30 01:57:54 +00:00
|
|
|
"responses>=0.9.0",
|
2020-04-29 04:02:53 +00:00
|
|
|
"MarkupSafe<2.0", # This is a Jinja2 dependency, 2.0.0a1 currently seems broken
|
2013-10-04 00:34:13 +00:00
|
|
|
]
|
|
|
|
|
2020-04-29 03:38:33 +00:00
|
|
|
#
|
|
|
|
# Avoid pins where they are not necessary. These pins were introduced by the
|
|
|
|
# following commit for Py2 compatibility. They are not required for non-Py2
|
|
|
|
# users.
|
|
|
|
#
|
|
|
|
# https://github.com/mpenkov/moto/commit/00134d2df37bb4dcd5f447ef951d383bfec0903c
|
|
|
|
#
|
|
|
|
if PY2:
|
|
|
|
install_requires += [
|
2020-04-29 04:02:53 +00:00
|
|
|
#
|
|
|
|
# This is an indirect dependency. Version 5.0.0 claims to be for
|
|
|
|
# Py2.6+, but it really isn't.
|
|
|
|
#
|
|
|
|
# https://github.com/jaraco/configparser/issues/51
|
|
|
|
#
|
|
|
|
"configparser<5.0",
|
2020-04-29 03:38:33 +00:00
|
|
|
"Jinja2<3.0.0,>=2.10.1",
|
|
|
|
"mock<=3.0.5",
|
|
|
|
"more-itertools==5.0.0",
|
|
|
|
"setuptools==44.0.0",
|
|
|
|
"zipp==0.6.0",
|
|
|
|
]
|
|
|
|
else:
|
|
|
|
install_requires += [
|
|
|
|
"Jinja2>=2.10.1",
|
|
|
|
"mock",
|
|
|
|
"more-itertools",
|
|
|
|
"setuptools",
|
|
|
|
"zipp",
|
|
|
|
]
|
|
|
|
|
2019-07-27 10:52:23 +00:00
|
|
|
_dep_cryptography = "cryptography>=2.3.0"
|
|
|
|
_dep_PyYAML = "PyYAML>=5.1"
|
|
|
|
_dep_python_jose = "python-jose[cryptography]>=3.1.0,<4.0.0"
|
|
|
|
_dep_python_jose_ecdsa_pin = "ecdsa<0.15" # https://github.com/spulec/moto/pull/3263#discussion_r477404984
|
|
|
|
_dep_docker = "docker>=2.5.1"
|
|
|
|
_dep_jsondiff = "jsondiff>=1.1.2"
|
|
|
|
_dep_aws_xray_sdk = "aws-xray-sdk!=0.96,>=0.93"
|
|
|
|
_dep_idna = "idna<3,>=2.5"
|
|
|
|
_dep_cfn_lint = "cfn-lint>=0.4.0"
|
|
|
|
_dep_sshpubkeys_py2 = "sshpubkeys>=3.1.0,<4.0; python_version<'3'"
|
|
|
|
_dep_sshpubkeys_py3 = "sshpubkeys>=3.1.0; python_version>'3'"
|
|
|
|
|
|
|
|
all_extra_deps = [
|
|
|
|
_dep_cryptography,
|
|
|
|
_dep_PyYAML,
|
|
|
|
_dep_python_jose,
|
|
|
|
_dep_python_jose_ecdsa_pin,
|
|
|
|
_dep_docker,
|
|
|
|
_dep_jsondiff,
|
|
|
|
_dep_aws_xray_sdk,
|
|
|
|
_dep_idna,
|
|
|
|
_dep_cfn_lint,
|
|
|
|
_dep_sshpubkeys_py2,
|
|
|
|
_dep_sshpubkeys_py3,
|
|
|
|
]
|
2020-09-19 09:07:17 +00:00
|
|
|
all_server_deps = all_extra_deps + ['flask', 'flask-cors']
|
2019-07-27 10:52:23 +00:00
|
|
|
|
|
|
|
# TODO: do we want to add ALL services here?
|
|
|
|
# i.e. even those without extra dependencies.
|
|
|
|
# Would be good for future-compatibility, I guess.
|
|
|
|
extras_per_service = {
|
|
|
|
'acm': [_dep_cryptography],
|
|
|
|
'awslambda': [_dep_docker],
|
|
|
|
'batch': [_dep_docker],
|
2020-09-08 09:47:44 +00:00
|
|
|
'cloudformation': [_dep_PyYAML, _dep_cfn_lint],
|
|
|
|
'cognitoidp': [_dep_python_jose, _dep_python_jose_ecdsa_pin],
|
|
|
|
"ec2": [_dep_cryptography, _dep_sshpubkeys_py2, _dep_sshpubkeys_py3],
|
|
|
|
'iam': [_dep_cryptography],
|
2019-07-27 10:52:23 +00:00
|
|
|
'iotdata': [_dep_jsondiff],
|
2020-09-08 09:47:44 +00:00
|
|
|
's3': [_dep_cryptography],
|
2019-07-27 10:52:23 +00:00
|
|
|
'xray': [_dep_aws_xray_sdk],
|
|
|
|
}
|
|
|
|
|
2015-08-12 01:35:20 +00:00
|
|
|
extras_require = {
|
2019-07-27 10:52:23 +00:00
|
|
|
'all': all_extra_deps,
|
2020-09-08 09:47:44 +00:00
|
|
|
'server': all_server_deps,
|
2015-08-12 01:35:20 +00:00
|
|
|
}
|
2013-10-04 00:34:13 +00:00
|
|
|
|
2019-07-27 10:52:23 +00:00
|
|
|
extras_require.update(extras_per_service)
|
|
|
|
|
2017-09-27 23:04:58 +00:00
|
|
|
# https://hynek.me/articles/conditional-python-dependencies/
|
|
|
|
if int(setuptools.__version__.split(".", 1)[0]) < 18:
|
|
|
|
if sys.version_info[0:2] < (3, 3):
|
|
|
|
install_requires.append("backports.tempfile")
|
|
|
|
else:
|
|
|
|
extras_require[":python_version<'3.3'"] = ["backports.tempfile"]
|
|
|
|
|
|
|
|
|
2013-02-18 21:09:40 +00:00
|
|
|
setup(
|
|
|
|
name='moto',
|
2019-07-01 03:31:21 +00:00
|
|
|
version=get_version(),
|
2013-03-19 15:45:19 +00:00
|
|
|
description='A library that allows your python tests to easily'
|
2013-03-05 13:21:47 +00:00
|
|
|
' mock out the boto library',
|
2018-10-19 21:09:19 +00:00
|
|
|
long_description=read('README.md'),
|
|
|
|
long_description_content_type='text/markdown',
|
2013-02-18 21:09:40 +00:00
|
|
|
author='Steve Pulec',
|
2015-07-27 15:44:41 +00:00
|
|
|
author_email='spulec@gmail.com',
|
2013-02-18 21:09:40 +00:00
|
|
|
url='https://github.com/spulec/moto',
|
2013-03-05 13:14:43 +00:00
|
|
|
entry_points={
|
|
|
|
'console_scripts': [
|
|
|
|
'moto_server = moto.server:main',
|
|
|
|
],
|
|
|
|
},
|
2013-12-19 21:16:00 +00:00
|
|
|
packages=find_packages(exclude=("tests", "tests.*")),
|
2020-09-09 01:33:03 +00:00
|
|
|
# Addding all requirements for now until we cut a larger release
|
|
|
|
install_requires=install_requires + all_extra_deps,
|
2015-08-12 01:35:20 +00:00
|
|
|
extras_require=extras_require,
|
2017-09-27 21:33:52 +00:00
|
|
|
include_package_data=True,
|
2014-08-30 03:46:55 +00:00
|
|
|
license="Apache",
|
|
|
|
test_suite="tests",
|
|
|
|
classifiers=[
|
|
|
|
"Programming Language :: Python :: 2",
|
|
|
|
"Programming Language :: Python :: 2.7",
|
|
|
|
"Programming Language :: Python :: 3",
|
2017-09-27 23:04:58 +00:00
|
|
|
"Programming Language :: Python :: 3.5",
|
|
|
|
"Programming Language :: Python :: 3.6",
|
2018-10-19 21:17:26 +00:00
|
|
|
"Programming Language :: Python :: 3.7",
|
2020-04-20 07:19:24 +00:00
|
|
|
"Programming Language :: Python :: 3.8",
|
2014-08-30 03:46:55 +00:00
|
|
|
"License :: OSI Approved :: Apache Software License",
|
|
|
|
"Topic :: Software Development :: Testing",
|
|
|
|
],
|
2019-10-22 19:31:48 +00:00
|
|
|
project_urls={
|
|
|
|
"Documentation": "http://docs.getmoto.org/en/latest/",
|
|
|
|
},
|
2013-02-26 05:12:34 +00:00
|
|
|
)
|