Skip to content

Commit 5deae8e

Browse files
committed
update imports
1 parent 4af9fc4 commit 5deae8e

12 files changed

Lines changed: 58 additions & 10 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""Re-export from reflex_components_upload.upload."""
2+
3+
from reflex_components_upload.upload import *
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Reflex Upload Components
2+
3+
File upload components and backend helpers for Reflex apps.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[project]
2+
name = "reflex-components-upload"
3+
dynamic = ["version"]
4+
description = "Reflex upload components."
5+
readme = "README.md"
6+
authors = [{ name = "Khaleel Al-Adhami", email = "khaleel@reflex.dev" }]
7+
maintainers = [{ name = "Khaleel Al-Adhami", email = "khaleel@reflex.dev" }]
8+
requires-python = ">=3.10"
9+
dependencies = []
10+
11+
[tool.hatch.version]
12+
source = "uv-dynamic-versioning"
13+
14+
[tool.uv-dynamic-versioning]
15+
pattern-prefix = "reflex-components-upload-"
16+
fallback-version = "0.0.0dev0"
17+
18+
[tool.hatch.build]
19+
targets.sdist.artifacts = ["*.pyi"]
20+
targets.wheel.artifacts = ["*.pyi"]
21+
22+
[tool.hatch.build.hooks.reflex-pyi]
23+
dependencies = ["ruff", "reflex-core"]
24+
25+
[build-system]
26+
requires = ["hatchling", "uv-dynamic-versioning", "hatch-reflex-pyi"]
27+
build-backend = "hatchling.build"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Reflex upload components."""

packages/reflex-components-upload/src/reflex_components_upload/_upload.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
from python_multipart.multipart import MultipartParser, parse_options_header
1414
from reflex_core import constants
15+
from reflex_core.utils import exceptions
1516
from starlette.datastructures import Headers
1617
from starlette.datastructures import UploadFile as StarletteUploadFile
1718
from starlette.exceptions import HTTPException
@@ -20,8 +21,6 @@
2021
from starlette.responses import JSONResponse, Response, StreamingResponse
2122
from typing_extensions import Self
2223

23-
from reflex.utils import exceptions
24-
2524
if TYPE_CHECKING:
2625
from reflex_core.event import EventHandler
2726
from reflex_core.utils.types import Receive, Scope, Send

packages/reflex-components-upload/src/reflex_components_upload/upload.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
from pathlib import Path
77
from typing import Any, ClassVar
88

9+
from reflex_components_core.base.fragment import Fragment
10+
from reflex_components_core.core.cond import cond
11+
from reflex_components_core.el.elements.forms import Input
12+
from reflex_components_core.el.elements.typography import Div
913
from reflex_components_sonner.toast import toast
1014
from reflex_core.components.component import (
1115
Component,
@@ -38,11 +42,7 @@
3842
from reflex_core.vars.object import ObjectVar
3943
from reflex_core.vars.sequence import ArrayVar, LiteralStringVar
4044

41-
from reflex._upload import UploadChunkIterator, UploadFile
42-
from reflex_components_core.base.fragment import Fragment
43-
from reflex_components_core.core.cond import cond
44-
from reflex_components_core.el.elements.forms import Input
45-
from reflex_components_core.el.elements.typography import Div
45+
from reflex_components_upload._upload import UploadChunkIterator, UploadFile
4646

4747
DEFAULT_UPLOAD_ID: str = "default"
4848

packages/reflex-core/src/reflex_core/event.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ def resolve_upload_handler_param(handler: EventHandler) -> tuple[str, Any]:
128128
UploadTypeError: If the handler is a background task.
129129
UploadValueError: If the handler does not accept ``list[rx.UploadFile]``.
130130
"""
131-
from reflex._upload import UploadFile
131+
from reflex_components_upload._upload import UploadFile
132+
132133
from reflex_core.utils.exceptions import UploadTypeError, UploadValueError
133134

134135
handler_name = _handler_name(handler)
@@ -167,7 +168,8 @@ def resolve_upload_chunk_handler_param(handler: EventHandler) -> tuple[str, type
167168
UploadTypeError: If the handler is not a background task.
168169
UploadValueError: If the handler does not accept an UploadChunkIterator.
169170
"""
170-
from reflex._upload import UploadChunkIterator
171+
from reflex_components_upload._upload import UploadChunkIterator
172+
171173
from reflex_core.utils.exceptions import UploadTypeError, UploadValueError
172174

173175
handler_name = _handler_name(handler)

pyi_hashes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"packages/reflex-components-core/src/reflex_components_core/core/helmet.pyi": "3bf7bee5665293f7583009f651ea3cb1",
2121
"packages/reflex-components-core/src/reflex_components_core/core/html.pyi": "7209d1607545e412ed38dbe2a129321c",
2222
"packages/reflex-components-core/src/reflex_components_core/core/sticky.pyi": "8241c75ca16a0960b7dea6d6e7aff52e",
23-
"packages/reflex-components-core/src/reflex_components_core/core/upload.pyi": "54ba94e554dc3a310e67c44ef1a7be98",
2423
"packages/reflex-components-core/src/reflex_components_core/core/window_events.pyi": "4407cecb1825dc359bcc7b2bea011a8e",
2524
"packages/reflex-components-core/src/reflex_components_core/datadisplay/__init__.pyi": "aaab42816119ac0f308841dc5482b3f1",
2625
"packages/reflex-components-core/src/reflex_components_core/el/__init__.pyi": "4ddf8457f8c48e7381e04e20dfa656e5",
@@ -118,6 +117,7 @@
118117
"packages/reflex-components-recharts/src/reflex_components_recharts/polar.pyi": "1ce679c002336c7bdbdd6c8ff6f2413c",
119118
"packages/reflex-components-recharts/src/reflex_components_recharts/recharts.pyi": "1b92135de4ea79cb7d94eaaec55b9ab7",
120119
"packages/reflex-components-sonner/src/reflex_components_sonner/toast.pyi": "f09c503c4ab880c13c13d6fa67d708b8",
120+
"packages/reflex-components-upload/src/reflex_components_upload/upload.pyi": "bb0977d2e9ab51344b84d3da2b23a984",
121121
"reflex/__init__.pyi": "e2e675167f52ca535830860e84384103",
122122
"reflex/components/__init__.pyi": "55bb242d5e5428db329b88b4923c2ba5",
123123
"reflex/experimental/memo.pyi": "d16eccf33993c781e2f8bc2dd8bbd4d4"

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ dependencies = [
5050
"reflex-components-react-router",
5151
"reflex-components-recharts",
5252
"reflex-components-sonner",
53+
"reflex-components-upload",
5354
]
5455

5556
classifiers = [
@@ -345,6 +346,7 @@ reflex-components-react-player.workspace = true
345346
reflex-components-react-router.workspace = true
346347
reflex-components-recharts.workspace = true
347348
reflex-components-sonner.workspace = true
349+
reflex-components-upload.workspace = true
348350
reflex-docgen.workspace = true
349351

350352
[tool.uv.workspace]

reflex/_upload.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""Re-export from reflex_components_upload._upload."""
2+
3+
from reflex_components_upload._upload import *

0 commit comments

Comments
 (0)