🐛 Ensure rich_markup_mode=None
disables Rich formatting
#859
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is an alternative to #726.
First, it fixes the bug described in #853, namely that
does not actually disable Rich formatting on the current
master
, when Rich is installed. This is because many of the methods incore.py
only check whetherrich
is available before calling the functions inrich_utils.py
. Instead, the value ofrich_markup_mode
should be checked as well, as in in PR #726 and as in this PR.However, when we do that, we effectively make
None
the default value, even when Rich is installed. This aligns with the current documentation:However, one could argue that this behaviour is a bit unexpected, and that Rich formatting should be the default when Rich is installed. This is what the test suite currently assumes on
master
, and attempting to change the test suite (as in #726) shows that there would be many breaking cases for users as well.So, as an alternative to #726 I suggest to fix the original bug, while keeping the default behaviour as it was: Rich formatting if Rich is installed, no formatting if it isn't installed. By introducing a new var
DEFAULT_MARKUP_MODE
this behaviour is formalized. This will also pave the way to potentially expending this functionality and allowing the user to set this default globally, as proposed in #647. For now, I would focus first on getting this bug resolved and deciding what the defaults should look like.If we do decide to merge this PR, we can close #726 (or vice versa).