summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-03-28 12:46:48 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-03-28 12:46:48 -0400
commit92ab77c0dcde350e0d9233d6987f83e812e14daa (patch)
tree181be122505ccd8f93185b0d4127adf70ce04e35
parentd78dc46a1a767427baa2b76215e235a7fec28b9a (diff)
parent28c89a543cba26c8cc8fc310b6b7b914d1660445 (diff)
downloadcmd2-git-92ab77c0dcde350e0d9233d6987f83e812e14daa.tar.gz
Merge branch 'master' into new_quoted_completion
-rwxr-xr-xsetup.py29
1 files changed, 19 insertions, 10 deletions
diff --git a/setup.py b/setup.py
index 4b31e5fe..44268767 100755
--- a/setup.py
+++ b/setup.py
@@ -4,6 +4,8 @@
Setuptools setup file, used to install or test 'cmd2'
"""
import sys
+
+import setuptools
from setuptools import setup
VERSION = '0.8.2'
@@ -64,17 +66,23 @@ Topic :: Software Development :: Libraries :: Python Modules
INSTALL_REQUIRES = ['pyparsing >= 2.0.1', 'pyperclip', 'six']
-# Windows also requires pyreadline to ensure tab completion works
-if sys.platform.startswith('win'):
- INSTALL_REQUIRES += ['pyreadline']
-
-# Python 3.4 and earlier require contextlib2 for temporarily redirecting stderr and stdout
-if sys.version_info < (3, 5):
- INSTALL_REQUIRES += ['contextlib2']
+EXTRAS_REQUIRE = {
+ # Windows also requires pyreadline to ensure tab completion works
+ ":sys_platform=='win32'": ['pyreadline'],
+ # Python 3.4 and earlier require contextlib2 for temporarily redirecting stderr and stdout
+ ":python_version<'3.5'": ['contextlib2'],
+ # Python 2.7 also requires subprocess32
+ ":python_version<'3.0'": ['subprocess32'],
+}
-# Python 2.7 also requires subprocess32
-if sys.version_info < (3, 0):
- INSTALL_REQUIRES += ['subprocess32']
+if int(setuptools.__version__.split('.')[0]) < 18:
+ EXTRAS_REQUIRE = {}
+ if sys.platform.startswith('win'):
+ INSTALL_REQUIRES.append('pyreadline')
+ if sys.version_info < (3, 5):
+ INSTALL_REQUIRES.append('contextlib2')
+ if sys.version_info < (3, 0):
+ INSTALL_REQUIRES.append('subprocess32')
# unittest.mock was added in Python 3.3. mock is a backport of unittest.mock to all versions of Python
TESTS_REQUIRE = ['mock', 'pytest', 'pytest-xdist']
@@ -94,5 +102,6 @@ setup(
py_modules=["cmd2"],
keywords='command prompt console cmd',
install_requires=INSTALL_REQUIRES,
+ extras_require=EXTRAS_REQUIRE,
tests_require=TESTS_REQUIRE,
)