File tree Expand file tree Collapse file tree 4 files changed +13
-8
lines changed
Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ ipython = "*"
2222isort = " *"
2323mock = {version = " *" ,markers = " python_version < '3.6'" }
2424plumbum = " *"
25- pyreadline = {version = " *" ,sys_platform = " == 'win32'" }
25+ pyreadline = {version = " *" ,sys_platform = " == 'win32'" ,markers = " python_version < '3.8'" }
26+ pyreadline3 = {version = " *" ,sys_platform = " == 'win32'" ,markers = " python_version >= '3.8'" }
2627pytest = " *"
2728pytest-cov = " *"
2829pytest-mock = " *"
Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ class RlType(Enum):
3737# Explanation for why readline wasn't loaded
3838_rl_warn_reason = ''
3939
40- # The order of this check matters since importing pyreadline will also show readline in the modules list
41- if 'pyreadline' in sys .modules :
40+ # The order of this check matters since importing pyreadline/pyreadline3 will also show readline in the modules list
41+ if 'pyreadline' in sys .modules or 'pyreadline3' in sys . modules :
4242 rl_type = RlType .PYREADLINE
4343
4444 from ctypes import byref
Original file line number Diff line number Diff line change @@ -26,10 +26,13 @@ Windows Considerations
2626
2727If you would like to use :ref: `features/completion:Completion `, and you want
2828your application to run on Windows, you will need to ensure you install the
29- ``pyreadline `` package. Make sure to include the following in your
30- ``setup.py ``::
29+ ``pyreadline3 `` or `` pyreadline `` package. Make sure to include the following
30+ in your ``setup.py ``::
3131
3232 install_requires=[
3333 'cmd2>=1,<2',
34- ":sys_platform=='win32'": ['pyreadline'],
34+ ":sys_platform=='win32'": [
35+ "pyreadline ; python_version<'3.8'",
36+ "pyreadline3 ; python_version>='3.8'", # pyreadline3 is a drop-in replacement for Python 3.8 and above
37+ ],
3538 ]
Original file line number Diff line number Diff line change 4444]
4545
4646EXTRAS_REQUIRE = {
47- # Windows also requires pyreadline to ensure tab completion works
48- ":sys_platform=='win32'" : ['pyreadline' ],
47+ # Windows also requires pyreadline or the replacement, pyreadline3, to ensure tab completion works
48+ ":sys_platform=='win32' and python_version<'3.8'" : ["pyreadline" ],
49+ ":sys_platform=='win32' and python_version>='3.8'" : ["pyreadline3" ],
4950 # Extra dependencies for running unit tests
5051 'test' : [
5152 "gnureadline; sys_platform=='darwin'" , # include gnureadline on macOS to ensure it is available in nox env
You can’t perform that action at this time.
0 commit comments