Skip to content

Commit a2ae47a

Browse files
authored
Only expose selected objects in components module (#8873)
## Describe your changes Usage of `*` in import is a bit problematic. I double-checked in Github, and exposed the objects that seems to be relevant based on this analysis. ## Testing Plan - No logic changes. --- **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 340f3f7 commit a2ae47a

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

lib/streamlit/components/v1/components.py

+15-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,20 @@
1919
# Since we do not know what other internals are used out in the wild, let's try to
2020
# model the old behavior and not to break things.
2121

22+
# This should be cleaned up in the future, e.g. as part of components v2.
23+
2224
from streamlit.components.v1.component_registry import (
23-
declare_component as declare_component, # noqa: PLC0414
25+
declare_component,
26+
)
27+
from streamlit.components.v1.custom_component import (
28+
CustomComponent,
29+
MarshallComponentException,
2430
)
25-
from streamlit.components.v1.custom_component import * # noqa: F403
31+
from streamlit.runtime.state import register_widget
32+
33+
__all__ = [
34+
"CustomComponent",
35+
"declare_component",
36+
"MarshallComponentException",
37+
"register_widget",
38+
]

0 commit comments

Comments
 (0)