streamlit-nightly 1.39.1.dev20241104__py2.py3-none-any.whl → 1.39.1.dev20241105__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,6 +16,7 @@ from __future__ import annotations
16
16
 
17
17
  import inspect
18
18
  import os
19
+ from pathlib import Path
19
20
  from typing import TYPE_CHECKING
20
21
 
21
22
  from streamlit.components.v1.custom_component import CustomComponent
@@ -49,7 +50,7 @@ def _get_module_name(caller_frame: FrameType) -> str:
49
50
 
50
51
  def declare_component(
51
52
  name: str,
52
- path: str | None = None,
53
+ path: str | Path | None = None,
53
54
  url: str | None = None,
54
55
  ) -> CustomComponent:
55
56
  """Create a custom component and register it if there is a ``ScriptRunContext``.
@@ -71,7 +72,7 @@ def declare_component(
71
72
  name : str
72
73
  A short, descriptive name for the component, like "slider".
73
74
 
74
- path: str or None
75
+ path: str, Path, or None
75
76
  The path to serve the component's frontend files from. If ``path`` is
76
77
  ``None`` (default), Streamlit will serve the component from the
77
78
  location in ``url``. Either ``path`` or ``url`` must be specified, but
@@ -90,6 +91,8 @@ def declare_component(
90
91
  in the Streamlit app.
91
92
 
92
93
  """
94
+ if path is not None and isinstance(path, Path):
95
+ path = str(path)
93
96
 
94
97
  # Get our stack frame.
95
98
  current_frame: FrameType | None = inspect.currentframe()
@@ -152,13 +152,13 @@ class AppTest:
152
152
 
153
153
  def __init__(
154
154
  self,
155
- script_path: str,
155
+ script_path: str | Path,
156
156
  *,
157
157
  default_timeout: float,
158
158
  args=None,
159
159
  kwargs=None,
160
160
  ):
161
- self._script_path = script_path
161
+ self._script_path = str(script_path)
162
162
  self.default_timeout = default_timeout
163
163
  session_state = SessionState()
164
164
  session_state[TESTING_KEY] = {}
@@ -264,7 +264,9 @@ class AppTest:
264
264
  )
265
265
 
266
266
  @classmethod
267
- def from_file(cls, script_path: str, *, default_timeout: float = 3) -> AppTest:
267
+ def from_file(
268
+ cls, script_path: str | Path, *, default_timeout: float = 3
269
+ ) -> AppTest:
268
270
  """
269
271
  Create an instance of ``AppTest`` to simulate an app page defined\
270
272
  within a file.
@@ -275,7 +277,7 @@ class AppTest:
275
277
 
276
278
  Parameters
277
279
  ----------
278
- script_path: str
280
+ script_path: str | Path
279
281
  Path to a script file. The path should be absolute or relative to
280
282
  the file calling ``.from_file``.
281
283
 
@@ -288,9 +290,9 @@ class AppTest:
288
290
  AppTest
289
291
  A simulated Streamlit app for testing. The simulated app can be
290
292
  executed via ``.run()``.
291
-
292
293
  """
293
- if Path.is_file(Path(script_path)):
294
+ script_path = Path(script_path)
295
+ if script_path.is_file():
294
296
  path = script_path
295
297
  else:
296
298
  # TODO: Make this not super fragile
@@ -298,7 +300,7 @@ class AppTest:
298
300
  # path can be relative to there.
299
301
  stack = traceback.StackSummary.extract(traceback.walk_stack(None))
300
302
  filepath = Path(stack[1].filename)
301
- path = str(filepath.parent / script_path)
303
+ path = filepath.parent / script_path
302
304
  return AppTest(path, default_timeout=default_timeout)
303
305
 
