upgrade to latest ruff (#3497)
* upgrade to latest ruff * try to fix dep review * try to fix dep review (2) * upgrade black * upgrade black (2) * update allowed dependencies * update allowed dependencies (2) * update allowed dependencies (3) * wait between interim and final in yield test * remove previous commit, increase delay between yield * forgot to save on the time.sleep(1) removal * fix integration (maybe?) * fix pyi? * what even is going on * what is realityi? * test another fix for app harness * try to wait even longer? * force uvloop to be optional * downpin fastapi < 0.111, remove changes to test
This commit is contained in:
parent
d6d14b3f72
commit
0d39237b3c
4
.github/workflows/dependency-review.yml
vendored
4
.github/workflows/dependency-review.yml
vendored
@ -13,5 +13,5 @@ jobs:
|
|||||||
- name: 'Dependency Review'
|
- name: 'Dependency Review'
|
||||||
uses: actions/dependency-review-action@v4
|
uses: actions/dependency-review-action@v4
|
||||||
with:
|
with:
|
||||||
allow-licenses: Apache-2.0, BSD-2-Clause, BSD-3-Clause, HPND, ISC, MIT, MPL-2.0, PSF-2.0, Unlicense
|
allow-licenses: Apache-2.0, BSD-2-Clause, BSD-3-Clause, HPND, ISC, MIT, MPL-2.0, Unlicense, Python-2.0, Python-2.0.1, Apache-2.0 AND MIT, BSD-2-Clause AND BSD-3-Clause, Apache-2.0 AND BSD-3-Clause
|
||||||
allow-dependencies-licenses: 'pkg:pypi/lazy-loader'
|
allow-dependencies-licenses: 'pkg:pypi/lazy-loader'
|
@ -3,7 +3,7 @@ fail_fast: true
|
|||||||
repos:
|
repos:
|
||||||
|
|
||||||
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||||
rev: v0.1.0
|
rev: v0.4.9
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff-format
|
- id: ruff-format
|
||||||
args: [integration, reflex, tests]
|
args: [integration, reflex, tests]
|
||||||
@ -11,6 +11,16 @@ repos:
|
|||||||
args: ["--fix", "--exit-non-zero-on-fix"]
|
args: ["--fix", "--exit-non-zero-on-fix"]
|
||||||
exclude: '^integration/benchmarks/'
|
exclude: '^integration/benchmarks/'
|
||||||
|
|
||||||
|
# Run pyi check before pyright because pyright can fail if pyi files are wrong.
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: update-pyi-files
|
||||||
|
name: update-pyi-files
|
||||||
|
always_run: true
|
||||||
|
language: system
|
||||||
|
description: 'Update pyi files as needed'
|
||||||
|
entry: python3 scripts/make_pyi.py
|
||||||
|
|
||||||
- repo: https://github.com/RobertCraigie/pyright-python
|
- repo: https://github.com/RobertCraigie/pyright-python
|
||||||
rev: v1.1.313
|
rev: v1.1.313
|
||||||
hooks:
|
hooks:
|
||||||
@ -24,11 +34,3 @@ repos:
|
|||||||
- id: darglint
|
- id: darglint
|
||||||
exclude: '^reflex/reflex.py'
|
exclude: '^reflex/reflex.py'
|
||||||
|
|
||||||
- repo: local
|
|
||||||
hooks:
|
|
||||||
- id: update-pyi-files
|
|
||||||
name: update-pyi-files
|
|
||||||
always_run: true
|
|
||||||
language: system
|
|
||||||
description: 'Update pyi files as needed'
|
|
||||||
entry: python3 scripts/make_pyi.py
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Simple module which contains one reusable reflex state class."""
|
"""Simple module which contains one reusable reflex state class."""
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Integration tests for client side storage."""
|
"""Integration tests for client side storage."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Generator
|
from typing import Generator
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Integration tests for client side storage."""
|
"""Integration tests for client side storage."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Integration tests for dynamic route page behavior."""
|
"""Integration tests for dynamic route page behavior."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Callable, Coroutine, Generator, Type
|
from typing import Callable, Coroutine, Generator, Type
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Ensure stopPropagation and preventDefault work as expected."""
|
"""Ensure stopPropagation and preventDefault work as expected."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Ensure that Event Chains are properly queued and handled between frontend and backend."""
|
"""Ensure that Event Chains are properly queued and handled between frontend and backend."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Generator
|
from typing import Generator
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Integration tests for forms."""
|
"""Integration tests for forms."""
|
||||||
|
|
||||||
import functools
|
import functools
|
||||||
import time
|
import time
|
||||||
from typing import Generator
|
from typing import Generator
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Integration tests for text input and related components."""
|
"""Integration tests for text input and related components."""
|
||||||
|
|
||||||
from typing import Generator
|
from typing import Generator
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Test large state."""
|
"""Test large state."""
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import jinja2
|
import jinja2
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Test cases for the FastAPI lifespan integration."""
|
"""Test cases for the FastAPI lifespan integration."""
|
||||||
|
|
||||||
from typing import Generator
|
from typing import Generator
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Integration tests for client side storage."""
|
"""Integration tests for client side storage."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Generator
|
from typing import Generator
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Integration tests for media components."""
|
"""Integration tests for media components."""
|
||||||
|
|
||||||
from typing import Generator
|
from typing import Generator
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Integration tests for links and related components."""
|
"""Integration tests for links and related components."""
|
||||||
|
|
||||||
from typing import Generator
|
from typing import Generator
|
||||||
from urllib.parse import urlsplit
|
from urllib.parse import urlsplit
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Integration tests for special server side events."""
|
"""Integration tests for special server side events."""
|
||||||
|
|
||||||
import time
|
import time
|
||||||
from typing import Generator
|
from typing import Generator
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Test shared state."""
|
"""Test shared state."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Generator
|
from typing import Generator
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Integration tests for table and related components."""
|
"""Integration tests for table and related components."""
|
||||||
|
|
||||||
from typing import Generator
|
from typing import Generator
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Integration tests for file upload."""
|
"""Integration tests for file upload."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Integration tests for all urls in Reflex."""
|
"""Integration tests for all urls in Reflex."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Integration tests for var operations."""
|
"""Integration tests for var operations."""
|
||||||
|
|
||||||
from typing import Generator
|
from typing import Generator
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Helper utilities for integration tests."""
|
"""Helper utilities for integration tests."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
|
1111
poetry.lock
generated
1111
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@ -28,7 +28,7 @@ packages = [
|
|||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.8"
|
python = "^3.8"
|
||||||
dill = ">=0.3.8,<0.4"
|
dill = ">=0.3.8,<0.4"
|
||||||
fastapi = ">=0.96.0,<1.0"
|
fastapi = ">=0.96.0,<0.111.0"
|
||||||
gunicorn = ">=20.1.0,<23.0"
|
gunicorn = ">=20.1.0,<23.0"
|
||||||
jinja2 = ">=3.1.2,<4.0"
|
jinja2 = ">=3.1.2,<4.0"
|
||||||
psutil = ">=5.9.4,<6.0"
|
psutil = ">=5.9.4,<6.0"
|
||||||
@ -73,8 +73,8 @@ darglint = ">=1.8.1,<2.0"
|
|||||||
toml = ">=0.10.2,<1.0"
|
toml = ">=0.10.2,<1.0"
|
||||||
pytest-asyncio = ">=0.20.1,<0.22.0" # https://github.com/pytest-dev/pytest-asyncio/issues/706
|
pytest-asyncio = ">=0.20.1,<0.22.0" # https://github.com/pytest-dev/pytest-asyncio/issues/706
|
||||||
pytest-cov = ">=4.0.0,<5.0"
|
pytest-cov = ">=4.0.0,<5.0"
|
||||||
black = "^22.10.0,<23.0"
|
black = "^24.3.0"
|
||||||
ruff = "0.1.0"
|
ruff = "^0.4.9"
|
||||||
pandas = [
|
pandas = [
|
||||||
{version = ">=2.1.1,<3.0", python = ">=3.9,<3.13"},
|
{version = ">=2.1.1,<3.0", python = ">=3.9,<3.13"},
|
||||||
{version = ">=1.5.3,<2.0", python = ">=3.8,<3.9"},
|
{version = ">=1.5.3,<2.0", python = ">=3.8,<3.9"},
|
||||||
@ -99,9 +99,11 @@ build-backend = "poetry.core.masonry.api"
|
|||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
exclude = ["*.pyi"]
|
exclude = ["*.pyi"]
|
||||||
target-version = "py37"
|
target-version = "py38"
|
||||||
lint.select = ["B", "D", "E", "F", "I", "SIM", "W"]
|
lint.select = ["B", "D", "E", "F", "I", "SIM", "W"]
|
||||||
lint.ignore = ["B008", "D203", "D205", "D213", "D401", "D406", "D407", "E501", "F403", "F405", "F541"]
|
lint.ignore = ["B008", "D203", "D205", "D213", "D401", "D406", "D407", "E501", "F403", "F405", "F541"]
|
||||||
|
lint.pydocstyle.convention = "google"
|
||||||
|
|
||||||
[tool.ruff.lint.per-file-ignores]
|
[tool.ruff.lint.per-file-ignores]
|
||||||
"__init__.py" = ["F401"]
|
"__init__.py" = ["F401"]
|
||||||
"tests/*.py" = ["D100", "D103", "D104", "B018"]
|
"tests/*.py" = ["D100", "D103", "D104", "B018"]
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Welcome to Reflex! This file outlines the steps to create a basic app."""
|
"""Welcome to Reflex! This file outlines the steps to create a basic app."""
|
||||||
|
|
||||||
from typing import Callable
|
from typing import Callable
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""The pages of the app."""
|
"""The pages of the app."""
|
||||||
|
|
||||||
from .chatapp import chatapp_page
|
from .chatapp import chatapp_page
|
||||||
from .datatable import datatable_page
|
from .datatable import datatable_page
|
||||||
from .forms import forms_page
|
from .forms import forms_page
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""The settings page for the template."""
|
"""The settings page for the template."""
|
||||||
|
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""The settings page for the template."""
|
"""The settings page for the template."""
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
|
|
||||||
from ..states.form_state import FormState, UploadState
|
from ..states.form_state import FormState, UploadState
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""The dashboard page for the template."""
|
"""The dashboard page for the template."""
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
|
|
||||||
from ..states.pie_state import PieChartState
|
from ..states.pie_state import PieChartState
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""The home page of the app."""
|
"""The home page of the app."""
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
|
|
||||||
from ..styles import *
|
from ..styles import *
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Styles for the app."""
|
"""Styles for the app."""
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
|
|
||||||
from .state import State
|
from .state import State
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""The Reflex Admin Dashboard."""
|
"""The Reflex Admin Dashboard."""
|
||||||
|
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
|
@ -176,9 +176,9 @@ class App(LifespanMixin, Base):
|
|||||||
stylesheets: List[str] = []
|
stylesheets: List[str] = []
|
||||||
|
|
||||||
# A component that is present on every page (defaults to the Connection Error banner).
|
# A component that is present on every page (defaults to the Connection Error banner).
|
||||||
overlay_component: Optional[
|
overlay_component: Optional[Union[Component, ComponentCallable]] = (
|
||||||
Union[Component, ComponentCallable]
|
default_overlay_component
|
||||||
] = default_overlay_component
|
)
|
||||||
|
|
||||||
# Components to add to the head of every page.
|
# Components to add to the head of every page.
|
||||||
head_components: List[Component] = []
|
head_components: List[Component] = []
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Shims the real reflex app module for running backend server (uvicorn or gunicorn).
|
"""Shims the real reflex app module for running backend server (uvicorn or gunicorn).
|
||||||
Only the app attribute is explicitly exposed.
|
Only the app attribute is explicitly exposed.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from concurrent.futures import ThreadPoolExecutor
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
|
|
||||||
from reflex import constants
|
from reflex import constants
|
||||||
@ -8,7 +9,7 @@ from reflex.utils import telemetry
|
|||||||
from reflex.utils.exec import is_prod_mode
|
from reflex.utils.exec import is_prod_mode
|
||||||
from reflex.utils.prerequisites import get_app
|
from reflex.utils.prerequisites import get_app
|
||||||
|
|
||||||
if "app" != constants.CompileVars.APP:
|
if constants.CompileVars.APP != "app":
|
||||||
raise AssertionError("unexpected variable name for 'app'")
|
raise AssertionError("unexpected variable name for 'app'")
|
||||||
|
|
||||||
telemetry.send("compile")
|
telemetry.send("compile")
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Import all the components."""
|
"""Import all the components."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex.utils import lazy_loader
|
from reflex.utils import lazy_loader
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Base components."""
|
"""Base components."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex.utils import lazy_loader
|
from reflex.utils import lazy_loader
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Top-level component that wraps the entire app."""
|
"""Top-level component that wraps the entire app."""
|
||||||
|
|
||||||
from reflex.components.base.fragment import Fragment
|
from reflex.components.base.fragment import Fragment
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.vars import Var
|
from reflex.vars import Var
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""React fragments to enable bare returns of component trees from functions."""
|
"""React fragments to enable bare returns of component trees from functions."""
|
||||||
|
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
"""Display the title of the current page."""
|
"""Display the title of the current page."""
|
||||||
|
|
||||||
|
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.vars import Var
|
from reflex.vars import Var
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
https://nextjs.org/docs/app/api-reference/components/script
|
https://nextjs.org/docs/app/api-reference/components/script
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Components that are based on Chakra-UI."""
|
"""Components that are based on Chakra-UI."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from functools import lru_cache
|
from functools import lru_cache
|
||||||
|
@ -155,6 +155,7 @@ class ChakraProvider(ChakraComponent):
|
|||||||
A new ChakraProvider component.
|
A new ChakraProvider component.
|
||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
def add_imports(self) -> ImportDict: ...
|
def add_imports(self) -> ImportDict: ...
|
||||||
|
|
||||||
chakra_provider = ChakraProvider.create()
|
chakra_provider = ChakraProvider.create()
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""A code component."""
|
"""A code component."""
|
||||||
|
|
||||||
from reflex.components.chakra import (
|
from reflex.components.chakra import (
|
||||||
ChakraComponent,
|
ChakraComponent,
|
||||||
)
|
)
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""A line to divide parts of the layout."""
|
"""A line to divide parts of the layout."""
|
||||||
|
|
||||||
from typing import Literal
|
from typing import Literal
|
||||||
|
|
||||||
from reflex.components.chakra import ChakraComponent, LiteralDividerVariant
|
from reflex.components.chakra import ChakraComponent, LiteralDividerVariant
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Table components."""
|
"""Table components."""
|
||||||
|
|
||||||
from typing import List, Tuple
|
from typing import List, Tuple
|
||||||
|
|
||||||
from reflex.components.chakra import ChakraComponent
|
from reflex.components.chakra import ChakraComponent
|
||||||
|
@ -184,6 +184,7 @@ class Thead(ChakraComponent):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def validate_headers(headers): ...
|
def validate_headers(headers): ...
|
||||||
|
|
||||||
@ -264,6 +265,7 @@ class Tbody(ChakraComponent):
|
|||||||
Component: The table body component
|
Component: The table body component
|
||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def validate_rows(rows): ...
|
def validate_rows(rows): ...
|
||||||
|
|
||||||
@ -344,6 +346,7 @@ class Tfoot(ChakraComponent):
|
|||||||
The table footer component.
|
The table footer component.
|
||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def validate_footers(footers): ...
|
def validate_footers(footers): ...
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Chakra Tag Component."""
|
"""Chakra Tag Component."""
|
||||||
|
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from reflex.components.chakra import (
|
from reflex.components.chakra import (
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""A transition Component."""
|
"""A transition Component."""
|
||||||
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from reflex.components.chakra import ChakraComponent
|
from reflex.components.chakra import ChakraComponent
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Container to stack elements with spacing."""
|
"""Container to stack elements with spacing."""
|
||||||
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from reflex.components.chakra import ChakraComponent
|
from reflex.components.chakra import ChakraComponent
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""A button component."""
|
"""A button component."""
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from reflex.components.chakra import (
|
from reflex.components.chakra import (
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""A checkbox component."""
|
"""A checkbox component."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex.components.chakra import (
|
from reflex.components.chakra import (
|
||||||
|
@ -14,6 +14,7 @@ rx.text(
|
|||||||
)
|
)
|
||||||
```
|
```
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex.components.chakra import ChakraComponent
|
from reflex.components.chakra import ChakraComponent
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""An editable component."""
|
"""An editable component."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex.components.chakra import ChakraComponent
|
from reflex.components.chakra import ChakraComponent
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Form components."""
|
"""Form components."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex.components.chakra import ChakraComponent
|
from reflex.components.chakra import ChakraComponent
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
"""An input component."""
|
"""An input component."""
|
||||||
|
|
||||||
|
|
||||||
from reflex.components.chakra import (
|
from reflex.components.chakra import (
|
||||||
ChakraComponent,
|
ChakraComponent,
|
||||||
LiteralButtonSize,
|
LiteralButtonSize,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Provides a feature-rich Select and some (not all) related components."""
|
"""Provides a feature-rich Select and some (not all) related components."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Dict, List, Optional, Set, Union
|
from typing import Any, Dict, List, Optional, Set, Union
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
"""A radio component."""
|
"""A radio component."""
|
||||||
|
|
||||||
|
|
||||||
from typing import Any, List
|
from typing import Any, List
|
||||||
|
|
||||||
from reflex.components.chakra import ChakraComponent
|
from reflex.components.chakra import ChakraComponent
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""A range slider component."""
|
"""A range slider component."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""A slider component."""
|
"""A slider component."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Literal
|
from typing import Literal
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""A switch component."""
|
"""A switch component."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex.components.chakra import ChakraComponent, LiteralColorScheme
|
from reflex.components.chakra import ChakraComponent, LiteralColorScheme
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""A textarea component."""
|
"""A textarea component."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex.components.chakra import ChakraComponent, LiteralInputVariant
|
from reflex.components.chakra import ChakraComponent, LiteralInputVariant
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Avatar components."""
|
"""Avatar components."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex.components.chakra import ChakraComponent, LiteralAvatarSize
|
from reflex.components.chakra import ChakraComponent, LiteralAvatarSize
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""An icon component."""
|
"""An icon component."""
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from reflex.components.chakra import ChakraComponent
|
from reflex.components.chakra import ChakraComponent
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""An image component."""
|
"""An image component."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Optional
|
from typing import Any, Optional
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
"""A link component."""
|
"""A link component."""
|
||||||
|
|
||||||
|
|
||||||
from reflex.components.chakra import ChakraComponent
|
from reflex.components.chakra import ChakraComponent
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.components.next.link import NextLink
|
from reflex.components.next.link import NextLink
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Alert dialog components."""
|
"""Alert dialog components."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex.components.chakra import ChakraComponent, LiteralAlertDialogSize
|
from reflex.components.chakra import ChakraComponent, LiteralAlertDialogSize
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Container to stack elements with spacing."""
|
"""Container to stack elements with spacing."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex.components.chakra import (
|
from reflex.components.chakra import (
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Menu components."""
|
"""Menu components."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Modal components."""
|
"""Modal components."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Literal, Optional, Union
|
from typing import Literal, Optional, Union
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Popover components."""
|
"""Popover components."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex.components.chakra import (
|
from reflex.components.chakra import (
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Tooltip components."""
|
"""Tooltip components."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex.components.chakra import ChakraComponent, LiteralChakraDirection
|
from reflex.components.chakra import ChakraComponent, LiteralChakraDirection
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
"""A heading component."""
|
"""A heading component."""
|
||||||
|
|
||||||
|
|
||||||
from reflex.components.chakra import ChakraComponent, LiteralHeadingSize
|
from reflex.components.chakra import ChakraComponent, LiteralHeadingSize
|
||||||
from reflex.vars import Var
|
from reflex.vars import Var
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""A span component."""
|
"""A span component."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex.components.chakra import ChakraComponent
|
from reflex.components.chakra import ChakraComponent
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""A text component."""
|
"""A text component."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex.components.chakra import ChakraComponent
|
from reflex.components.chakra import ChakraComponent
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Core Reflex components."""
|
"""Core Reflex components."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex.utils import lazy_loader
|
from reflex.utils import lazy_loader
|
||||||
|
@ -445,6 +445,7 @@ class WifiOffPulse(Icon):
|
|||||||
The icon component with default props applied.
|
The icon component with default props applied.
|
||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
def add_imports(self) -> dict[str, str | ImportVar | list[str | ImportVar]]: ...
|
def add_imports(self) -> dict[str, str | ImportVar | list[str | ImportVar]]: ...
|
||||||
|
|
||||||
class ConnectionPulser(Div):
|
class ConnectionPulser(Div):
|
||||||
|
@ -7,6 +7,7 @@ setting a reactive state var "routeNotFound" to true if the redirect fails. The
|
|||||||
`wait_for_client_redirect` function will render the component only after
|
`wait_for_client_redirect` function will render the component only after
|
||||||
routeNotFound becomes true.
|
routeNotFound becomes true.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex import constants
|
from reflex import constants
|
||||||
|
@ -110,18 +110,15 @@ class Cond(MemoizationLeaf):
|
|||||||
|
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
def cond(condition: Any, c1: Component, c2: Any) -> Component:
|
def cond(condition: Any, c1: Component, c2: Any) -> Component: ...
|
||||||
...
|
|
||||||
|
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
def cond(condition: Any, c1: Component) -> Component:
|
def cond(condition: Any, c1: Component) -> Component: ...
|
||||||
...
|
|
||||||
|
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
def cond(condition: Any, c1: Any, c2: Any) -> Var:
|
def cond(condition: Any, c1: Any, c2: Any) -> Var: ...
|
||||||
...
|
|
||||||
|
|
||||||
|
|
||||||
def cond(condition: Any, c1: Any, c2: Any = None):
|
def cond(condition: Any, c1: Any, c2: Any = None):
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Create a list of components from an iterable."""
|
"""Create a list of components from an iterable."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import inspect
|
import inspect
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""A html component."""
|
"""A html component."""
|
||||||
|
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
from reflex.components.el.elements.typography import Div
|
from reflex.components.el.elements.typography import Div
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Data grid components."""
|
"""Data grid components."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex.utils import lazy_loader
|
from reflex.utils import lazy_loader
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""A code component."""
|
"""A code component."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
@ -1112,6 +1112,7 @@ class CodeBlock(Component):
|
|||||||
The text component.
|
The text component.
|
||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
def add_style(self): ...
|
def add_style(self): ...
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def convert_theme_name(theme) -> str: ...
|
def convert_theme_name(theme) -> str: ...
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""A Reflex logo component."""
|
"""A Reflex logo component."""
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""The el package exports raw HTML elements."""
|
"""The el package exports raw HTML elements."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex.utils import lazy_loader
|
from reflex.utils import lazy_loader
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
"""Base class definition for raw HTML elements."""
|
"""Base class definition for raw HTML elements."""
|
||||||
|
|
||||||
|
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Element classes."""
|
"""Element classes."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from reflex.utils import lazy_loader
|
from reflex.utils import lazy_loader
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
||||||
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from reflex.components.el.element import Element
|
from reflex.components.el.element import Element
|
||||||
|
@ -580,6 +580,7 @@ class Form(BaseHTML):
|
|||||||
The form component.
|
The form component.
|
||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
def add_imports(self) -> ImportDict: ...
|
def add_imports(self) -> ImportDict: ...
|
||||||
def add_hooks(self) -> list[str]: ...
|
def add_hooks(self) -> list[str]: ...
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
||||||
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from reflex.vars import Var
|
from reflex.vars import Var
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
||||||
|
|
||||||
from typing import Any, Union
|
from typing import Any, Union
|
||||||
|
|
||||||
from reflex import Component
|
from reflex import Component
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
||||||
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from reflex.components.el.element import Element
|
from reflex.components.el.element import Element
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
||||||
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from reflex.vars import Var as Var
|
from reflex.vars import Var as Var
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
||||||
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from reflex.vars import Var as Var
|
from reflex.vars import Var as Var
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
||||||
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from reflex.vars import Var as Var
|
from reflex.vars import Var as Var
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
||||||
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from reflex.vars import Var as Var
|
from reflex.vars import Var as Var
|
||||||
|
@ -181,4 +181,5 @@ class DataTable(Gridjs):
|
|||||||
ValueError: If a pandas dataframe is passed in and columns are also provided.
|
ValueError: If a pandas dataframe is passed in and columns are also provided.
|
||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
def add_imports(self) -> ImportDict: ...
|
def add_imports(self) -> ImportDict: ...
|
||||||
|
@ -242,7 +242,9 @@ class Markdown(Component):
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Separate out inline code and code blocks.
|
# Separate out inline code and code blocks.
|
||||||
components["code"] = f"""{{({{node, inline, className, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => {{
|
components[
|
||||||
|
"code"
|
||||||
|
] = f"""{{({{node, inline, className, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => {{
|
||||||
const match = (className || '').match(/language-(?<lang>.*)/);
|
const match = (className || '').match(/language-(?<lang>.*)/);
|
||||||
const language = match ? match[1] : '';
|
const language = match ? match[1] : '';
|
||||||
if (language) {{
|
if (language) {{
|
||||||
|
@ -123,6 +123,7 @@ class Markdown(Component):
|
|||||||
The markdown component.
|
The markdown component.
|
||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
def add_imports(self) -> ImportDict | list[ImportDict]: ...
|
def add_imports(self) -> ImportDict | list[ImportDict]: ...
|
||||||
def get_component(self, tag: str, **props) -> Component: ...
|
def get_component(self, tag: str, **props) -> Component: ...
|
||||||
def format_component(self, tag: str, **props) -> str: ...
|
def format_component(self, tag: str, **props) -> str: ...
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
"""Shim for reflex.components.chakra.media.icon."""
|
"""Shim for reflex.components.chakra.media.icon."""
|
||||||
|
|
||||||
from reflex.components.chakra.media.icon import *
|
from reflex.components.chakra.media.icon import *
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user