summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-01-22 00:08:27 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2018-01-22 00:08:27 -0500
commitf28c10a50535f753419bd2120ac6cb0bea9f56e2 (patch)
tree102b200c4a3dff1adad4bf326ea3f6de9cd56baf /setup.py
parentc9f7c012bda012b4df7a8c5e853bd5d3e6d99b1b (diff)
downloadcmd2-git-f28c10a50535f753419bd2120ac6cb0bea9f56e2.tar.gz
help command temporarily redirects sys.stdout and sys.stderr to self.stdout for argparse commands
In order to make "help" behave more consistently for decorated and undecorated commands, argparse output is temporarily redirected to self.stdout. So doing "help history" is similar to "help load". However, when using the "-h" with argparse commands without using the "help" command, the output from argparse isn't redirected to self.stdout. Fixing this would be rather difficult and would essentially involve creating a pyparsing rule to detect it at the parser level.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index f56555db..aea5ab92 100755
--- a/setup.py
+++ b/setup.py
@@ -62,9 +62,15 @@ Topic :: Software Development :: Libraries :: Python Modules
""".splitlines())))
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 2.7 also requires contextlib2 for temporarily redirecting stdout and stderr and subprocess32
+if sys.version_info < (3, 0):
+ INSTALL_REQUIRES += ['contextlib2', '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']
DOCS_REQUIRE = ['sphinx', 'sphinx_rtd_theme', 'pyparsing', 'pyperclip', 'six']