moto/setup.py

163 lines
5.4 KiB
Python
Raw Normal View History

2013-02-18 21:09:40 +00:00
#!/usr/bin/env python
from io import open
import os
import re
2013-02-18 21:09:40 +00:00
from setuptools import setup, find_packages
import moto.__init__ as service_list
lambda + SNS enhancements (#1048) * updates - support lambda messages from SNS - run lambda in docker container * decode output * populate timeout * simplify * whoops * skeletons of cloudwatchlogs * impl filter log streams * fix logging * PEP fixes * PEP fixes * fix reset * fix reset * add new endpoint * fix region name * add docker * try to fix tests * try to fix travis issue with boto * fix escaping in urls * fix environment variables * fix PEP * more pep * switch back to precise * another fix attempt * fix typo * fix lambda invoke * fix more unittests * work on getting this to work in new scheme * fix py2 * fix error * fix tests when running in server mode * more lambda fixes * try running with latest docker adapted from aiodocker * switch to docker python client * pep fixes * switch to docker volume * fix unittest * fix invoke from sns * fix zip2tar * add hack impl for get_function with zip * try fix * fix for py < 3.6 * add volume refcount * try to fix travis * docker test * fix yaml * try fix * update endpoints * fix * another attempt * try again * fix recursive import * refactor fix * revert changes with better fix * more reverts * wait for service to come up * add back detached mode * sleep and add another exception type * put this back for logging * put back with note * whoops :) * docker in docker! * fix invalid url * hopefully last fix! * fix lambda regions * fix protocol * travis!!!! * just run lambda test for now * use one print * fix escaping * another attempt * yet another * re-enable all tests * fixes * fix for py2 * revert change * fix for py2.7 * fix output ordering * remove this given there's a new unittest that covers it * changes based on review - add skeleton logs test file - switch to docker image that matches test env - fix mock_logs import * add readme entry
2017-09-27 23:04:58 +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__))
2020-10-06 06:46:05 +00:00
def read(*parts):
# intentionally *not* adding an encoding option to open, See:
# https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690
2020-10-06 06:46:05 +00:00
with open(os.path.join(here, *parts), "r") as fp:
return fp.read()
2019-07-01 03:31:21 +00:00
def get_version():
2020-10-06 06:46:05 +00:00
version_file = read("moto", "__init__.py")
version_match = re.search(
r'^__version__ = [\'"]([^\'"]*)[\'"]', version_file, re.MULTILINE
)
2019-07-01 03:31:21 +00:00
if version_match:
return version_match.group(1)
2020-10-06 06:46:05 +00:00
raise RuntimeError("Unable to find version string.")
2019-07-01 03:31:21 +00:00
2013-10-04 00:34:13 +00:00
install_requires = [
"boto3>=1.9.201",
"botocore>=1.12.201",
"cryptography>=3.3.1",
"requests>=2.5",
"xmltodict",
2022-05-28 09:34:23 +00:00
"werkzeug>=0.5",
"pytz",
"python-dateutil<3.0.0,>=2.1",
"responses>=0.9.0",
"MarkupSafe!=2.0.0a1", # This is a Jinja2 dependency, 2.0.0a1 currently seems broken
"Jinja2>=2.10.1",
"importlib_metadata ; python_version < '3.8'",
]
_dep_PyYAML = "PyYAML>=5.1"
2021-07-26 06:40:39 +00:00
_dep_python_jose = "python-jose[cryptography]>=3.1.0,<4.0.0"
2020-10-06 06:46:05 +00:00
_dep_python_jose_ecdsa_pin = (
"ecdsa!=0.15" # https://github.com/spulec/moto/pull/3263#discussion_r477404984
2020-10-06 06:46:05 +00:00
)
_dep_dataclasses = "dataclasses; python_version < '3.7'"
_dep_docker = "docker>=2.5.1"
_dep_graphql = "graphql-core"
_dep_jsondiff = "jsondiff>=1.1.2"
_dep_aws_xray_sdk = "aws-xray-sdk!=0.96,>=0.93"
_dep_idna = "idna<4,>=2.5"
_dep_cfn_lint = "cfn-lint>=0.4.0"
2021-07-26 06:40:39 +00:00
_dep_sshpubkeys = "sshpubkeys>=3.1.0"
_dep_openapi = "openapi-spec-validator>=0.2.8"
_dep_pyparsing = "pyparsing>=3.0.7"
2021-08-05 16:59:25 +00:00
_setuptools = "setuptools"
all_extra_deps = [
_dep_PyYAML,
2021-07-26 06:40:39 +00:00
_dep_python_jose,
_dep_python_jose_ecdsa_pin,
_dep_docker,
_dep_graphql,
_dep_jsondiff,
_dep_aws_xray_sdk,
_dep_idna,
_dep_cfn_lint,
2021-07-26 06:40:39 +00:00
_dep_sshpubkeys,
_dep_pyparsing,
_dep_openapi,
2021-08-05 16:59:25 +00:00
_setuptools,
]
all_server_deps = all_extra_deps + ["flask", "flask-cors"]
extras_per_service = {}
for service_name in [
2021-11-14 12:30:27 +00:00
service[5:]
for service in dir(service_list)
if service.startswith("mock_") and not service == "mock_all"
]:
extras_per_service[service_name] = []
extras_per_service.update(
{
"apigateway": [_dep_PyYAML, _dep_python_jose, _dep_python_jose_ecdsa_pin, _dep_openapi],
2022-02-08 21:12:51 +00:00
"apigatewayv2": [_dep_PyYAML],
"appsync": [_dep_graphql],
"awslambda": [_dep_docker],
"batch": [_dep_docker],
"cognitoidp": [_dep_python_jose, _dep_python_jose_ecdsa_pin],
"ec2": [_dep_sshpubkeys],
"glue": [_dep_pyparsing],
"iotdata": [_dep_jsondiff],
"s3": [_dep_PyYAML],
"ses": [],
"sns": [],
"sqs": [],
"ssm": [_dep_PyYAML, _dep_dataclasses],
# XRay module uses pkg_resources, but doesn't have an explicit
# dependency listed. This should be fixed in the next version:
# https://github.com/aws/aws-xray-sdk-python/issues/305
"xray": [_dep_aws_xray_sdk, _setuptools],
}
)
# When a Table has a Stream, we'll always need to import AWSLambda to search for a corresponding function to send the table data to
extras_per_service["dynamodb"] = extras_per_service["awslambda"]
extras_per_service["dynamodb2"] = extras_per_service["dynamodb"]
extras_per_service["dynamodbstreams"] = extras_per_service["awslambda"]
2022-05-07 21:11:32 +00:00
# EBS depends on EC2 to create snapshots
extras_per_service["ebs"] = extras_per_service["ec2"]
# EFS depends on EC2 to find subnets etc
extras_per_service["efs"] = extras_per_service["ec2"]
# DirectoryService needs EC2 to verify VPCs and subnets.
extras_per_service["ds"] = extras_per_service["ec2"]
extras_per_service["route53resolver"] = extras_per_service["ec2"]
# CloudFormation imports everything, so install everything
extras_per_service["cloudformation"] = all_extra_deps
extras_require = {
2020-10-06 06:46:05 +00:00
"all": all_extra_deps,
"server": all_server_deps,
}
2013-10-04 00:34:13 +00:00
extras_require.update(extras_per_service)
lambda + SNS enhancements (#1048) * updates - support lambda messages from SNS - run lambda in docker container * decode output * populate timeout * simplify * whoops * skeletons of cloudwatchlogs * impl filter log streams * fix logging * PEP fixes * PEP fixes * fix reset * fix reset * add new endpoint * fix region name * add docker * try to fix tests * try to fix travis issue with boto * fix escaping in urls * fix environment variables * fix PEP * more pep * switch back to precise * another fix attempt * fix typo * fix lambda invoke * fix more unittests * work on getting this to work in new scheme * fix py2 * fix error * fix tests when running in server mode * more lambda fixes * try running with latest docker adapted from aiodocker * switch to docker python client * pep fixes * switch to docker volume * fix unittest * fix invoke from sns * fix zip2tar * add hack impl for get_function with zip * try fix * fix for py < 3.6 * add volume refcount * try to fix travis * docker test * fix yaml * try fix * update endpoints * fix * another attempt * try again * fix recursive import * refactor fix * revert changes with better fix * more reverts * wait for service to come up * add back detached mode * sleep and add another exception type * put this back for logging * put back with note * whoops :) * docker in docker! * fix invalid url * hopefully last fix! * fix lambda regions * fix protocol * travis!!!! * just run lambda test for now * use one print * fix escaping * another attempt * yet another * re-enable all tests * fixes * fix for py2 * revert change * fix for py2.7 * fix output ordering * remove this given there's a new unittest that covers it * changes based on review - add skeleton logs test file - switch to docker image that matches test env - fix mock_logs import * add readme entry
2017-09-27 23:04:58 +00:00
2013-02-18 21:09:40 +00:00
setup(
2020-10-06 06:46:05 +00:00
name="moto",
2019-07-01 03:31:21 +00:00
version=get_version(),
2020-10-06 06:46:05 +00:00
description="A library that allows your python tests to easily"
" mock out the boto library",
long_description=read("README.md"),
long_description_content_type="text/markdown",
author="Steve Pulec",
author_email="spulec@gmail.com",
url="https://github.com/spulec/moto",
entry_points={"console_scripts": ["moto_server = moto.server:main"]},
2013-12-19 21:16:00 +00:00
packages=find_packages(exclude=("tests", "tests.*")),
python_requires=">=3.6",
install_requires=install_requires,
extras_require=extras_require,
2017-09-27 21:33:52 +00:00
include_package_data=True,
license="Apache",
test_suite="tests",
classifiers=[
"Programming Language :: Python :: 3",
lambda + SNS enhancements (#1048) * updates - support lambda messages from SNS - run lambda in docker container * decode output * populate timeout * simplify * whoops * skeletons of cloudwatchlogs * impl filter log streams * fix logging * PEP fixes * PEP fixes * fix reset * fix reset * add new endpoint * fix region name * add docker * try to fix tests * try to fix travis issue with boto * fix escaping in urls * fix environment variables * fix PEP * more pep * switch back to precise * another fix attempt * fix typo * fix lambda invoke * fix more unittests * work on getting this to work in new scheme * fix py2 * fix error * fix tests when running in server mode * more lambda fixes * try running with latest docker adapted from aiodocker * switch to docker python client * pep fixes * switch to docker volume * fix unittest * fix invoke from sns * fix zip2tar * add hack impl for get_function with zip * try fix * fix for py < 3.6 * add volume refcount * try to fix travis * docker test * fix yaml * try fix * update endpoints * fix * another attempt * try again * fix recursive import * refactor fix * revert changes with better fix * more reverts * wait for service to come up * add back detached mode * sleep and add another exception type * put this back for logging * put back with note * whoops :) * docker in docker! * fix invalid url * hopefully last fix! * fix lambda regions * fix protocol * travis!!!! * just run lambda test for now * use one print * fix escaping * another attempt * yet another * re-enable all tests * fixes * fix for py2 * revert change * fix for py2.7 * fix output ordering * remove this given there's a new unittest that covers it * changes based on review - add skeleton logs test file - switch to docker image that matches test env - fix mock_logs import * add readme entry
2017-09-27 23:04:58 +00:00
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
2020-04-20 07:19:24 +00:00
"Programming Language :: Python :: 3.8",
2021-08-22 10:33:16 +00:00
"Programming Language :: Python :: 3.9",
2022-01-18 21:52:47 +00:00
"Programming Language :: Python :: 3.10",
"License :: OSI Approved :: Apache Software License",
"Topic :: Software Development :: Testing",
],
project_urls={
"Documentation": "http://docs.getmoto.org/en/latest/",
"Issue tracker": "https://github.com/spulec/moto/issues",
"Changelog": "https://github.com/spulec/moto/blob/master/CHANGELOG.md"
},
2013-02-26 05:12:34 +00:00
)