summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2021-01-28 22:07:40 -0500
committerGitHub <noreply@github.com>2021-01-28 22:07:40 -0500
commit72d66bb1250518a588cd254a59655b28fd204731 (patch)
treefd79cf2104eafeb7f357491b8bb2ef54b0a8484c
parent6210d23662b2cf45f837f01697beb61eef42eabf (diff)
parentc7d0efc41dc5ec215ec6833e646397e232700f71 (diff)
downloadcmd2-git-72d66bb1250518a588cd254a59655b28fd204731.tar.gz
Merge branch 'master' into pr/docs/md/brokenlink
-rw-r--r--Pipfile3
-rw-r--r--cmd2/rl_utils.py4
-rw-r--r--docs/features/commands.rst4
-rw-r--r--docs/overview/integrating.rst9
-rwxr-xr-xsetup.py5
5 files changed, 15 insertions, 10 deletions
diff --git a/Pipfile b/Pipfile
index b384709c..bfa222b6 100644
--- a/Pipfile
+++ b/Pipfile
@@ -22,7 +22,8 @@ ipython = "*"
isort = "*"
mock = {version = "*",markers = "python_version < '3.6'"}
plumbum = "*"
-pyreadline = {version = "*",sys_platform = "== 'win32'"}
+pyreadline = {version = "*",sys_platform = "== 'win32'",markers = "python_version < '3.8'"}
+pyreadline3 = {version = "*",sys_platform = "== 'win32'",markers = "python_version >= '3.8'"}
pytest = "*"
pytest-cov = "*"
pytest-mock = "*"
diff --git a/cmd2/rl_utils.py b/cmd2/rl_utils.py
index e435c3f5..ca75fd8a 100644
--- a/cmd2/rl_utils.py
+++ b/cmd2/rl_utils.py
@@ -37,8 +37,8 @@ vt100_support = False
# Explanation for why readline wasn't loaded
_rl_warn_reason = ''
-# The order of this check matters since importing pyreadline will also show readline in the modules list
-if 'pyreadline' in sys.modules:
+# The order of this check matters since importing pyreadline/pyreadline3 will also show readline in the modules list
+if 'pyreadline' in sys.modules or 'pyreadline3' in sys.modules:
rl_type = RlType.PYREADLINE
from ctypes import byref
diff --git a/docs/features/commands.rst b/docs/features/commands.rst
index 8e61a472..cc603f70 100644
--- a/docs/features/commands.rst
+++ b/docs/features/commands.rst
@@ -127,7 +127,7 @@ without errors), and that ``cmd2`` should prompt the user for more input.
If you return ``True`` from a command method, that indicates to ``cmd2`` that
it should stop prompting for user input and cleanly exit. ``cmd2`` already
includes a ``quit`` command, but if you wanted to make another one called
-``finis`` you could::
+``finish`` you could::
def do_finish(self, line):
"""Exit the application"""
@@ -156,7 +156,7 @@ system shell::
"""A simple cmd2 application."""
def do_bail(self, line):
- """Exit the application""
+ """Exit the application"""
self.perror("fatal error, exiting")
self.exit_code = 2
return true
diff --git a/docs/overview/integrating.rst b/docs/overview/integrating.rst
index db5cb206..041083bc 100644
--- a/docs/overview/integrating.rst
+++ b/docs/overview/integrating.rst
@@ -26,10 +26,13 @@ Windows Considerations
If you would like to use :ref:`features/completion:Completion`, and you want
your application to run on Windows, you will need to ensure you install the
-``pyreadline`` package. Make sure to include the following in your
-``setup.py``::
+``pyreadline3`` or ``pyreadline`` package. Make sure to include the following
+in your ``setup.py``::
install_requires=[
'cmd2>=1,<2',
- ":sys_platform=='win32'": ['pyreadline'],
+ ":sys_platform=='win32'": [
+ "pyreadline ; python_version<'3.8'",
+ "pyreadline3 ; python_version>='3.8'", # pyreadline3 is a drop-in replacement for Python 3.8 and above
+ ],
]
diff --git a/setup.py b/setup.py
index 5e2995a9..6b438b13 100755
--- a/setup.py
+++ b/setup.py
@@ -44,8 +44,9 @@ INSTALL_REQUIRES = [
]
EXTRAS_REQUIRE = {
- # Windows also requires pyreadline to ensure tab completion works
- ":sys_platform=='win32'": ['pyreadline'],
+ # Windows also requires pyreadline or the replacement, pyreadline3, to ensure tab completion works
+ ":sys_platform=='win32' and python_version<'3.8'": ["pyreadline"],
+ ":sys_platform=='win32' and python_version>='3.8'": ["pyreadline3"],
# Extra dependencies for running unit tests
'test': [
"gnureadline; sys_platform=='darwin'", # include gnureadline on macOS to ensure it is available in nox env