From 4a7b5adbaedb30c34e3a8ff703cb2669fc0f9f79 Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Wed, 29 Apr 2020 12:38:33 +0900 Subject: [PATCH] relax version pins in setup.py for non-Py2 users --- setup.py | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 684c0dcea..05ae661d2 100755 --- a/setup.py +++ b/setup.py @@ -8,6 +8,8 @@ import setuptools from setuptools import setup, find_packages import sys +PY2 = sys.version_info[0] == 2 + # Borrowed from pip at https://github.com/pypa/pip/blob/62c27dee45625e1b63d1e023b0656310f276e050/setup.py#L11-L15 here = os.path.abspath(os.path.dirname(__file__)) @@ -28,8 +30,6 @@ def get_version(): install_requires = [ - "setuptools==44.0.0", - "Jinja2<3.0.0,>=2.10.1", "boto>=2.36.0", "boto3>=1.9.201", "botocore>=1.12.201", @@ -42,18 +42,40 @@ install_requires = [ "pytz", "python-dateutil<3.0.0,>=2.1", "python-jose<4.0.0", - "mock<=3.0.5", "docker>=2.5.1", "jsondiff>=1.1.2", "aws-xray-sdk!=0.96,>=0.93", "responses>=0.9.0", "idna<3,>=2.5", "cfn-lint>=0.4.0", - "sshpubkeys>=3.1.0,<4.0", - "zipp==0.6.0", - "more-itertools==5.0.0" ] +# +# 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 += [ + "Jinja2<3.0.0,>=2.10.1", + "mock<=3.0.5", + "more-itertools==5.0.0", + "setuptools==44.0.0", + "sshpubkeys>=3.1.0,<4.0", + "zipp==0.6.0", + ] +else: + install_requires += [ + "Jinja2>=2.10.1", + "mock", + "more-itertools", + "setuptools", + "sshpubkeys>=3.1.0", + "zipp", + ] + extras_require = { 'server': ['flask'], }