Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix invalid escape warning when building docs #314

Merged
merged 3 commits into from
Feb 12, 2024
Merged

Conversation

pmeier
Copy link
Member

@pmeier pmeier commented Feb 9, 2024

When building the docs, we can see the following warning

INFO    -  DeprecationWarning: invalid escape sequence \[
             File "/home/philip/git/ora/ragna/deploy/_cli/core.py", line 18, in <module>
               from .config import ConfigOption, check_config, init_config
             File "/home/philip/git/ora/ragna/deploy/_cli/config.py", line 216, in
               f"$ pip install 'ragna\[all]'"

This comes from

rich.print(
f"\nTo do this, you can run\n\n"
f"$ pip install {' '.join(unmet_package_requirements)}\n\n"
f"Optionally, you can also install Ragna with all optional dependencies"
f"for the builtin components\n\n"
f"$ pip install 'ragna\[all]'"
)

We need to escape the backslash there, since rich would otherwise interpret the [all] as markup.

This PR uses the rich functionality to escape instead. This gives the same result for rich, but also resolves the warning.

@pmeier pmeier added area: documentation 📖 Improvements or additions to documentation area: developer-experience 🧑‍💻 labels Feb 9, 2024
@pmeier pmeier requested a review from pavithraes February 9, 2024 08:44
Copy link
Member

@pavithraes pavithraes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@pavithraes pavithraes merged commit 5f42831 into main Feb 12, 2024
10 checks passed
@pavithraes pavithraes deleted the invalid-escape branch February 12, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants