Skip to content

Commit e0adf38

Browse files
lukasmasuchakramsystems
authored andcommitted
Remove rich from required dependencies (streamlit#10320)
## Describe your changes We have a Python dependency in Streamlit - `rich` - that is almost exclusively used in Community Cloud to get nicer formatting for exceptions in the log viewer. However, it is currently installed for all Streamlit installs, which is suboptimal. The dependency is already implemented in Streamlit in a way that it is optional (only used if installed). We have recently changed that `rich` gets auto-installed on Community Cloud, therefore, we can remove it from Streamlit's required dependencies. In a follow-up after the release, we also plan to deprecate and eventually remove the `logger.enableRich` config option and always use `rich` if installed. ## Testing Plan - No logical changes. Rich is already an optional dependency in the code logic. --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
1 parent 099f446 commit e0adf38

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

lib/min-constraints-gen.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ protobuf==3.20
1111
pyarrow==7.0
1212
pydeck==0.8.0b4
1313
requests==2.27
14-
rich==10.14.0
1514
tenacity==8.1.0
1615
toml==0.10.1
1716
tornado==6.0.3

lib/setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
# upper bound on it.
4747
"pyarrow>=7.0",
4848
"requests>=2.27, <3",
49-
"rich>=10.14.0, <14",
5049
"tenacity>=8.1.0, <10",
5150
"toml>=0.10.1, <2",
5251
"typing-extensions>=4.4.0, <5",

lib/streamlit/config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,9 @@ def _logger_message_format() -> str:
474474
description="""
475475
Controls whether uncaught app exceptions are logged via the rich library.
476476
477-
If True and if rich is installed, exception tracebacks will be logged with syntax highlighting and formatting.
478-
Rich tracebacks are easier to read and show more code than standard Python tracebacks.
477+
If True and if rich is installed, exception tracebacks will be logged with
478+
syntax highlighting and formatting. Rich tracebacks are easier to read and
479+
show more code than standard Python tracebacks.
479480
480481
If set to False, the default Python traceback formatting will be used.
481482
""",

lib/test-requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ matplotlib>=3.3.4
88
plotly>=5.3.1
99
seaborn>=0.11.2
1010
watchdog>=2.1.5
11+
# Optional dependency used for improved exception formatting
12+
# in Community Cloud:
13+
rich>=10.14.0
14+
1115
# We still need numpy < 2 for our bokeh tests since
1216
# bokeh 2.4.3 is incompatible with numpy 2.x:
1317
numpy<2

0 commit comments

Comments
 (0)