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 = "*"
22
22
isort = " *"
23
23
mock = {version = " *" ,markers = " python_version < '3.6'" }
24
24
plumbum = " *"
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'" }
26
27
pytest = " *"
27
28
pytest-cov = " *"
28
29
pytest-mock = " *"
Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ class RlType(Enum):
37
37
# Explanation for why readline wasn't loaded
38
38
_rl_warn_reason = ''
39
39
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 :
42
42
rl_type = RlType .PYREADLINE
43
43
44
44
from ctypes import byref
Original file line number Diff line number Diff line change @@ -26,10 +26,13 @@ Windows Considerations
26
26
27
27
If you would like to use :ref: `features/completion:Completion `, and you want
28
28
your 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 ``::
31
31
32
32
install_requires=[
33
33
'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
+ ],
35
38
]
Original file line number Diff line number Diff line change 44
44
]
45
45
46
46
EXTRAS_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" ],
49
50
# Extra dependencies for running unit tests
50
51
'test' : [
51
52
"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