304
306
  def _run(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: streamlit-nightly
3
- Version: 1.39.1.dev20241104
3
+ Version: 1.39.1.dev20241105
4
4
  Summary: A faster way to build and share data apps
5
5
  Home-page: https://streamlit.io
6
6
  Author: Snowflake Inc
@@ -46,7 +46,7 @@ streamlit/components/types/base_component_registry.py,sha256=Zw8uO9qTKcpYJokkML_
46
46
  streamlit/components/types/base_custom_component.py,sha256=a8fvmmf8DN18fhezsdgkr9Bzi4ue7G_TUG66sBSbsp0,4262
47
47
  streamlit/components/v1/__init__.py,sha256=I7xa1wfGQY84U_nWWsq1i_HO5kCQ7f0BE5_dEQUiWRw,1027
48
48
  streamlit/components/v1/component_arrow.py,sha256=1Pm-n6gFn_vRXsT053AWFqYxLfcf2QVQYKWFg3yIpeI,4422
49
- streamlit/components/v1/component_registry.py,sha256=1yickIoaIXCn9TMb4kDrjfkiNgjBmR6HMc9yX_NmEjE,4815
49
+ streamlit/components/v1/component_registry.py,sha256=fqnozAWAKhp-AQHHwcKh25gb8UF4CPOoBKFtKfvopLg,4931
50
50
  streamlit/components/v1/components.py,sha256=-fyYz9yOIILGHUFqICLipl7HAK-2NUWGcBFcQa4L3Sk,1585
51
51
  streamlit/components/v1/custom_component.py,sha256=zKWGpS7LG1ryVUmdX_qdwJN-dt1ARsCwa-0q3Z0POAY,9207
52
52
  streamlit/connections/__init__.py,sha256=WSOEtrwhiNYti89iCk3O7I83rurZl8gXoM8tA2d_E-U,1083
@@ -516,7 +516,7 @@ streamlit/static/static/media/snowflake.187cb4ca5fd443488e5b4bfc9c4d2b52.svg,sha
516
516
  streamlit/static/static/media/streamlit-mark-color.e5952193e5f735a3afb01a78a4dd4b41.svg,sha256=ZHCBDMsSP9Xk0i7Co1Hef_eegxZFvlY_xKP7YPBaZrg,1720
517
517
  streamlit/testing/__init__.py,sha256=Vrf1yVMOcTyhUPnYvsfyeL96Vpd5z8KoSV5ZzTcTQgU,616
518
518
  streamlit/testing/v1/__init__.py,sha256=XGxNOq4VfmwlVj9K6vXB8dAH1YbI_8AIsvw_vbzQoNA,690
519
- streamlit/testing/v1/app_test.py,sha256=DjkzeigvlviPm97wLkMwi23E8ThMNWYfoPsCn7_hPOc,37469
519
+ streamlit/testing/v1/app_test.py,sha256=y-9V7QqgrCtrn6Mt0SB1VZLSihDnVu4FOpz_gJiqF_o,37533
520
520
  streamlit/testing/v1/element_tree.py,sha256=JW5FfuwO2sPD0AUuQilqEfWIscYSfzz1vjfReDz-7oI,63121
521
521
  streamlit/testing/v1/local_script_runner.py,sha256=-cHy0vdqsqi0nd7WMw0xTme54QHTNNGG4sxO2v9lfMc,6604
522
522
  streamlit/testing/v1/util.py,sha256=zDKYdj0J0Dpc6tacvf2CWXL-buh3JnlOkwV0lBFjbsw,1791
@@ -547,9 +547,9 @@ streamlit/web/server/server_util.py,sha256=ioIHkXNlA_ujj2Q3isziM8r5glKxgK2JZRoCD
547
547
  streamlit/web/server/stats_request_handler.py,sha256=e144zIhzLTB1PN4CwTCxElCoWMuo9IsBEPex2exHCQ0,3641
548
548
  streamlit/web/server/upload_file_request_handler.py,sha256=ftyKpARrUjOpRcFETIXuoTyOG_mo-ToOw5NI0y_W4lE,5003
549
549
  streamlit/web/server/websocket_headers.py,sha256=uUxypj04ondEC4ocBiYCndX_N06Zwe1Mt690Vupe08Y,2232
550
- streamlit_nightly-1.39.1.dev20241104.data/scripts/streamlit.cmd,sha256=ZEYM3vBJSp-k7vwSJ3ba5NzEk9-qHdSeLvGYAAe1mMw,676
551
- streamlit_nightly-1.39.1.dev20241104.dist-info/METADATA,sha256=HYF-LKIxngeO96Hfx849WQdjangmSjR6S3iLSNrWSDw,8512
552
- streamlit_nightly-1.39.1.dev20241104.dist-info/WHEEL,sha256=OpXWERl2xLPRHTvd2ZXo_iluPEQd8uSbYkJ53NAER_Y,109
553
- streamlit_nightly-1.39.1.dev20241104.dist-info/entry_points.txt,sha256=uNJ4DwGNXEhOK0USwSNanjkYyR-Bk7eYQbJFDrWyOgY,53
554
- streamlit_nightly-1.39.1.dev20241104.dist-info/top_level.txt,sha256=V3FhKbm7G2LnR0s4SytavrjIPNIhvcsAGXfYHAwtQzw,10
555
- streamlit_nightly-1.39.1.dev20241104.dist-info/RECORD,,
550
+ streamlit_nightly-1.39.1.dev20241105.data/scripts/streamlit.cmd,sha256=ZEYM3vBJSp-k7vwSJ3ba5NzEk9-qHdSeLvGYAAe1mMw,676
551
+ streamlit_nightly-1.39.1.dev20241105.dist-info/METADATA,sha256=YskTOe7-IFqx3QgHylrIYfs9SdC6T1Vge7YQXvxbRAw,8512
552
+ streamlit_nightly-1.39.1.dev20241105.dist-info/WHEEL,sha256=OpXWERl2xLPRHTvd2ZXo_iluPEQd8uSbYkJ53NAER_Y,109
553
+ streamlit_nightly-1.39.1.dev20241105.dist-info/entry_points.txt,sha256=uNJ4DwGNXEhOK0USwSNanjkYyR-Bk7eYQbJFDrWyOgY,53
554
+ streamlit_nightly-1.39.1.dev20241105.dist-info/top_level.txt,sha256=V3FhKbm7G2LnR0s4SytavrjIPNIhvcsAGXfYHAwtQzw,10
555
+ streamlit_nightly-1.39.1.dev20241105.dist-info/RECORD,,