Skip to content

Commit

Permalink
Merge pull request #4 from tagup/DEV-3251-customize-rerun
Browse files Browse the repository at this point in the history
Create OnPurposeRerunException for st.experimental_rerun()
  • Loading branch information
kylelrichards11 authored Aug 14, 2023
2 parents b1ee3dc + d1f4de1 commit cf2a0bb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "streamlit",
"version": "1.25.0",
"version": "1.25.0.dev1",
"private": true,
"workspaces": ["app", "lib"],
"scripts": {
Expand Down
11 changes: 1 addition & 10 deletions lib/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

THIS_DIRECTORY = Path(__file__).parent

VERSION = "1.25.0" # PEP-440
VERSION = "1.25.0.dev1" # PEP-440

NAME = "streamlit"

Expand Down Expand Up @@ -52,21 +52,12 @@
# upper bound on it.
"pyarrow>=6.0",
"pympler>=0.9, <2",
<<<<<<< HEAD
"python-dateutil>=2, <3",
"requests>=2.4, <3",
"rich>=10.11.0, <14",
"tenacity>=8.0.0, <9",
"toml<2",
"typing-extensions>=4.0.1, <5",
=======
"python-dateutil>=2.7.3, <3",
"requests>=2.18, <3",
"rich>=10.14.0, <14",
"tenacity>=8.1.0, <9",
"toml>=0.10.1, <2",
"typing-extensions>=4.1.0, <5",
>>>>>>> release/1.25.0
"tzlocal>=1.1, <5",
"validators>=0.2, <1",
# Don't require watchdog on MacOS, since it'll fail without xcode tools.
Expand Down
4 changes: 2 additions & 2 deletions lib/streamlit/commands/execution_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from streamlit.runtime.scriptrunner import (
RerunData,
RerunException,
OnPurposeRerunException,
StopException,
get_script_run_ctx,
)
Expand Down Expand Up @@ -62,7 +62,7 @@ def rerun() -> NoReturn:
query_string = ctx.query_string
page_script_hash = ctx.page_script_hash

raise RerunException(
raise OnPurposeRerunException(
RerunData(
query_string=query_string,
page_script_hash=page_script_hash,
Expand Down
1 change: 1 addition & 0 deletions lib/streamlit/runtime/scriptrunner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
)
from streamlit.runtime.scriptrunner.script_runner import (
RerunException as RerunException,
OnPurposeRerunException as OnPurposeRerunException,
)
from streamlit.runtime.scriptrunner.script_runner import ScriptRunner as ScriptRunner
from streamlit.runtime.scriptrunner.script_runner import (
Expand Down
8 changes: 8 additions & 0 deletions lib/streamlit/runtime/scriptrunner/script_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,14 @@ def __repr__(self) -> str:
return util.repr_(self)


class OnPurposeRerunException(RerunException):
"""Exception raised when the user has requested a rerun.
This is seperarate from RerunException so we can distinguish between the
two in an exception handler.
"""


def _clean_problem_modules() -> None:
"""Some modules are stateful, so we have to clear their state."""

Expand Down

0 comments on commit cf2a0bb

Please sign in to comment.