Skip to content

Commit f8b2407

Browse files
authored
Merge branch 'master' into header_tabs
2 parents 188f251 + b329218 commit f8b2407

File tree

6 files changed

+16
-11
lines changed

6 files changed

+16
-11
lines changed

Pipfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ ipython = "*"
2222
isort = "*"
2323
mock = {version = "*",markers = "python_version < '3.6'"}
2424
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'"}
2627
pytest = "*"
2728
pytest-cov = "*"
2829
pytest-mock = "*"

cmd2/rl_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

docs/features/commands.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ without errors), and that ``cmd2`` should prompt the user for more input.
127127
If you return ``True`` from a command method, that indicates to ``cmd2`` that
128128
it should stop prompting for user input and cleanly exit. ``cmd2`` already
129129
includes a ``quit`` command, but if you wanted to make another one called
130-
``finis`` you could::
130+
``finish`` you could::
131131

132132
def do_finish(self, line):
133133
"""Exit the application"""
@@ -156,7 +156,7 @@ system shell::
156156
"""A simple cmd2 application."""
157157

158158
def do_bail(self, line):
159-
"""Exit the application""
159+
"""Exit the application"""
160160
self.perror("fatal error, exiting")
161161
self.exit_code = 2
162162
return true

docs/features/modular_commands.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Features
2929

3030
See API documentation for :attr:`cmd2.command_definition.CommandSet`
3131

32-
See the examples for more details: https://github.com/python-cmd2/cmd2/tree/master/plugins/command_sets/examples
32+
See [the examples](https://github.com/python-cmd2/cmd2/tree/master/examples/modular_commands) for more details.
3333

3434

3535
Defining Commands

docs/overview/integrating.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,13 @@ Windows Considerations
2626

2727
If you would like to use :ref:`features/completion:Completion`, and you want
2828
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``::
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
]

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@
4444
]
4545

4646
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"],
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

0 commit comments

Comments
 (0)