diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2021-01-28 20:47:43 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-28 20:47:43 -0500 |
commit | 8268401838167decd02c38f39bd94355333ab077 (patch) | |
tree | ea88de7a27c3b71ed1295e96b1c72f260d98747a | |
parent | a09ad27429e9bad2983db7f3ba4e7ab287459cab (diff) | |
parent | d5cebaef06719fdc01eba15e01fb70ef948e05c9 (diff) | |
download | cmd2-git-8268401838167decd02c38f39bd94355333ab077.tar.gz |
Merge branch 'master' into pr/doc/commands
-rw-r--r-- | Pipfile | 3 | ||||
-rw-r--r-- | cmd2/rl_utils.py | 4 | ||||
-rw-r--r-- | docs/overview/integrating.rst | 9 | ||||
-rwxr-xr-x | setup.py | 5 |
4 files changed, 13 insertions, 8 deletions
@@ -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/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 + ], ] @@ -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 |