diff --git a/.github/ISSUE_TEMPLATE/enhancement_request.md b/.github/ISSUE_TEMPLATE/enhancement_request.md new file mode 100644 index 000000000..409524feb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/enhancement_request.md @@ -0,0 +1,19 @@ +--- +name: Enhancement Request +about: Suggest an enhancement for an existing Reflex feature. +title: '' +labels: 'enhancement' +assignees: '' +--- + +**Describe the Enhancement you want** +A clear and concise description of what the improvement does. + +- Which feature do you want to improve? (and what problem does it have) + +- What is the benefit of the enhancement? + +- Show an example/usecase were the improvement are needed. + +**Additional context** +Add any other context here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..7e217d83a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,18 @@ +--- +name: Feature Request +about: Suggest a new feature for Reflex +title: '' +labels: 'feature request' +assignees: '' + +--- + +**Describe the Features** +A clear and concise description of what the features does. + +- What is the purpose of the feature? + +- Show an example / use cases for the new feature. + +**Additional context** +Add any other context here. diff --git a/.github/actions/setup_build_env/action.yml b/.github/actions/setup_build_env/action.yml index a25f0ae44..d983a4daa 100644 --- a/.github/actions/setup_build_env/action.yml +++ b/.github/actions/setup_build_env/action.yml @@ -6,7 +6,7 @@ # # Exit conditions: # - Python of version `python-version` is ready to be invoked as `python`. -# - Poetry of version `poetry-version` is ready ot be invoked as `poetry`. +# - Poetry of version `poetry-version` is ready to be invoked as `poetry`. # - If `run-poetry-install` is true, deps as defined in `pyproject.toml` will have been installed into the venv at `create-venv-at-path`. name: 'Setup Reflex build environment' diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index aac67f7a6..f743b7cbd 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -80,7 +80,7 @@ jobs: fail-fast: false matrix: # Show OS combos first in GUI - os: [ubuntu-latest, windows-latest, macos-12] + os: [ubuntu-latest, windows-latest, macos-latest] python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0'] exclude: - os: windows-latest @@ -92,7 +92,7 @@ jobs: python-version: '3.9.18' - os: macos-latest python-version: '3.10.13' - - os: macos-12 + - os: macos-latest python-version: '3.12.0' include: - os: windows-latest @@ -155,7 +155,7 @@ jobs: fail-fast: false matrix: # Show OS combos first in GUI - os: [ubuntu-latest, windows-latest, macos-12] + os: [ubuntu-latest, windows-latest, macos-latest] python-version: ['3.11.5'] runs-on: ${{ matrix.os }} diff --git a/.github/workflows/check_outdated_dependencies.yml b/.github/workflows/check_outdated_dependencies.yml index fe8c42608..a7465defb 100644 --- a/.github/workflows/check_outdated_dependencies.yml +++ b/.github/workflows/check_outdated_dependencies.yml @@ -58,7 +58,7 @@ jobs: working-directory: ./reflex-web run: poetry run uv pip install -r requirements.txt - name: Install additional dependencies for DB access - run: poetry run uv pip install psycopg2-binary + run: poetry run uv pip install psycopg - name: Init Website for reflex-web working-directory: ./reflex-web run: poetry run reflex init diff --git a/.github/workflows/integration_app_harness.yml b/.github/workflows/integration_app_harness.yml index 6ac5fe6ab..21b021ee5 100644 --- a/.github/workflows/integration_app_harness.yml +++ b/.github/workflows/integration_app_harness.yml @@ -22,9 +22,9 @@ jobs: timeout-minutes: 30 strategy: matrix: - state_manager: ["redis", "memory"] + state_manager: ['redis', 'memory'] + python-version: ['3.11.5', '3.12.0', '3.13.0'] split_index: [1, 2] - python-version: ["3.11.5", "3.12.0"] fail-fast: false runs-on: ubuntu-22.04 services: @@ -53,7 +53,7 @@ jobs: SCREENSHOT_DIR: /tmp/screenshots/${{ matrix.state_manager }}/${{ matrix.python-version }}/${{ matrix.split_index }} REDIS_URL: ${{ matrix.state_manager == 'redis' && 'redis://localhost:6379' || '' }} run: | - poetry run playwright install --with-deps + poetry run playwright install chromium poetry run pytest tests/integration --splits 2 --group ${{matrix.split_index}} - uses: actions/upload-artifact@v4 name: Upload failed test screenshots diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index fc5935c2a..6c79c27c9 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -43,7 +43,7 @@ jobs: matrix: # Show OS combos first in GUI os: [ubuntu-latest, windows-latest] - python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0'] + python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0', '3.13.0'] exclude: - os: windows-latest python-version: '3.10.13' @@ -73,12 +73,14 @@ jobs: run: | poetry run uv pip install -r requirements.txt - name: Install additional dependencies for DB access - run: poetry run uv pip install psycopg2-binary + run: poetry run uv pip install psycopg - name: Check export --backend-only before init for counter example working-directory: ./reflex-examples/counter run: | poetry run reflex export --backend-only - name: Check run --backend-only before init for counter example + env: + WAIT_FOR_LISTENING_PORT_ARGS: --path ping run: | poetry run bash scripts/integration.sh ./reflex-examples/counter dev 8001 --backend-only --backend-port 8001 - name: Init Website for counter example @@ -147,7 +149,7 @@ jobs: working-directory: ./reflex-web run: poetry run uv pip install $(grep -ivE "reflex " requirements.txt) - name: Install additional dependencies for DB access - run: poetry run uv pip install psycopg2-binary + run: poetry run uv pip install psycopg - name: Init Website for reflex-web working-directory: ./reflex-web run: poetry run reflex init @@ -162,14 +164,43 @@ jobs: --python-version "${{ matrix.python-version }}" --commit-sha "${{ github.sha }}" --pr-id "${{ github.event.pull_request.id }}" --branch-name "${{ github.head_ref || github.ref_name }}" --app-name "reflex-web" --path ./reflex-web/.web + + rx-shout-from-template: + strategy: + fail-fast: false + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup_build_env + with: + python-version: '3.11.4' + run-poetry-install: true + create-venv-at-path: .venv + - name: Create app directory + run: mkdir rx-shout-from-template + - name: Init reflex-web from template + run: poetry run reflex init --template https://github.com/masenf/rx_shout + working-directory: ./rx-shout-from-template + - name: ignore reflex pin in requirements + run: sed -i -e '/reflex==/d' requirements.txt + working-directory: ./rx-shout-from-template + - name: Install additional dependencies + run: poetry run uv pip install -r requirements.txt + working-directory: ./rx-shout-from-template + - name: Run Website and Check for errors + run: | + # Check that npm is home + npm -v + poetry run bash scripts/integration.sh ./rx-shout-from-template prod + reflex-web-macos: if: github.event_name == 'push' && github.ref == 'refs/heads/main' strategy: fail-fast: false matrix: python-version: ['3.11.5', '3.12.0'] - runs-on: macos-12 + runs-on: macos-latest steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup_build_env @@ -187,7 +218,7 @@ jobs: working-directory: ./reflex-web run: poetry run uv pip install -r requirements.txt - name: Install additional dependencies for DB access - run: poetry run uv pip install psycopg2-binary + run: poetry run uv pip install psycopg - name: Init Website for reflex-web working-directory: ./reflex-web run: poetry run reflex init diff --git a/.github/workflows/integration_tests_wsl.yml b/.github/workflows/integration_tests_wsl.yml index 7a743252b..f6b3d395b 100644 --- a/.github/workflows/integration_tests_wsl.yml +++ b/.github/workflows/integration_tests_wsl.yml @@ -78,6 +78,7 @@ jobs: shell: wsl-bash {0} run: | export TELEMETRY_ENABLED=false + export WAIT_FOR_LISTENING_PORT_ARGS="--path ping" dos2unix scripts/integration.sh poetry run bash scripts/integration.sh ./reflex-examples/counter dev 8001 --backend-only --backend-port 8001 - name: Init Website for counter example diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index c76918583..25f5723f3 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -28,7 +28,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0'] + python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0', '3.13.0'] # Windows is a bit behind on Python version availability in Github exclude: - os: windows-latest @@ -88,8 +88,9 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0'] - runs-on: macos-12 + # Note: py39, py310 versions chosen due to available arm64 darwin builds. + python-version: ['3.9.13', '3.10.11', '3.11.5', '3.12.0', '3.13.0'] + runs-on: macos-latest steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup_build_env diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4046bad2d..ac25a335e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ fail_fast: true repos: - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.7.4 + rev: v0.8.2 hooks: - id: ruff-format args: [reflex, tests] @@ -11,6 +11,12 @@ repos: args: ["--fix", "--exit-non-zero-on-fix"] exclude: '^integration/benchmarks/' + - repo: https://github.com/codespell-project/codespell + rev: v2.3.0 + hooks: + - id: codespell + args: ["reflex"] + # Run pyi check before pyright because pyright can fail if pyi files are wrong. - repo: local hooks: diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 253076695..d22d91973 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -5,7 +5,7 @@ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, +identity and expression, level of experience, education, socioeconomic status, nationality, personal appearance, race, religion, or sexual identity and orientation. diff --git a/README.md b/README.md index 527cca980..5e098b2d3 100644 --- a/README.md +++ b/README.md @@ -249,7 +249,7 @@ We welcome contributions of any size! Below are some good ways to get started in - **GitHub Discussions**: A great way to talk about features you want added or things that are confusing/need clarification. - **GitHub Issues**: [Issues](https://github.com/reflex-dev/reflex/issues) are an excellent way to report bugs. Additionally, you can try and solve an existing issue and submit a PR. -We are actively looking for contributors, no matter your skill level or experience. To contribute check out [CONTIBUTING.md](https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md) +We are actively looking for contributors, no matter your skill level or experience. To contribute check out [CONTRIBUTING.md](https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md) ## All Thanks To Our Contributors: diff --git a/benchmarks/benchmark_compile_times.py b/benchmarks/benchmark_compile_times.py index 2273bd5c8..56cb4e4cc 100644 --- a/benchmarks/benchmark_compile_times.py +++ b/benchmarks/benchmark_compile_times.py @@ -5,6 +5,7 @@ from __future__ import annotations import argparse import json import os +from pathlib import Path from utils import send_data_to_posthog @@ -18,7 +19,7 @@ def extract_stats_from_json(json_file: str) -> list[dict]: Returns: list[dict]: The stats for each test. """ - with open(json_file, "r") as file: + with Path(json_file).open() as file: json_data = json.load(file) # Load the JSON data if it is a string, otherwise assume it's already a dictionary diff --git a/benchmarks/benchmark_imports.py b/benchmarks/benchmark_imports.py index 4706c0cf6..8c3f9f46c 100644 --- a/benchmarks/benchmark_imports.py +++ b/benchmarks/benchmark_imports.py @@ -5,6 +5,7 @@ from __future__ import annotations import argparse import json import os +from pathlib import Path from utils import send_data_to_posthog @@ -18,7 +19,7 @@ def extract_stats_from_json(json_file: str) -> dict: Returns: dict: The stats for each test. """ - with open(json_file, "r") as file: + with Path(json_file).open() as file: json_data = json.load(file) # Load the JSON data if it is a string, otherwise assume it's already a dictionary diff --git a/benchmarks/benchmark_package_size.py b/benchmarks/benchmark_package_size.py index 778b52769..6a0c37821 100644 --- a/benchmarks/benchmark_package_size.py +++ b/benchmarks/benchmark_package_size.py @@ -21,7 +21,7 @@ def get_package_size(venv_path: Path, os_name): ValueError: when venv does not exist or python version is None. """ python_version = get_python_version(venv_path, os_name) - print("Python version:", python_version) + print("Python version:", python_version) # noqa: T201 if python_version is None: raise ValueError("Error: Failed to determine Python version.") diff --git a/docker-example/production-app-platform/Dockerfile b/docker-example/production-app-platform/Dockerfile index 3dd9f1fed..284c9eab8 100644 --- a/docker-example/production-app-platform/Dockerfile +++ b/docker-example/production-app-platform/Dockerfile @@ -23,11 +23,11 @@ # for example, pass `docker build --platform=linux/amd64 ...` # Stage 1: init -FROM python:3.11 as init +FROM python:3.13 as init ARG uv=/root/.local/bin/uv -# Install `uv` for faster package boostrapping +# Install `uv` for faster package bootstrapping ADD --chmod=755 https://astral.sh/uv/install.sh /install.sh RUN /install.sh && rm /install.sh @@ -48,11 +48,11 @@ RUN $uv pip install -r requirements.txt RUN reflex init # Stage 2: copy artifacts into slim image -FROM python:3.11-slim +FROM python:3.13-slim WORKDIR /app RUN adduser --disabled-password --home /app reflex COPY --chown=reflex --from=init /app /app -# Install libpq-dev for psycopg2 (skip if not using postgres). +# Install libpq-dev for psycopg (skip if not using postgres). RUN apt-get update -y && apt-get install -y libpq-dev && rm -rf /var/lib/apt/lists/* USER reflex ENV PATH="/app/.venv/bin:$PATH" PYTHONUNBUFFERED=1 diff --git a/docker-example/production-compose/Dockerfile b/docker-example/production-compose/Dockerfile index 42345af40..196e135a7 100644 --- a/docker-example/production-compose/Dockerfile +++ b/docker-example/production-compose/Dockerfile @@ -2,11 +2,11 @@ # instance of a Reflex app. # Stage 1: init -FROM python:3.11 as init +FROM python:3.13 as init ARG uv=/root/.local/bin/uv -# Install `uv` for faster package boostrapping +# Install `uv` for faster package bootstrapping ADD --chmod=755 https://astral.sh/uv/install.sh /install.sh RUN /install.sh && rm /install.sh @@ -35,11 +35,11 @@ RUN rm -rf .web && mkdir .web RUN mv /tmp/_static .web/_static # Stage 2: copy artifacts into slim image -FROM python:3.11-slim +FROM python:3.13-slim WORKDIR /app RUN adduser --disabled-password --home /app reflex COPY --chown=reflex --from=init /app /app -# Install libpq-dev for psycopg2 (skip if not using postgres). +# Install libpq-dev for psycopg (skip if not using postgres). RUN apt-get update -y && apt-get install -y libpq-dev && rm -rf /var/lib/apt/lists/* USER reflex ENV PATH="/app/.venv/bin:$PATH" PYTHONUNBUFFERED=1 diff --git a/docker-example/production-compose/compose.prod.yaml b/docker-example/production-compose/compose.prod.yaml index 225539515..7ed5b4eca 100644 --- a/docker-example/production-compose/compose.prod.yaml +++ b/docker-example/production-compose/compose.prod.yaml @@ -15,7 +15,7 @@ services: app: environment: - DB_URL: postgresql+psycopg2://postgres:secret@db/postgres + DB_URL: postgresql+psycopg://postgres:secret@db/postgres REDIS_URL: redis://redis:6379 depends_on: - db diff --git a/docker-example/production-one-port/.dockerignore b/docker-example/production-one-port/.dockerignore new file mode 100644 index 000000000..26ae41b83 --- /dev/null +++ b/docker-example/production-one-port/.dockerignore @@ -0,0 +1,3 @@ +.web +!.web/bun.lockb +!.web/package.json diff --git a/docker-example/production-one-port/Caddyfile b/docker-example/production-one-port/Caddyfile new file mode 100644 index 000000000..28fb01861 --- /dev/null +++ b/docker-example/production-one-port/Caddyfile @@ -0,0 +1,14 @@ +:{$PORT} + +encode gzip + +@backend_routes path /_event/* /ping /_upload /_upload/* +handle @backend_routes { + reverse_proxy localhost:8000 +} + +root * /srv +route { + try_files {path} {path}/ /404.html + file_server +} diff --git a/docker-example/production-one-port/Dockerfile b/docker-example/production-one-port/Dockerfile new file mode 100644 index 000000000..f5e157bae --- /dev/null +++ b/docker-example/production-one-port/Dockerfile @@ -0,0 +1,62 @@ +# This Dockerfile is used to deploy a single-container Reflex app instance +# to services like Render, Railway, Heroku, GCP, and others. + +# If the service expects a different port, provide it here (f.e Render expects port 10000) +ARG PORT=8080 +# Only set for local/direct access. When TLS is used, the API_URL is assumed to be the same as the frontend. +ARG API_URL + +# It uses a reverse proxy to serve the frontend statically and proxy to backend +# from a single exposed port, expecting TLS termination to be handled at the +# edge by the given platform. +FROM python:3.13 as builder + +RUN mkdir -p /app/.web +RUN python -m venv /app/.venv +ENV PATH="/app/.venv/bin:$PATH" + +WORKDIR /app + +# Install python app requirements and reflex in the container +COPY requirements.txt . +RUN pip install -r requirements.txt + +# Install reflex helper utilities like bun/fnm/node +COPY rxconfig.py ./ +RUN reflex init + +# Install pre-cached frontend dependencies (if exist) +COPY *.web/bun.lockb *.web/package.json .web/ +RUN if [ -f .web/bun.lockb ]; then cd .web && ~/.local/share/reflex/bun/bin/bun install --frozen-lockfile; fi + +# Copy local context to `/app` inside container (see .dockerignore) +COPY . . + +ARG PORT API_URL +# Download other npm dependencies and compile frontend +RUN API_URL=${API_URL:-http://localhost:$PORT} reflex export --loglevel debug --frontend-only --no-zip && mv .web/_static/* /srv/ && rm -rf .web + + +# Final image with only necessary files +FROM python:3.13-slim + +# Install Caddy and redis server inside image +RUN apt-get update -y && apt-get install -y caddy redis-server && rm -rf /var/lib/apt/lists/* + +ARG PORT API_URL +ENV PATH="/app/.venv/bin:$PATH" PORT=$PORT API_URL=${API_URL:-http://localhost:$PORT} REDIS_URL=redis://localhost PYTHONUNBUFFERED=1 + +WORKDIR /app +COPY --from=builder /app /app +COPY --from=builder /srv /srv + +# Needed until Reflex properly passes SIGTERM on backend. +STOPSIGNAL SIGKILL + +EXPOSE $PORT + +# Apply migrations before starting the backend. +CMD [ -d alembic ] && reflex db migrate; \ + caddy start && \ + redis-server --daemonize yes && \ + exec reflex run --env prod --backend-only diff --git a/docker-example/production-one-port/README.md b/docker-example/production-one-port/README.md new file mode 100644 index 000000000..f6f76620a --- /dev/null +++ b/docker-example/production-one-port/README.md @@ -0,0 +1,37 @@ +# production-one-port + +This docker deployment runs Reflex in prod mode, exposing a single HTTP port: + * `8080` (`$PORT`) - Caddy server hosting the frontend statically and proxying requests to the backend. + +The deployment also runs a local Redis server to store state for each user. + +Conceptually it is similar to the `simple-one-port` example except it: + * has layer caching for python, reflex, and node dependencies + * uses multi-stage build to reduce the size of the final image + +Using this method may be preferable for deploying in memory constrained +environments, because it serves a static frontend export, rather than running +the NextJS server via node. + +## Build + +```console +docker build -t reflex-production-one-port . +``` + +## Run + +```console +docker run -p 8080:8080 reflex-production-one-port +``` + +Note that this container has _no persistence_ and will lose all data when +stopped. You can use bind mounts or named volumes to persist the database and +uploaded_files directories as needed. + +## Usage + +This container should be used with an existing load balancer or reverse proxy to +terminate TLS. + +It is also useful for deploying to simple app platforms, such as Render or Heroku. \ No newline at end of file diff --git a/docker-example/simple-one-port/Caddyfile b/docker-example/simple-one-port/Caddyfile index 13d94ce8e..28fb01861 100644 --- a/docker-example/simple-one-port/Caddyfile +++ b/docker-example/simple-one-port/Caddyfile @@ -11,4 +11,4 @@ root * /srv route { try_files {path} {path}/ /404.html file_server -} \ No newline at end of file +} diff --git a/docker-example/simple-one-port/Dockerfile b/docker-example/simple-one-port/Dockerfile index 4cd7e9a18..0b6dba0c4 100644 --- a/docker-example/simple-one-port/Dockerfile +++ b/docker-example/simple-one-port/Dockerfile @@ -4,7 +4,7 @@ # It uses a reverse proxy to serve the frontend statically and proxy to backend # from a single exposed port, expecting TLS termination to be handled at the # edge by the given platform. -FROM python:3.11 +FROM python:3.13 # If the service expects a different port, provide it here (f.e Render expects port 10000) ARG PORT=8080 @@ -38,4 +38,4 @@ EXPOSE $PORT CMD [ -d alembic ] && reflex db migrate; \ caddy start && \ redis-server --daemonize yes && \ - exec reflex run --env prod --backend-only \ No newline at end of file + exec reflex run --env prod --backend-only diff --git a/docker-example/simple-two-port/Dockerfile b/docker-example/simple-two-port/Dockerfile index 288f605a8..6d69fa390 100644 --- a/docker-example/simple-two-port/Dockerfile +++ b/docker-example/simple-two-port/Dockerfile @@ -1,5 +1,5 @@ # This Dockerfile is used to deploy a simple single-container Reflex app instance. -FROM python:3.12 +FROM python:3.13 RUN apt-get update && apt-get install -y redis-server && rm -rf /var/lib/apt/lists/* ENV REDIS_URL=redis://localhost PYTHONUNBUFFERED=1 diff --git a/poetry.lock b/poetry.lock index 3310f106a..ab65b25b4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,5 +1,142 @@ # This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +[[package]] +name = "aiohappyeyeballs" +version = "2.4.3" +description = "Happy Eyeballs for asyncio" +optional = false +python-versions = ">=3.8" +files = [ + {file = "aiohappyeyeballs-2.4.3-py3-none-any.whl", hash = "sha256:8a7a83727b2756f394ab2895ea0765a0a8c475e3c71e98d43d76f22b4b435572"}, + {file = "aiohappyeyeballs-2.4.3.tar.gz", hash = "sha256:75cf88a15106a5002a8eb1dab212525c00d1f4c0fa96e551c9fbe6f09a621586"}, +] + +[[package]] +name = "aiohttp" +version = "3.10.10" +description = "Async http client/server framework (asyncio)" +optional = false +python-versions = ">=3.8" +files = [ + {file = "aiohttp-3.10.10-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:be7443669ae9c016b71f402e43208e13ddf00912f47f623ee5994e12fc7d4b3f"}, + {file = "aiohttp-3.10.10-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7b06b7843929e41a94ea09eb1ce3927865387e3e23ebe108e0d0d09b08d25be9"}, + {file = "aiohttp-3.10.10-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:333cf6cf8e65f6a1e06e9eb3e643a0c515bb850d470902274239fea02033e9a8"}, + {file = "aiohttp-3.10.10-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:274cfa632350225ce3fdeb318c23b4a10ec25c0e2c880eff951a3842cf358ac1"}, + {file = "aiohttp-3.10.10-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d9e5e4a85bdb56d224f412d9c98ae4cbd032cc4f3161818f692cd81766eee65a"}, + {file = "aiohttp-3.10.10-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2b606353da03edcc71130b52388d25f9a30a126e04caef1fd637e31683033abd"}, + {file = "aiohttp-3.10.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ab5a5a0c7a7991d90446a198689c0535be89bbd6b410a1f9a66688f0880ec026"}, + {file = "aiohttp-3.10.10-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:578a4b875af3e0daaf1ac6fa983d93e0bbfec3ead753b6d6f33d467100cdc67b"}, + {file = "aiohttp-3.10.10-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:8105fd8a890df77b76dd3054cddf01a879fc13e8af576805d667e0fa0224c35d"}, + {file = "aiohttp-3.10.10-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:3bcd391d083f636c06a68715e69467963d1f9600f85ef556ea82e9ef25f043f7"}, + {file = "aiohttp-3.10.10-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:fbc6264158392bad9df19537e872d476f7c57adf718944cc1e4495cbabf38e2a"}, + {file = "aiohttp-3.10.10-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:e48d5021a84d341bcaf95c8460b152cfbad770d28e5fe14a768988c461b821bc"}, + {file = "aiohttp-3.10.10-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:2609e9ab08474702cc67b7702dbb8a80e392c54613ebe80db7e8dbdb79837c68"}, + {file = "aiohttp-3.10.10-cp310-cp310-win32.whl", hash = "sha256:84afcdea18eda514c25bc68b9af2a2b1adea7c08899175a51fe7c4fb6d551257"}, + {file = "aiohttp-3.10.10-cp310-cp310-win_amd64.whl", hash = "sha256:9c72109213eb9d3874f7ac8c0c5fa90e072d678e117d9061c06e30c85b4cf0e6"}, + {file = "aiohttp-3.10.10-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:c30a0eafc89d28e7f959281b58198a9fa5e99405f716c0289b7892ca345fe45f"}, + {file = "aiohttp-3.10.10-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:258c5dd01afc10015866114e210fb7365f0d02d9d059c3c3415382ab633fcbcb"}, + {file = "aiohttp-3.10.10-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:15ecd889a709b0080f02721255b3f80bb261c2293d3c748151274dfea93ac871"}, + {file = "aiohttp-3.10.10-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f3935f82f6f4a3820270842e90456ebad3af15810cf65932bd24da4463bc0a4c"}, + {file = "aiohttp-3.10.10-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:413251f6fcf552a33c981c4709a6bba37b12710982fec8e558ae944bfb2abd38"}, + {file = "aiohttp-3.10.10-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d1720b4f14c78a3089562b8875b53e36b51c97c51adc53325a69b79b4b48ebcb"}, + {file = "aiohttp-3.10.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:679abe5d3858b33c2cf74faec299fda60ea9de62916e8b67e625d65bf069a3b7"}, + {file = "aiohttp-3.10.10-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:79019094f87c9fb44f8d769e41dbb664d6e8fcfd62f665ccce36762deaa0e911"}, + {file = "aiohttp-3.10.10-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:fe2fb38c2ed905a2582948e2de560675e9dfbee94c6d5ccdb1301c6d0a5bf092"}, + {file = "aiohttp-3.10.10-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:a3f00003de6eba42d6e94fabb4125600d6e484846dbf90ea8e48a800430cc142"}, + {file = "aiohttp-3.10.10-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:1bbb122c557a16fafc10354b9d99ebf2f2808a660d78202f10ba9d50786384b9"}, + {file = "aiohttp-3.10.10-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:30ca7c3b94708a9d7ae76ff281b2f47d8eaf2579cd05971b5dc681db8caac6e1"}, + {file = "aiohttp-3.10.10-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:df9270660711670e68803107d55c2b5949c2e0f2e4896da176e1ecfc068b974a"}, + {file = "aiohttp-3.10.10-cp311-cp311-win32.whl", hash = "sha256:aafc8ee9b742ce75044ae9a4d3e60e3d918d15a4c2e08a6c3c3e38fa59b92d94"}, + {file = "aiohttp-3.10.10-cp311-cp311-win_amd64.whl", hash = "sha256:362f641f9071e5f3ee6f8e7d37d5ed0d95aae656adf4ef578313ee585b585959"}, + {file = "aiohttp-3.10.10-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:9294bbb581f92770e6ed5c19559e1e99255e4ca604a22c5c6397b2f9dd3ee42c"}, + {file = "aiohttp-3.10.10-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:a8fa23fe62c436ccf23ff930149c047f060c7126eae3ccea005f0483f27b2e28"}, + {file = "aiohttp-3.10.10-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5c6a5b8c7926ba5d8545c7dd22961a107526562da31a7a32fa2456baf040939f"}, + {file = "aiohttp-3.10.10-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:007ec22fbc573e5eb2fb7dec4198ef8f6bf2fe4ce20020798b2eb5d0abda6138"}, + {file = "aiohttp-3.10.10-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9627cc1a10c8c409b5822a92d57a77f383b554463d1884008e051c32ab1b3742"}, + {file = "aiohttp-3.10.10-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:50edbcad60d8f0e3eccc68da67f37268b5144ecc34d59f27a02f9611c1d4eec7"}, + {file = "aiohttp-3.10.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a45d85cf20b5e0d0aa5a8dca27cce8eddef3292bc29d72dcad1641f4ed50aa16"}, + {file = "aiohttp-3.10.10-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0b00807e2605f16e1e198f33a53ce3c4523114059b0c09c337209ae55e3823a8"}, + {file = "aiohttp-3.10.10-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:f2d4324a98062be0525d16f768a03e0bbb3b9fe301ceee99611dc9a7953124e6"}, + {file = "aiohttp-3.10.10-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:438cd072f75bb6612f2aca29f8bd7cdf6e35e8f160bc312e49fbecab77c99e3a"}, + {file = "aiohttp-3.10.10-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:baa42524a82f75303f714108fea528ccacf0386af429b69fff141ffef1c534f9"}, + {file = "aiohttp-3.10.10-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:a7d8d14fe962153fc681f6366bdec33d4356f98a3e3567782aac1b6e0e40109a"}, + {file = "aiohttp-3.10.10-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c1277cd707c465cd09572a774559a3cc7c7a28802eb3a2a9472588f062097205"}, + {file = "aiohttp-3.10.10-cp312-cp312-win32.whl", hash = "sha256:59bb3c54aa420521dc4ce3cc2c3fe2ad82adf7b09403fa1f48ae45c0cbde6628"}, + {file = "aiohttp-3.10.10-cp312-cp312-win_amd64.whl", hash = "sha256:0e1b370d8007c4ae31ee6db7f9a2fe801a42b146cec80a86766e7ad5c4a259cf"}, + {file = "aiohttp-3.10.10-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ad7593bb24b2ab09e65e8a1d385606f0f47c65b5a2ae6c551db67d6653e78c28"}, + {file = "aiohttp-3.10.10-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:1eb89d3d29adaf533588f209768a9c02e44e4baf832b08118749c5fad191781d"}, + {file = "aiohttp-3.10.10-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:3fe407bf93533a6fa82dece0e74dbcaaf5d684e5a51862887f9eaebe6372cd79"}, + {file = "aiohttp-3.10.10-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:50aed5155f819873d23520919e16703fc8925e509abbb1a1491b0087d1cd969e"}, + {file = "aiohttp-3.10.10-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4f05e9727ce409358baa615dbeb9b969db94324a79b5a5cea45d39bdb01d82e6"}, + {file = "aiohttp-3.10.10-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3dffb610a30d643983aeb185ce134f97f290f8935f0abccdd32c77bed9388b42"}, + {file = "aiohttp-3.10.10-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa6658732517ddabe22c9036479eabce6036655ba87a0224c612e1ae6af2087e"}, + {file = "aiohttp-3.10.10-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:741a46d58677d8c733175d7e5aa618d277cd9d880301a380fd296975a9cdd7bc"}, + {file = "aiohttp-3.10.10-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:e00e3505cd80440f6c98c6d69269dcc2a119f86ad0a9fd70bccc59504bebd68a"}, + {file = "aiohttp-3.10.10-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:ffe595f10566f8276b76dc3a11ae4bb7eba1aac8ddd75811736a15b0d5311414"}, + {file = "aiohttp-3.10.10-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:bdfcf6443637c148c4e1a20c48c566aa694fa5e288d34b20fcdc58507882fed3"}, + {file = "aiohttp-3.10.10-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:d183cf9c797a5291e8301790ed6d053480ed94070637bfaad914dd38b0981f67"}, + {file = "aiohttp-3.10.10-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:77abf6665ae54000b98b3c742bc6ea1d1fb31c394bcabf8b5d2c1ac3ebfe7f3b"}, + {file = "aiohttp-3.10.10-cp313-cp313-win32.whl", hash = "sha256:4470c73c12cd9109db8277287d11f9dd98f77fc54155fc71a7738a83ffcc8ea8"}, + {file = "aiohttp-3.10.10-cp313-cp313-win_amd64.whl", hash = "sha256:486f7aabfa292719a2753c016cc3a8f8172965cabb3ea2e7f7436c7f5a22a151"}, + {file = "aiohttp-3.10.10-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:1b66ccafef7336a1e1f0e389901f60c1d920102315a56df85e49552308fc0486"}, + {file = "aiohttp-3.10.10-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:acd48d5b80ee80f9432a165c0ac8cbf9253eaddb6113269a5e18699b33958dbb"}, + {file = "aiohttp-3.10.10-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:3455522392fb15ff549d92fbf4b73b559d5e43dc522588f7eb3e54c3f38beee7"}, + {file = "aiohttp-3.10.10-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:45c3b868724137f713a38376fef8120c166d1eadd50da1855c112fe97954aed8"}, + {file = "aiohttp-3.10.10-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:da1dee8948d2137bb51fbb8a53cce6b1bcc86003c6b42565f008438b806cccd8"}, + {file = "aiohttp-3.10.10-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c5ce2ce7c997e1971b7184ee37deb6ea9922ef5163c6ee5aa3c274b05f9e12fa"}, + {file = "aiohttp-3.10.10-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:28529e08fde6f12eba8677f5a8608500ed33c086f974de68cc65ab218713a59d"}, + {file = "aiohttp-3.10.10-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f7db54c7914cc99d901d93a34704833568d86c20925b2762f9fa779f9cd2e70f"}, + {file = "aiohttp-3.10.10-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:03a42ac7895406220124c88911ebee31ba8b2d24c98507f4a8bf826b2937c7f2"}, + {file = "aiohttp-3.10.10-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:7e338c0523d024fad378b376a79faff37fafb3c001872a618cde1d322400a572"}, + {file = "aiohttp-3.10.10-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:038f514fe39e235e9fef6717fbf944057bfa24f9b3db9ee551a7ecf584b5b480"}, + {file = "aiohttp-3.10.10-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:64f6c17757251e2b8d885d728b6433d9d970573586a78b78ba8929b0f41d045a"}, + {file = "aiohttp-3.10.10-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:93429602396f3383a797a2a70e5f1de5df8e35535d7806c9f91df06f297e109b"}, + {file = "aiohttp-3.10.10-cp38-cp38-win32.whl", hash = "sha256:c823bc3971c44ab93e611ab1a46b1eafeae474c0c844aff4b7474287b75fe49c"}, + {file = "aiohttp-3.10.10-cp38-cp38-win_amd64.whl", hash = "sha256:54ca74df1be3c7ca1cf7f4c971c79c2daf48d9aa65dea1a662ae18926f5bc8ce"}, + {file = "aiohttp-3.10.10-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:01948b1d570f83ee7bbf5a60ea2375a89dfb09fd419170e7f5af029510033d24"}, + {file = "aiohttp-3.10.10-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9fc1500fd2a952c5c8e3b29aaf7e3cc6e27e9cfc0a8819b3bce48cc1b849e4cc"}, + {file = "aiohttp-3.10.10-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f614ab0c76397661b90b6851a030004dac502e48260ea10f2441abd2207fbcc7"}, + {file = "aiohttp-3.10.10-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:00819de9e45d42584bed046314c40ea7e9aea95411b38971082cad449392b08c"}, + {file = "aiohttp-3.10.10-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05646ebe6b94cc93407b3bf34b9eb26c20722384d068eb7339de802154d61bc5"}, + {file = "aiohttp-3.10.10-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:998f3bd3cfc95e9424a6acd7840cbdd39e45bc09ef87533c006f94ac47296090"}, + {file = "aiohttp-3.10.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d9010c31cd6fa59438da4e58a7f19e4753f7f264300cd152e7f90d4602449762"}, + {file = "aiohttp-3.10.10-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7ea7ffc6d6d6f8a11e6f40091a1040995cdff02cfc9ba4c2f30a516cb2633554"}, + {file = "aiohttp-3.10.10-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:ef9c33cc5cbca35808f6c74be11eb7f5f6b14d2311be84a15b594bd3e58b5527"}, + {file = "aiohttp-3.10.10-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:ce0cdc074d540265bfeb31336e678b4e37316849d13b308607efa527e981f5c2"}, + {file = "aiohttp-3.10.10-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:597a079284b7ee65ee102bc3a6ea226a37d2b96d0418cc9047490f231dc09fe8"}, + {file = "aiohttp-3.10.10-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:7789050d9e5d0c309c706953e5e8876e38662d57d45f936902e176d19f1c58ab"}, + {file = "aiohttp-3.10.10-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:e7f8b04d83483577fd9200461b057c9f14ced334dcb053090cea1da9c8321a91"}, + {file = "aiohttp-3.10.10-cp39-cp39-win32.whl", hash = "sha256:c02a30b904282777d872266b87b20ed8cc0d1501855e27f831320f471d54d983"}, + {file = "aiohttp-3.10.10-cp39-cp39-win_amd64.whl", hash = "sha256:edfe3341033a6b53a5c522c802deb2079eee5cbfbb0af032a55064bd65c73a23"}, + {file = "aiohttp-3.10.10.tar.gz", hash = "sha256:0631dd7c9f0822cc61c88586ca76d5b5ada26538097d0f1df510b082bad3411a"}, +] + +[package.dependencies] +aiohappyeyeballs = ">=2.3.0" +aiosignal = ">=1.1.2" +async-timeout = {version = ">=4.0,<5.0", markers = "python_version < \"3.11\""} +attrs = ">=17.3.0" +frozenlist = ">=1.1.1" +multidict = ">=4.5,<7.0" +yarl = ">=1.12.0,<2.0" + +[package.extras] +speedups = ["Brotli", "aiodns (>=3.2.0)", "brotlicffi"] + +[[package]] +name = "aiosignal" +version = "1.3.1" +description = "aiosignal: a list of registered asynchronous callbacks" +optional = false +python-versions = ">=3.7" +files = [ + {file = "aiosignal-1.3.1-py3-none-any.whl", hash = "sha256:f8376fb07dd1e86a584e4fcdec80b36b7f81aac666ebc724e2c090300dd83b17"}, + {file = "aiosignal-1.3.1.tar.gz", hash = "sha256:54cd96e15e1649b75d6c87526a6ff0b6c1b0dd3459f43d9ca11d48c339b68cfc"}, +] + +[package.dependencies] +frozenlist = ">=1.1.0" + [[package]] name = "alembic" version = "1.14.0" @@ -32,35 +169,51 @@ files = [ [[package]] name = "anyio" -version = "4.6.2.post1" +version = "4.7.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" optional = false python-versions = ">=3.9" files = [ - {file = "anyio-4.6.2.post1-py3-none-any.whl", hash = "sha256:6d170c36fba3bdd840c73d3868c1e777e33676a69c3a72cf0a0d5d6d8009b61d"}, - {file = "anyio-4.6.2.post1.tar.gz", hash = "sha256:4c8bc31ccdb51c7f7bd251f51c609e038d63e34219b44aa86e47576389880b4c"}, + {file = "anyio-4.7.0-py3-none-any.whl", hash = "sha256:ea60c3723ab42ba6fff7e8ccb0488c898ec538ff4df1f1d5e642c3601d07e352"}, + {file = "anyio-4.7.0.tar.gz", hash = "sha256:2f834749c602966b7d456a7567cafcb309f96482b5081d14ac93ccd457f9dd48"}, ] [package.dependencies] exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} idna = ">=2.8" sniffio = ">=1.1" -typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} +typing_extensions = {version = ">=4.5", markers = "python_version < \"3.13\""} [package.extras] -doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] -test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21.0b1)"] +doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx_rtd_theme"] +test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21)"] trio = ["trio (>=0.26.1)"] +[[package]] +name = "asgiproxy" +version = "0.1.1" +description = "Tools for building HTTP and Websocket proxies for the asynchronous ASGI protocol" +optional = false +python-versions = ">=3.6" +files = [ + {file = "asgiproxy-0.1.1-py3-none-any.whl", hash = "sha256:f5175d43691367c51cc972dda0631096e5f23b3536ca29d859be52de87844734"}, + {file = "asgiproxy-0.1.1.tar.gz", hash = "sha256:9dec4d1d8680277dd52b41813d1123383b8a475b8dc82314e5f6729c6c5fa177"}, +] + +[package.dependencies] +aiohttp = "*" +starlette = "*" +websockets = "*" + [[package]] name = "async-timeout" -version = "5.0.1" +version = "4.0.3" description = "Timeout context manager for asyncio programs" optional = false -python-versions = ">=3.8" +python-versions = ">=3.7" files = [ - {file = "async_timeout-5.0.1-py3-none-any.whl", hash = "sha256:39e3809566ff85354557ec2398b55e096c8364bacac9405a7a1fa429e77fe76c"}, - {file = "async_timeout-5.0.1.tar.gz", hash = "sha256:d9321a7a3d5a6a5e187e824d2fa0793ce379a202935782d555d6e9d2735677d3"}, + {file = "async-timeout-4.0.3.tar.gz", hash = "sha256:4640d96be84d82d02ed59ea2b7105a0f7b33abe8703703cd0ab0bf87c427522f"}, + {file = "async_timeout-4.0.3-py3-none-any.whl", hash = "sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028"}, ] [[package]] @@ -386,73 +539,73 @@ files = [ [[package]] name = "coverage" -version = "7.6.7" +version = "7.6.9" description = "Code coverage measurement for Python" optional = false python-versions = ">=3.9" files = [ - {file = "coverage-7.6.7-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:108bb458827765d538abcbf8288599fee07d2743357bdd9b9dad456c287e121e"}, - {file = "coverage-7.6.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c973b2fe4dc445cb865ab369df7521df9c27bf40715c837a113edaa2aa9faf45"}, - {file = "coverage-7.6.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3c6b24007c4bcd0b19fac25763a7cac5035c735ae017e9a349b927cfc88f31c1"}, - {file = "coverage-7.6.7-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:acbb8af78f8f91b3b51f58f288c0994ba63c646bc1a8a22ad072e4e7e0a49f1c"}, - {file = "coverage-7.6.7-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad32a981bcdedb8d2ace03b05e4fd8dace8901eec64a532b00b15217d3677dd2"}, - {file = "coverage-7.6.7-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:34d23e28ccb26236718a3a78ba72744212aa383141961dd6825f6595005c8b06"}, - {file = "coverage-7.6.7-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e25bacb53a8c7325e34d45dddd2f2fbae0dbc230d0e2642e264a64e17322a777"}, - {file = "coverage-7.6.7-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:af05bbba896c4472a29408455fe31b3797b4d8648ed0a2ccac03e074a77e2314"}, - {file = "coverage-7.6.7-cp310-cp310-win32.whl", hash = "sha256:796c9b107d11d2d69e1849b2dfe41730134b526a49d3acb98ca02f4985eeff7a"}, - {file = "coverage-7.6.7-cp310-cp310-win_amd64.whl", hash = "sha256:987a8e3da7da4eed10a20491cf790589a8e5e07656b6dc22d3814c4d88faf163"}, - {file = "coverage-7.6.7-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:7e61b0e77ff4dddebb35a0e8bb5a68bf0f8b872407d8d9f0c726b65dfabe2469"}, - {file = "coverage-7.6.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1a5407a75ca4abc20d6252efeb238377a71ce7bda849c26c7a9bece8680a5d99"}, - {file = "coverage-7.6.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df002e59f2d29e889c37abd0b9ee0d0e6e38c24f5f55d71ff0e09e3412a340ec"}, - {file = "coverage-7.6.7-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:673184b3156cba06154825f25af33baa2671ddae6343f23175764e65a8c4c30b"}, - {file = "coverage-7.6.7-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e69ad502f1a2243f739f5bd60565d14a278be58be4c137d90799f2c263e7049a"}, - {file = "coverage-7.6.7-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:60dcf7605c50ea72a14490d0756daffef77a5be15ed1b9fea468b1c7bda1bc3b"}, - {file = "coverage-7.6.7-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:9c2eb378bebb2c8f65befcb5147877fc1c9fbc640fc0aad3add759b5df79d55d"}, - {file = "coverage-7.6.7-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:3c0317288f032221d35fa4cbc35d9f4923ff0dfd176c79c9b356e8ef8ef2dff4"}, - {file = "coverage-7.6.7-cp311-cp311-win32.whl", hash = "sha256:951aade8297358f3618a6e0660dc74f6b52233c42089d28525749fc8267dccd2"}, - {file = "coverage-7.6.7-cp311-cp311-win_amd64.whl", hash = "sha256:5e444b8e88339a2a67ce07d41faabb1d60d1004820cee5a2c2b54e2d8e429a0f"}, - {file = "coverage-7.6.7-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:f07ff574986bc3edb80e2c36391678a271d555f91fd1d332a1e0f4b5ea4b6ea9"}, - {file = "coverage-7.6.7-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:49ed5ee4109258973630c1f9d099c7e72c5c36605029f3a91fe9982c6076c82b"}, - {file = "coverage-7.6.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f3e8796434a8106b3ac025fd15417315d7a58ee3e600ad4dbcfddc3f4b14342c"}, - {file = "coverage-7.6.7-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a3b925300484a3294d1c70f6b2b810d6526f2929de954e5b6be2bf8caa1f12c1"}, - {file = "coverage-7.6.7-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3c42ec2c522e3ddd683dec5cdce8e62817afb648caedad9da725001fa530d354"}, - {file = "coverage-7.6.7-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:0266b62cbea568bd5e93a4da364d05de422110cbed5056d69339bd5af5685433"}, - {file = "coverage-7.6.7-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:e5f2a0f161d126ccc7038f1f3029184dbdf8f018230af17ef6fd6a707a5b881f"}, - {file = "coverage-7.6.7-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c132b5a22821f9b143f87446805e13580b67c670a548b96da945a8f6b4f2efbb"}, - {file = "coverage-7.6.7-cp312-cp312-win32.whl", hash = "sha256:7c07de0d2a110f02af30883cd7dddbe704887617d5c27cf373362667445a4c76"}, - {file = "coverage-7.6.7-cp312-cp312-win_amd64.whl", hash = "sha256:fd49c01e5057a451c30c9b892948976f5d38f2cbd04dc556a82743ba8e27ed8c"}, - {file = "coverage-7.6.7-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:46f21663e358beae6b368429ffadf14ed0a329996248a847a4322fb2e35d64d3"}, - {file = "coverage-7.6.7-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:40cca284c7c310d622a1677f105e8507441d1bb7c226f41978ba7c86979609ab"}, - {file = "coverage-7.6.7-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77256ad2345c29fe59ae861aa11cfc74579c88d4e8dbf121cbe46b8e32aec808"}, - {file = "coverage-7.6.7-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:87ea64b9fa52bf395272e54020537990a28078478167ade6c61da7ac04dc14bc"}, - {file = "coverage-7.6.7-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2d608a7808793e3615e54e9267519351c3ae204a6d85764d8337bd95993581a8"}, - {file = "coverage-7.6.7-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:cdd94501d65adc5c24f8a1a0eda110452ba62b3f4aeaba01e021c1ed9cb8f34a"}, - {file = "coverage-7.6.7-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:82c809a62e953867cf57e0548c2b8464207f5f3a6ff0e1e961683e79b89f2c55"}, - {file = "coverage-7.6.7-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:bb684694e99d0b791a43e9fc0fa58efc15ec357ac48d25b619f207c41f2fd384"}, - {file = "coverage-7.6.7-cp313-cp313-win32.whl", hash = "sha256:963e4a08cbb0af6623e61492c0ec4c0ec5c5cf74db5f6564f98248d27ee57d30"}, - {file = "coverage-7.6.7-cp313-cp313-win_amd64.whl", hash = "sha256:14045b8bfd5909196a90da145a37f9d335a5d988a83db34e80f41e965fb7cb42"}, - {file = "coverage-7.6.7-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:f2c7a045eef561e9544359a0bf5784b44e55cefc7261a20e730baa9220c83413"}, - {file = "coverage-7.6.7-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:5dd4e4a49d9c72a38d18d641135d2fb0bdf7b726ca60a103836b3d00a1182acd"}, - {file = "coverage-7.6.7-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c95e0fa3d1547cb6f021ab72f5c23402da2358beec0a8e6d19a368bd7b0fb37"}, - {file = "coverage-7.6.7-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f63e21ed474edd23f7501f89b53280014436e383a14b9bd77a648366c81dce7b"}, - {file = "coverage-7.6.7-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ead9b9605c54d15be228687552916c89c9683c215370c4a44f1f217d2adcc34d"}, - {file = "coverage-7.6.7-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:0573f5cbf39114270842d01872952d301027d2d6e2d84013f30966313cadb529"}, - {file = "coverage-7.6.7-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:e2c8e3384c12dfa19fa9a52f23eb091a8fad93b5b81a41b14c17c78e23dd1d8b"}, - {file = "coverage-7.6.7-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:70a56a2ec1869e6e9fa69ef6b76b1a8a7ef709972b9cc473f9ce9d26b5997ce3"}, - {file = "coverage-7.6.7-cp313-cp313t-win32.whl", hash = "sha256:dbba8210f5067398b2c4d96b4e64d8fb943644d5eb70be0d989067c8ca40c0f8"}, - {file = "coverage-7.6.7-cp313-cp313t-win_amd64.whl", hash = "sha256:dfd14bcae0c94004baba5184d1c935ae0d1231b8409eb6c103a5fd75e8ecdc56"}, - {file = "coverage-7.6.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:37a15573f988b67f7348916077c6d8ad43adb75e478d0910957394df397d2874"}, - {file = "coverage-7.6.7-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b6cce5c76985f81da3769c52203ee94722cd5d5889731cd70d31fee939b74bf0"}, - {file = "coverage-7.6.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1ab9763d291a17b527ac6fd11d1a9a9c358280adb320e9c2672a97af346ac2c"}, - {file = "coverage-7.6.7-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6cf96ceaa275f071f1bea3067f8fd43bec184a25a962c754024c973af871e1b7"}, - {file = "coverage-7.6.7-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aee9cf6b0134d6f932d219ce253ef0e624f4fa588ee64830fcba193269e4daa3"}, - {file = "coverage-7.6.7-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2bc3e45c16564cc72de09e37413262b9f99167803e5e48c6156bccdfb22c8327"}, - {file = "coverage-7.6.7-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:623e6965dcf4e28a3debaa6fcf4b99ee06d27218f46d43befe4db1c70841551c"}, - {file = "coverage-7.6.7-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:850cfd2d6fc26f8346f422920ac204e1d28814e32e3a58c19c91980fa74d8289"}, - {file = "coverage-7.6.7-cp39-cp39-win32.whl", hash = "sha256:c296263093f099da4f51b3dff1eff5d4959b527d4f2f419e16508c5da9e15e8c"}, - {file = "coverage-7.6.7-cp39-cp39-win_amd64.whl", hash = "sha256:90746521206c88bdb305a4bf3342b1b7316ab80f804d40c536fc7d329301ee13"}, - {file = "coverage-7.6.7-pp39.pp310-none-any.whl", hash = "sha256:0ddcb70b3a3a57581b450571b31cb774f23eb9519c2aaa6176d3a84c9fc57671"}, - {file = "coverage-7.6.7.tar.gz", hash = "sha256:d79d4826e41441c9a118ff045e4bccb9fdbdcb1d02413e7ea6eb5c87b5439d24"}, + {file = "coverage-7.6.9-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:85d9636f72e8991a1706b2b55b06c27545448baf9f6dbf51c4004609aacd7dcb"}, + {file = "coverage-7.6.9-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:608a7fd78c67bee8936378299a6cb9f5149bb80238c7a566fc3e6717a4e68710"}, + {file = "coverage-7.6.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:96d636c77af18b5cb664ddf12dab9b15a0cfe9c0bde715da38698c8cea748bfa"}, + {file = "coverage-7.6.9-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d75cded8a3cff93da9edc31446872d2997e327921d8eed86641efafd350e1df1"}, + {file = "coverage-7.6.9-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f7b15f589593110ae767ce997775d645b47e5cbbf54fd322f8ebea6277466cec"}, + {file = "coverage-7.6.9-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:44349150f6811b44b25574839b39ae35291f6496eb795b7366fef3bd3cf112d3"}, + {file = "coverage-7.6.9-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:d891c136b5b310d0e702e186d70cd16d1119ea8927347045124cb286b29297e5"}, + {file = "coverage-7.6.9-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:db1dab894cc139f67822a92910466531de5ea6034ddfd2b11c0d4c6257168073"}, + {file = "coverage-7.6.9-cp310-cp310-win32.whl", hash = "sha256:41ff7b0da5af71a51b53f501a3bac65fb0ec311ebed1632e58fc6107f03b9198"}, + {file = "coverage-7.6.9-cp310-cp310-win_amd64.whl", hash = "sha256:35371f8438028fdccfaf3570b31d98e8d9eda8bb1d6ab9473f5a390969e98717"}, + {file = "coverage-7.6.9-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:932fc826442132dde42ee52cf66d941f581c685a6313feebed358411238f60f9"}, + {file = "coverage-7.6.9-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:085161be5f3b30fd9b3e7b9a8c301f935c8313dcf928a07b116324abea2c1c2c"}, + {file = "coverage-7.6.9-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ccc660a77e1c2bf24ddbce969af9447a9474790160cfb23de6be4fa88e3951c7"}, + {file = "coverage-7.6.9-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c69e42c892c018cd3c8d90da61d845f50a8243062b19d228189b0224150018a9"}, + {file = "coverage-7.6.9-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0824a28ec542a0be22f60c6ac36d679e0e262e5353203bea81d44ee81fe9c6d4"}, + {file = "coverage-7.6.9-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:4401ae5fc52ad8d26d2a5d8a7428b0f0c72431683f8e63e42e70606374c311a1"}, + {file = "coverage-7.6.9-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:98caba4476a6c8d59ec1eb00c7dd862ba9beca34085642d46ed503cc2d440d4b"}, + {file = "coverage-7.6.9-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ee5defd1733fd6ec08b168bd4f5387d5b322f45ca9e0e6c817ea6c4cd36313e3"}, + {file = "coverage-7.6.9-cp311-cp311-win32.whl", hash = "sha256:f2d1ec60d6d256bdf298cb86b78dd715980828f50c46701abc3b0a2b3f8a0dc0"}, + {file = "coverage-7.6.9-cp311-cp311-win_amd64.whl", hash = "sha256:0d59fd927b1f04de57a2ba0137166d31c1a6dd9e764ad4af552912d70428c92b"}, + {file = "coverage-7.6.9-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:99e266ae0b5d15f1ca8d278a668df6f51cc4b854513daab5cae695ed7b721cf8"}, + {file = "coverage-7.6.9-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:9901d36492009a0a9b94b20e52ebfc8453bf49bb2b27bca2c9706f8b4f5a554a"}, + {file = "coverage-7.6.9-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:abd3e72dd5b97e3af4246cdada7738ef0e608168de952b837b8dd7e90341f015"}, + {file = "coverage-7.6.9-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ff74026a461eb0660366fb01c650c1d00f833a086b336bdad7ab00cc952072b3"}, + {file = "coverage-7.6.9-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65dad5a248823a4996724a88eb51d4b31587aa7aa428562dbe459c684e5787ae"}, + {file = "coverage-7.6.9-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:22be16571504c9ccea919fcedb459d5ab20d41172056206eb2994e2ff06118a4"}, + {file = "coverage-7.6.9-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:0f957943bc718b87144ecaee70762bc2bc3f1a7a53c7b861103546d3a403f0a6"}, + {file = "coverage-7.6.9-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:0ae1387db4aecb1f485fb70a6c0148c6cdaebb6038f1d40089b1fc84a5db556f"}, + {file = "coverage-7.6.9-cp312-cp312-win32.whl", hash = "sha256:1a330812d9cc7ac2182586f6d41b4d0fadf9be9049f350e0efb275c8ee8eb692"}, + {file = "coverage-7.6.9-cp312-cp312-win_amd64.whl", hash = "sha256:b12c6b18269ca471eedd41c1b6a1065b2f7827508edb9a7ed5555e9a56dcfc97"}, + {file = "coverage-7.6.9-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:899b8cd4781c400454f2f64f7776a5d87bbd7b3e7f7bda0cb18f857bb1334664"}, + {file = "coverage-7.6.9-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:61f70dc68bd36810972e55bbbe83674ea073dd1dcc121040a08cdf3416c5349c"}, + {file = "coverage-7.6.9-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8a289d23d4c46f1a82d5db4abeb40b9b5be91731ee19a379d15790e53031c014"}, + {file = "coverage-7.6.9-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7e216d8044a356fc0337c7a2a0536d6de07888d7bcda76febcb8adc50bdbbd00"}, + {file = "coverage-7.6.9-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3c026eb44f744acaa2bda7493dad903aa5bf5fc4f2554293a798d5606710055d"}, + {file = "coverage-7.6.9-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:e77363e8425325384f9d49272c54045bbed2f478e9dd698dbc65dbc37860eb0a"}, + {file = "coverage-7.6.9-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:777abfab476cf83b5177b84d7486497e034eb9eaea0d746ce0c1268c71652077"}, + {file = "coverage-7.6.9-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:447af20e25fdbe16f26e84eb714ba21d98868705cb138252d28bc400381f6ffb"}, + {file = "coverage-7.6.9-cp313-cp313-win32.whl", hash = "sha256:d872ec5aeb086cbea771c573600d47944eea2dcba8be5f3ee649bfe3cb8dc9ba"}, + {file = "coverage-7.6.9-cp313-cp313-win_amd64.whl", hash = "sha256:fd1213c86e48dfdc5a0cc676551db467495a95a662d2396ecd58e719191446e1"}, + {file = "coverage-7.6.9-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:ba9e7484d286cd5a43744e5f47b0b3fb457865baf07bafc6bee91896364e1419"}, + {file = "coverage-7.6.9-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:e5ea1cf0872ee455c03e5674b5bca5e3e68e159379c1af0903e89f5eba9ccc3a"}, + {file = "coverage-7.6.9-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2d10e07aa2b91835d6abec555ec8b2733347956991901eea6ffac295f83a30e4"}, + {file = "coverage-7.6.9-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:13a9e2d3ee855db3dd6ea1ba5203316a1b1fd8eaeffc37c5b54987e61e4194ae"}, + {file = "coverage-7.6.9-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c38bf15a40ccf5619fa2fe8f26106c7e8e080d7760aeccb3722664c8656b030"}, + {file = "coverage-7.6.9-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:d5275455b3e4627c8e7154feaf7ee0743c2e7af82f6e3b561967b1cca755a0be"}, + {file = "coverage-7.6.9-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:8f8770dfc6e2c6a2d4569f411015c8d751c980d17a14b0530da2d7f27ffdd88e"}, + {file = "coverage-7.6.9-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:8d2dfa71665a29b153a9681edb1c8d9c1ea50dfc2375fb4dac99ea7e21a0bcd9"}, + {file = "coverage-7.6.9-cp313-cp313t-win32.whl", hash = "sha256:5e6b86b5847a016d0fbd31ffe1001b63355ed309651851295315031ea7eb5a9b"}, + {file = "coverage-7.6.9-cp313-cp313t-win_amd64.whl", hash = "sha256:97ddc94d46088304772d21b060041c97fc16bdda13c6c7f9d8fcd8d5ae0d8611"}, + {file = "coverage-7.6.9-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:adb697c0bd35100dc690de83154627fbab1f4f3c0386df266dded865fc50a902"}, + {file = "coverage-7.6.9-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:be57b6d56e49c2739cdf776839a92330e933dd5e5d929966fbbd380c77f060be"}, + {file = "coverage-7.6.9-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f1592791f8204ae9166de22ba7e6705fa4ebd02936c09436a1bb85aabca3e599"}, + {file = "coverage-7.6.9-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4e12ae8cc979cf83d258acb5e1f1cf2f3f83524d1564a49d20b8bec14b637f08"}, + {file = "coverage-7.6.9-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bb5555cff66c4d3d6213a296b360f9e1a8e323e74e0426b6c10ed7f4d021e464"}, + {file = "coverage-7.6.9-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:b9389a429e0e5142e69d5bf4a435dd688c14478a19bb901735cdf75e57b13845"}, + {file = "coverage-7.6.9-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:592ac539812e9b46046620341498caf09ca21023c41c893e1eb9dbda00a70cbf"}, + {file = "coverage-7.6.9-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:a27801adef24cc30871da98a105f77995e13a25a505a0161911f6aafbd66e678"}, + {file = "coverage-7.6.9-cp39-cp39-win32.whl", hash = "sha256:8e3c3e38930cfb729cb8137d7f055e5a473ddaf1217966aa6238c88bd9fd50e6"}, + {file = "coverage-7.6.9-cp39-cp39-win_amd64.whl", hash = "sha256:e28bf44afa2b187cc9f41749138a64435bf340adfcacb5b2290c070ce99839d4"}, + {file = "coverage-7.6.9-pp39.pp310-none-any.whl", hash = "sha256:f3ca78518bc6bc92828cd11867b121891d75cae4ea9e908d72030609b996db1b"}, + {file = "coverage-7.6.9.tar.gz", hash = "sha256:4a8d8977b0c6ef5aeadcb644da9e69ae0dcfe66ec7f368c89c72e058bd71164d"}, ] [package.dependencies] @@ -585,13 +738,13 @@ test = ["pytest (>=6)"] [[package]] name = "fastapi" -version = "0.115.5" +version = "0.115.6" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" optional = false python-versions = ">=3.8" files = [ - {file = "fastapi-0.115.5-py3-none-any.whl", hash = "sha256:596b95adbe1474da47049e802f9a65ab2ffa9c2b07e7efee70eb8a66c9f2f796"}, - {file = "fastapi-0.115.5.tar.gz", hash = "sha256:0e7a4d0dc0d01c68df21887cce0945e72d3c48b9f4f79dfe7a7d53aa08fbb289"}, + {file = "fastapi-0.115.6-py3-none-any.whl", hash = "sha256:e9240b29e36fa8f4bb7290316988e90c381e5092e0cbe84e7818cc3713bcf305"}, + {file = "fastapi-0.115.6.tar.gz", hash = "sha256:9ec46f7addc14ea472958a96aae5b5de65f39721a46aaf5705c480d9a8b76654"}, ] [package.dependencies] @@ -619,6 +772,107 @@ docs = ["furo (>=2024.8.6)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2. testing = ["covdefaults (>=2.3)", "coverage (>=7.6.1)", "diff-cover (>=9.2)", "pytest (>=8.3.3)", "pytest-asyncio (>=0.24)", "pytest-cov (>=5)", "pytest-mock (>=3.14)", "pytest-timeout (>=2.3.1)", "virtualenv (>=20.26.4)"] typing = ["typing-extensions (>=4.12.2)"] +[[package]] +name = "frozenlist" +version = "1.5.0" +description = "A list-like structure which implements collections.abc.MutableSequence" +optional = false +python-versions = ">=3.8" +files = [ + {file = "frozenlist-1.5.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:5b6a66c18b5b9dd261ca98dffcb826a525334b2f29e7caa54e182255c5f6a65a"}, + {file = "frozenlist-1.5.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d1b3eb7b05ea246510b43a7e53ed1653e55c2121019a97e60cad7efb881a97bb"}, + {file = "frozenlist-1.5.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:15538c0cbf0e4fa11d1e3a71f823524b0c46299aed6e10ebb4c2089abd8c3bec"}, + {file = "frozenlist-1.5.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e79225373c317ff1e35f210dd5f1344ff31066ba8067c307ab60254cd3a78ad5"}, + {file = "frozenlist-1.5.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9272fa73ca71266702c4c3e2d4a28553ea03418e591e377a03b8e3659d94fa76"}, + {file = "frozenlist-1.5.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:498524025a5b8ba81695761d78c8dd7382ac0b052f34e66939c42df860b8ff17"}, + {file = "frozenlist-1.5.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:92b5278ed9d50fe610185ecd23c55d8b307d75ca18e94c0e7de328089ac5dcba"}, + {file = "frozenlist-1.5.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f3c8c1dacd037df16e85227bac13cca58c30da836c6f936ba1df0c05d046d8d"}, + {file = "frozenlist-1.5.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f2ac49a9bedb996086057b75bf93538240538c6d9b38e57c82d51f75a73409d2"}, + {file = "frozenlist-1.5.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e66cc454f97053b79c2ab09c17fbe3c825ea6b4de20baf1be28919460dd7877f"}, + {file = "frozenlist-1.5.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:5a3ba5f9a0dfed20337d3e966dc359784c9f96503674c2faf015f7fe8e96798c"}, + {file = "frozenlist-1.5.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:6321899477db90bdeb9299ac3627a6a53c7399c8cd58d25da094007402b039ab"}, + {file = "frozenlist-1.5.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:76e4753701248476e6286f2ef492af900ea67d9706a0155335a40ea21bf3b2f5"}, + {file = "frozenlist-1.5.0-cp310-cp310-win32.whl", hash = "sha256:977701c081c0241d0955c9586ffdd9ce44f7a7795df39b9151cd9a6fd0ce4cfb"}, + {file = "frozenlist-1.5.0-cp310-cp310-win_amd64.whl", hash = "sha256:189f03b53e64144f90990d29a27ec4f7997d91ed3d01b51fa39d2dbe77540fd4"}, + {file = "frozenlist-1.5.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:fd74520371c3c4175142d02a976aee0b4cb4a7cc912a60586ffd8d5929979b30"}, + {file = "frozenlist-1.5.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2f3f7a0fbc219fb4455264cae4d9f01ad41ae6ee8524500f381de64ffaa077d5"}, + {file = "frozenlist-1.5.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f47c9c9028f55a04ac254346e92977bf0f166c483c74b4232bee19a6697e4778"}, + {file = "frozenlist-1.5.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0996c66760924da6e88922756d99b47512a71cfd45215f3570bf1e0b694c206a"}, + {file = "frozenlist-1.5.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a2fe128eb4edeabe11896cb6af88fca5346059f6c8d807e3b910069f39157869"}, + {file = "frozenlist-1.5.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1a8ea951bbb6cacd492e3948b8da8c502a3f814f5d20935aae74b5df2b19cf3d"}, + {file = "frozenlist-1.5.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:de537c11e4aa01d37db0d403b57bd6f0546e71a82347a97c6a9f0dcc532b3a45"}, + {file = "frozenlist-1.5.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c2623347b933fcb9095841f1cc5d4ff0b278addd743e0e966cb3d460278840d"}, + {file = "frozenlist-1.5.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:cee6798eaf8b1416ef6909b06f7dc04b60755206bddc599f52232606e18179d3"}, + {file = "frozenlist-1.5.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:f5f9da7f5dbc00a604fe74aa02ae7c98bcede8a3b8b9666f9f86fc13993bc71a"}, + {file = "frozenlist-1.5.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:90646abbc7a5d5c7c19461d2e3eeb76eb0b204919e6ece342feb6032c9325ae9"}, + {file = "frozenlist-1.5.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:bdac3c7d9b705d253b2ce370fde941836a5f8b3c5c2b8fd70940a3ea3af7f4f2"}, + {file = "frozenlist-1.5.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:03d33c2ddbc1816237a67f66336616416e2bbb6beb306e5f890f2eb22b959cdf"}, + {file = "frozenlist-1.5.0-cp311-cp311-win32.whl", hash = "sha256:237f6b23ee0f44066219dae14c70ae38a63f0440ce6750f868ee08775073f942"}, + {file = "frozenlist-1.5.0-cp311-cp311-win_amd64.whl", hash = "sha256:0cc974cc93d32c42e7b0f6cf242a6bd941c57c61b618e78b6c0a96cb72788c1d"}, + {file = "frozenlist-1.5.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:31115ba75889723431aa9a4e77d5f398f5cf976eea3bdf61749731f62d4a4a21"}, + {file = "frozenlist-1.5.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7437601c4d89d070eac8323f121fcf25f88674627505334654fd027b091db09d"}, + {file = "frozenlist-1.5.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7948140d9f8ece1745be806f2bfdf390127cf1a763b925c4a805c603df5e697e"}, + {file = "frozenlist-1.5.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:feeb64bc9bcc6b45c6311c9e9b99406660a9c05ca8a5b30d14a78555088b0b3a"}, + {file = "frozenlist-1.5.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:683173d371daad49cffb8309779e886e59c2f369430ad28fe715f66d08d4ab1a"}, + {file = "frozenlist-1.5.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7d57d8f702221405a9d9b40f9da8ac2e4a1a8b5285aac6100f3393675f0a85ee"}, + {file = "frozenlist-1.5.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:30c72000fbcc35b129cb09956836c7d7abf78ab5416595e4857d1cae8d6251a6"}, + {file = "frozenlist-1.5.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:000a77d6034fbad9b6bb880f7ec073027908f1b40254b5d6f26210d2dab1240e"}, + {file = "frozenlist-1.5.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:5d7f5a50342475962eb18b740f3beecc685a15b52c91f7d975257e13e029eca9"}, + {file = "frozenlist-1.5.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:87f724d055eb4785d9be84e9ebf0f24e392ddfad00b3fe036e43f489fafc9039"}, + {file = "frozenlist-1.5.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:6e9080bb2fb195a046e5177f10d9d82b8a204c0736a97a153c2466127de87784"}, + {file = "frozenlist-1.5.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:9b93d7aaa36c966fa42efcaf716e6b3900438632a626fb09c049f6a2f09fc631"}, + {file = "frozenlist-1.5.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:52ef692a4bc60a6dd57f507429636c2af8b6046db8b31b18dac02cbc8f507f7f"}, + {file = "frozenlist-1.5.0-cp312-cp312-win32.whl", hash = "sha256:29d94c256679247b33a3dc96cce0f93cbc69c23bf75ff715919332fdbb6a32b8"}, + {file = "frozenlist-1.5.0-cp312-cp312-win_amd64.whl", hash = "sha256:8969190d709e7c48ea386db202d708eb94bdb29207a1f269bab1196ce0dcca1f"}, + {file = "frozenlist-1.5.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:7a1a048f9215c90973402e26c01d1cff8a209e1f1b53f72b95c13db61b00f953"}, + {file = "frozenlist-1.5.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:dd47a5181ce5fcb463b5d9e17ecfdb02b678cca31280639255ce9d0e5aa67af0"}, + {file = "frozenlist-1.5.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1431d60b36d15cda188ea222033eec8e0eab488f39a272461f2e6d9e1a8e63c2"}, + {file = "frozenlist-1.5.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6482a5851f5d72767fbd0e507e80737f9c8646ae7fd303def99bfe813f76cf7f"}, + {file = "frozenlist-1.5.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:44c49271a937625619e862baacbd037a7ef86dd1ee215afc298a417ff3270608"}, + {file = "frozenlist-1.5.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:12f78f98c2f1c2429d42e6a485f433722b0061d5c0b0139efa64f396efb5886b"}, + {file = "frozenlist-1.5.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ce3aa154c452d2467487765e3adc730a8c153af77ad84096bc19ce19a2400840"}, + {file = "frozenlist-1.5.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9b7dc0c4338e6b8b091e8faf0db3168a37101943e687f373dce00959583f7439"}, + {file = "frozenlist-1.5.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:45e0896250900b5aa25180f9aec243e84e92ac84bd4a74d9ad4138ef3f5c97de"}, + {file = "frozenlist-1.5.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:561eb1c9579d495fddb6da8959fd2a1fca2c6d060d4113f5844b433fc02f2641"}, + {file = "frozenlist-1.5.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:df6e2f325bfee1f49f81aaac97d2aa757c7646534a06f8f577ce184afe2f0a9e"}, + {file = "frozenlist-1.5.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:140228863501b44b809fb39ec56b5d4071f4d0aa6d216c19cbb08b8c5a7eadb9"}, + {file = "frozenlist-1.5.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:7707a25d6a77f5d27ea7dc7d1fc608aa0a478193823f88511ef5e6b8a48f9d03"}, + {file = "frozenlist-1.5.0-cp313-cp313-win32.whl", hash = "sha256:31a9ac2b38ab9b5a8933b693db4939764ad3f299fcaa931a3e605bc3460e693c"}, + {file = "frozenlist-1.5.0-cp313-cp313-win_amd64.whl", hash = "sha256:11aabdd62b8b9c4b84081a3c246506d1cddd2dd93ff0ad53ede5defec7886b28"}, + {file = "frozenlist-1.5.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:dd94994fc91a6177bfaafd7d9fd951bc8689b0a98168aa26b5f543868548d3ca"}, + {file = "frozenlist-1.5.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2d0da8bbec082bf6bf18345b180958775363588678f64998c2b7609e34719b10"}, + {file = "frozenlist-1.5.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:73f2e31ea8dd7df61a359b731716018c2be196e5bb3b74ddba107f694fbd7604"}, + {file = "frozenlist-1.5.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:828afae9f17e6de596825cf4228ff28fbdf6065974e5ac1410cecc22f699d2b3"}, + {file = "frozenlist-1.5.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f1577515d35ed5649d52ab4319db757bb881ce3b2b796d7283e6634d99ace307"}, + {file = "frozenlist-1.5.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2150cc6305a2c2ab33299453e2968611dacb970d2283a14955923062c8d00b10"}, + {file = "frozenlist-1.5.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a72b7a6e3cd2725eff67cd64c8f13335ee18fc3c7befc05aed043d24c7b9ccb9"}, + {file = "frozenlist-1.5.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c16d2fa63e0800723139137d667e1056bee1a1cf7965153d2d104b62855e9b99"}, + {file = "frozenlist-1.5.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:17dcc32fc7bda7ce5875435003220a457bcfa34ab7924a49a1c19f55b6ee185c"}, + {file = "frozenlist-1.5.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:97160e245ea33d8609cd2b8fd997c850b56db147a304a262abc2b3be021a9171"}, + {file = "frozenlist-1.5.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:f1e6540b7fa044eee0bb5111ada694cf3dc15f2b0347ca125ee9ca984d5e9e6e"}, + {file = "frozenlist-1.5.0-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:91d6c171862df0a6c61479d9724f22efb6109111017c87567cfeb7b5d1449fdf"}, + {file = "frozenlist-1.5.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:c1fac3e2ace2eb1052e9f7c7db480818371134410e1f5c55d65e8f3ac6d1407e"}, + {file = "frozenlist-1.5.0-cp38-cp38-win32.whl", hash = "sha256:b97f7b575ab4a8af9b7bc1d2ef7f29d3afee2226bd03ca3875c16451ad5a7723"}, + {file = "frozenlist-1.5.0-cp38-cp38-win_amd64.whl", hash = "sha256:374ca2dabdccad8e2a76d40b1d037f5bd16824933bf7bcea3e59c891fd4a0923"}, + {file = "frozenlist-1.5.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:9bbcdfaf4af7ce002694a4e10a0159d5a8d20056a12b05b45cea944a4953f972"}, + {file = "frozenlist-1.5.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1893f948bf6681733aaccf36c5232c231e3b5166d607c5fa77773611df6dc336"}, + {file = "frozenlist-1.5.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2b5e23253bb709ef57a8e95e6ae48daa9ac5f265637529e4ce6b003a37b2621f"}, + {file = "frozenlist-1.5.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0f253985bb515ecd89629db13cb58d702035ecd8cfbca7d7a7e29a0e6d39af5f"}, + {file = "frozenlist-1.5.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:04a5c6babd5e8fb7d3c871dc8b321166b80e41b637c31a995ed844a6139942b6"}, + {file = "frozenlist-1.5.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a9fe0f1c29ba24ba6ff6abf688cb0b7cf1efab6b6aa6adc55441773c252f7411"}, + {file = "frozenlist-1.5.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:226d72559fa19babe2ccd920273e767c96a49b9d3d38badd7c91a0fdeda8ea08"}, + {file = "frozenlist-1.5.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15b731db116ab3aedec558573c1a5eec78822b32292fe4f2f0345b7f697745c2"}, + {file = "frozenlist-1.5.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:366d8f93e3edfe5a918c874702f78faac300209a4d5bf38352b2c1bdc07a766d"}, + {file = "frozenlist-1.5.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:1b96af8c582b94d381a1c1f51ffaedeb77c821c690ea5f01da3d70a487dd0a9b"}, + {file = "frozenlist-1.5.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:c03eff4a41bd4e38415cbed054bbaff4a075b093e2394b6915dca34a40d1e38b"}, + {file = "frozenlist-1.5.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:50cf5e7ee9b98f22bdecbabf3800ae78ddcc26e4a435515fc72d97903e8488e0"}, + {file = "frozenlist-1.5.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1e76bfbc72353269c44e0bc2cfe171900fbf7f722ad74c9a7b638052afe6a00c"}, + {file = "frozenlist-1.5.0-cp39-cp39-win32.whl", hash = "sha256:666534d15ba8f0fda3f53969117383d5dc021266b3c1a42c9ec4855e4b58b9d3"}, + {file = "frozenlist-1.5.0-cp39-cp39-win_amd64.whl", hash = "sha256:5c28f4b5dbef8a0d8aad0d4de24d1e9e981728628afaf4ea0792f5d0939372f0"}, + {file = "frozenlist-1.5.0-py3-none-any.whl", hash = "sha256:d994863bba198a4a518b467bb971c56e1db3f180a25c6cf7bb1949c267f748c3"}, + {file = "frozenlist-1.5.0.tar.gz", hash = "sha256:81d5af29e61b9c8348e876d442253723928dce6433e0e76cd925cd83f1b4b817"}, +] + [[package]] name = "greenlet" version = "3.1.1" @@ -760,13 +1014,13 @@ trio = ["trio (>=0.22.0,<1.0)"] [[package]] name = "httpx" -version = "0.27.2" +version = "0.28.1" description = "The next generation HTTP client." optional = false python-versions = ">=3.8" files = [ - {file = "httpx-0.27.2-py3-none-any.whl", hash = "sha256:7bb2708e112d8fdd7829cd4243970f0c223274051cb35ee80c03301ee29a3df0"}, - {file = "httpx-0.27.2.tar.gz", hash = "sha256:f7c2be1d2f3c3c3160d441802406b206c2b76f5947b11115e6df10c6c65e66c2"}, + {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, + {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, ] [package.dependencies] @@ -774,7 +1028,6 @@ anyio = "*" certifi = "*" httpcore = "==1.*" idna = "*" -sniffio = "*" [package.extras] brotli = ["brotli", "brotlicffi"] @@ -785,13 +1038,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "identify" -version = "2.6.2" +version = "2.6.3" description = "File identification library for Python" optional = false python-versions = ">=3.9" files = [ - {file = "identify-2.6.2-py2.py3-none-any.whl", hash = "sha256:c097384259f49e372f4ea00a19719d95ae27dd5ff0fd77ad630aa891306b82f3"}, - {file = "identify-2.6.2.tar.gz", hash = "sha256:fab5c716c24d7a789775228823797296a2994b075fb6080ac83a102772a98cbd"}, + {file = "identify-2.6.3-py2.py3-none-any.whl", hash = "sha256:9edba65473324c2ea9684b1f944fe3191db3345e50b6d04571d10ed164f8d7bd"}, + {file = "identify-2.6.3.tar.gz", hash = "sha256:62f5dae9b5fef52c84cc188514e9ea4f3f636b1d8799ab5ebc475471f9e47a02"}, ] [package.extras] @@ -985,13 +1238,13 @@ test = ["pytest (>=7.4)", "pytest-cov (>=4.1)"] [[package]] name = "mako" -version = "1.3.6" +version = "1.3.8" description = "A super-fast templating language that borrows the best ideas from the existing templating languages." optional = false python-versions = ">=3.8" files = [ - {file = "Mako-1.3.6-py3-none-any.whl", hash = "sha256:a91198468092a2f1a0de86ca92690fb0cfc43ca90ee17e15d93662b4c04b241a"}, - {file = "mako-1.3.6.tar.gz", hash = "sha256:9ec3a1583713479fae654f83ed9fa8c9a4c16b7bb0daba0e6bbebff50c0d983d"}, + {file = "Mako-1.3.8-py3-none-any.whl", hash = "sha256:42f48953c7eb91332040ff567eb7eea69b22e7a4affbc5ba8e845e8f730f6627"}, + {file = "mako-1.3.8.tar.gz", hash = "sha256:577b97e414580d3e088d47c2dbbe9594aa7a5146ed2875d4dfa9075af2dd3cc8"}, ] [package.dependencies] @@ -1118,29 +1371,141 @@ files = [ {file = "more_itertools-10.5.0-py3-none-any.whl", hash = "sha256:037b0d3203ce90cca8ab1defbbdac29d5f993fc20131f3664dc8d6acfa872aef"}, ] +[[package]] +name = "multidict" +version = "6.1.0" +description = "multidict implementation" +optional = false +python-versions = ">=3.8" +files = [ + {file = "multidict-6.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:3380252550e372e8511d49481bd836264c009adb826b23fefcc5dd3c69692f60"}, + {file = "multidict-6.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:99f826cbf970077383d7de805c0681799491cb939c25450b9b5b3ced03ca99f1"}, + {file = "multidict-6.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a114d03b938376557927ab23f1e950827c3b893ccb94b62fd95d430fd0e5cf53"}, + {file = "multidict-6.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b1c416351ee6271b2f49b56ad7f308072f6f44b37118d69c2cad94f3fa8a40d5"}, + {file = "multidict-6.1.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6b5d83030255983181005e6cfbac1617ce9746b219bc2aad52201ad121226581"}, + {file = "multidict-6.1.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3e97b5e938051226dc025ec80980c285b053ffb1e25a3db2a3aa3bc046bf7f56"}, + {file = "multidict-6.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d618649d4e70ac6efcbba75be98b26ef5078faad23592f9b51ca492953012429"}, + {file = "multidict-6.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:10524ebd769727ac77ef2278390fb0068d83f3acb7773792a5080f2b0abf7748"}, + {file = "multidict-6.1.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:ff3827aef427c89a25cc96ded1759271a93603aba9fb977a6d264648ebf989db"}, + {file = "multidict-6.1.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:06809f4f0f7ab7ea2cabf9caca7d79c22c0758b58a71f9d32943ae13c7ace056"}, + {file = "multidict-6.1.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:f179dee3b863ab1c59580ff60f9d99f632f34ccb38bf67a33ec6b3ecadd0fd76"}, + {file = "multidict-6.1.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:aaed8b0562be4a0876ee3b6946f6869b7bcdb571a5d1496683505944e268b160"}, + {file = "multidict-6.1.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:3c8b88a2ccf5493b6c8da9076fb151ba106960a2df90c2633f342f120751a9e7"}, + {file = "multidict-6.1.0-cp310-cp310-win32.whl", hash = "sha256:4a9cb68166a34117d6646c0023c7b759bf197bee5ad4272f420a0141d7eb03a0"}, + {file = "multidict-6.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:20b9b5fbe0b88d0bdef2012ef7dee867f874b72528cf1d08f1d59b0e3850129d"}, + {file = "multidict-6.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:3efe2c2cb5763f2f1b275ad2bf7a287d3f7ebbef35648a9726e3b69284a4f3d6"}, + {file = "multidict-6.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c7053d3b0353a8b9de430a4f4b4268ac9a4fb3481af37dfe49825bf45ca24156"}, + {file = "multidict-6.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:27e5fc84ccef8dfaabb09d82b7d179c7cf1a3fbc8a966f8274fcb4ab2eb4cadb"}, + {file = "multidict-6.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0e2b90b43e696f25c62656389d32236e049568b39320e2735d51f08fd362761b"}, + {file = "multidict-6.1.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d83a047959d38a7ff552ff94be767b7fd79b831ad1cd9920662db05fec24fe72"}, + {file = "multidict-6.1.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d1a9dd711d0877a1ece3d2e4fea11a8e75741ca21954c919406b44e7cf971304"}, + {file = "multidict-6.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec2abea24d98246b94913b76a125e855eb5c434f7c46546046372fe60f666351"}, + {file = "multidict-6.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4867cafcbc6585e4b678876c489b9273b13e9fff9f6d6d66add5e15d11d926cb"}, + {file = "multidict-6.1.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:5b48204e8d955c47c55b72779802b219a39acc3ee3d0116d5080c388970b76e3"}, + {file = "multidict-6.1.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:d8fff389528cad1618fb4b26b95550327495462cd745d879a8c7c2115248e399"}, + {file = "multidict-6.1.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:a7a9541cd308eed5e30318430a9c74d2132e9a8cb46b901326272d780bf2d423"}, + {file = "multidict-6.1.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:da1758c76f50c39a2efd5e9859ce7d776317eb1dd34317c8152ac9251fc574a3"}, + {file = "multidict-6.1.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:c943a53e9186688b45b323602298ab727d8865d8c9ee0b17f8d62d14b56f0753"}, + {file = "multidict-6.1.0-cp311-cp311-win32.whl", hash = "sha256:90f8717cb649eea3504091e640a1b8568faad18bd4b9fcd692853a04475a4b80"}, + {file = "multidict-6.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:82176036e65644a6cc5bd619f65f6f19781e8ec2e5330f51aa9ada7504cc1926"}, + {file = "multidict-6.1.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:b04772ed465fa3cc947db808fa306d79b43e896beb677a56fb2347ca1a49c1fa"}, + {file = "multidict-6.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:6180c0ae073bddeb5a97a38c03f30c233e0a4d39cd86166251617d1bbd0af436"}, + {file = "multidict-6.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:071120490b47aa997cca00666923a83f02c7fbb44f71cf7f136df753f7fa8761"}, + {file = "multidict-6.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:50b3a2710631848991d0bf7de077502e8994c804bb805aeb2925a981de58ec2e"}, + {file = "multidict-6.1.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b58c621844d55e71c1b7f7c498ce5aa6985d743a1a59034c57a905b3f153c1ef"}, + {file = "multidict-6.1.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:55b6d90641869892caa9ca42ff913f7ff1c5ece06474fbd32fb2cf6834726c95"}, + {file = "multidict-6.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4b820514bfc0b98a30e3d85462084779900347e4d49267f747ff54060cc33925"}, + {file = "multidict-6.1.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:10a9b09aba0c5b48c53761b7c720aaaf7cf236d5fe394cd399c7ba662d5f9966"}, + {file = "multidict-6.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1e16bf3e5fc9f44632affb159d30a437bfe286ce9e02754759be5536b169b305"}, + {file = "multidict-6.1.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:76f364861c3bfc98cbbcbd402d83454ed9e01a5224bb3a28bf70002a230f73e2"}, + {file = "multidict-6.1.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:820c661588bd01a0aa62a1283f20d2be4281b086f80dad9e955e690c75fb54a2"}, + {file = "multidict-6.1.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:0e5f362e895bc5b9e67fe6e4ded2492d8124bdf817827f33c5b46c2fe3ffaca6"}, + {file = "multidict-6.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:3ec660d19bbc671e3a6443325f07263be452c453ac9e512f5eb935e7d4ac28b3"}, + {file = "multidict-6.1.0-cp312-cp312-win32.whl", hash = "sha256:58130ecf8f7b8112cdb841486404f1282b9c86ccb30d3519faf301b2e5659133"}, + {file = "multidict-6.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:188215fc0aafb8e03341995e7c4797860181562380f81ed0a87ff455b70bf1f1"}, + {file = "multidict-6.1.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:d569388c381b24671589335a3be6e1d45546c2988c2ebe30fdcada8457a31008"}, + {file = "multidict-6.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:052e10d2d37810b99cc170b785945421141bf7bb7d2f8799d431e7db229c385f"}, + {file = "multidict-6.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f90c822a402cb865e396a504f9fc8173ef34212a342d92e362ca498cad308e28"}, + {file = "multidict-6.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b225d95519a5bf73860323e633a664b0d85ad3d5bede6d30d95b35d4dfe8805b"}, + {file = "multidict-6.1.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:23bfd518810af7de1116313ebd9092cb9aa629beb12f6ed631ad53356ed6b86c"}, + {file = "multidict-6.1.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5c09fcfdccdd0b57867577b719c69e347a436b86cd83747f179dbf0cc0d4c1f3"}, + {file = "multidict-6.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bf6bea52ec97e95560af5ae576bdac3aa3aae0b6758c6efa115236d9e07dae44"}, + {file = "multidict-6.1.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:57feec87371dbb3520da6192213c7d6fc892d5589a93db548331954de8248fd2"}, + {file = "multidict-6.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0c3f390dc53279cbc8ba976e5f8035eab997829066756d811616b652b00a23a3"}, + {file = "multidict-6.1.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:59bfeae4b25ec05b34f1956eaa1cb38032282cd4dfabc5056d0a1ec4d696d3aa"}, + {file = "multidict-6.1.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:b2f59caeaf7632cc633b5cf6fc449372b83bbdf0da4ae04d5be36118e46cc0aa"}, + {file = "multidict-6.1.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:37bb93b2178e02b7b618893990941900fd25b6b9ac0fa49931a40aecdf083fe4"}, + {file = "multidict-6.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4e9f48f58c2c523d5a06faea47866cd35b32655c46b443f163d08c6d0ddb17d6"}, + {file = "multidict-6.1.0-cp313-cp313-win32.whl", hash = "sha256:3a37ffb35399029b45c6cc33640a92bef403c9fd388acce75cdc88f58bd19a81"}, + {file = "multidict-6.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:e9aa71e15d9d9beaad2c6b9319edcdc0a49a43ef5c0a4c8265ca9ee7d6c67774"}, + {file = "multidict-6.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:db7457bac39421addd0c8449933ac32d8042aae84a14911a757ae6ca3eef1392"}, + {file = "multidict-6.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d094ddec350a2fb899fec68d8353c78233debde9b7d8b4beeafa70825f1c281a"}, + {file = "multidict-6.1.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:5845c1fd4866bb5dd3125d89b90e57ed3138241540897de748cdf19de8a2fca2"}, + {file = "multidict-6.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9079dfc6a70abe341f521f78405b8949f96db48da98aeb43f9907f342f627cdc"}, + {file = "multidict-6.1.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3914f5aaa0f36d5d60e8ece6a308ee1c9784cd75ec8151062614657a114c4478"}, + {file = "multidict-6.1.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c08be4f460903e5a9d0f76818db3250f12e9c344e79314d1d570fc69d7f4eae4"}, + {file = "multidict-6.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d093be959277cb7dee84b801eb1af388b6ad3ca6a6b6bf1ed7585895789d027d"}, + {file = "multidict-6.1.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3702ea6872c5a2a4eeefa6ffd36b042e9773f05b1f37ae3ef7264b1163c2dcf6"}, + {file = "multidict-6.1.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:2090f6a85cafc5b2db085124d752757c9d251548cedabe9bd31afe6363e0aff2"}, + {file = "multidict-6.1.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:f67f217af4b1ff66c68a87318012de788dd95fcfeb24cc889011f4e1c7454dfd"}, + {file = "multidict-6.1.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:189f652a87e876098bbc67b4da1049afb5f5dfbaa310dd67c594b01c10388db6"}, + {file = "multidict-6.1.0-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:6bb5992037f7a9eff7991ebe4273ea7f51f1c1c511e6a2ce511d0e7bdb754492"}, + {file = "multidict-6.1.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:ac10f4c2b9e770c4e393876e35a7046879d195cd123b4f116d299d442b335bcd"}, + {file = "multidict-6.1.0-cp38-cp38-win32.whl", hash = "sha256:e27bbb6d14416713a8bd7aaa1313c0fc8d44ee48d74497a0ff4c3a1b6ccb5167"}, + {file = "multidict-6.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:22f3105d4fb15c8f57ff3959a58fcab6ce36814486500cd7485651230ad4d4ef"}, + {file = "multidict-6.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:4e18b656c5e844539d506a0a06432274d7bd52a7487e6828c63a63d69185626c"}, + {file = "multidict-6.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a185f876e69897a6f3325c3f19f26a297fa058c5e456bfcff8015e9a27e83ae1"}, + {file = "multidict-6.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ab7c4ceb38d91570a650dba194e1ca87c2b543488fe9309b4212694174fd539c"}, + {file = "multidict-6.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e617fb6b0b6953fffd762669610c1c4ffd05632c138d61ac7e14ad187870669c"}, + {file = "multidict-6.1.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:16e5f4bf4e603eb1fdd5d8180f1a25f30056f22e55ce51fb3d6ad4ab29f7d96f"}, + {file = "multidict-6.1.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f4c035da3f544b1882bac24115f3e2e8760f10a0107614fc9839fd232200b875"}, + {file = "multidict-6.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:957cf8e4b6e123a9eea554fa7ebc85674674b713551de587eb318a2df3e00255"}, + {file = "multidict-6.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:483a6aea59cb89904e1ceabd2b47368b5600fb7de78a6e4a2c2987b2d256cf30"}, + {file = "multidict-6.1.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:87701f25a2352e5bf7454caa64757642734da9f6b11384c1f9d1a8e699758057"}, + {file = "multidict-6.1.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:682b987361e5fd7a139ed565e30d81fd81e9629acc7d925a205366877d8c8657"}, + {file = "multidict-6.1.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:ce2186a7df133a9c895dea3331ddc5ddad42cdd0d1ea2f0a51e5d161e4762f28"}, + {file = "multidict-6.1.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:9f636b730f7e8cb19feb87094949ba54ee5357440b9658b2a32a5ce4bce53972"}, + {file = "multidict-6.1.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:73eae06aa53af2ea5270cc066dcaf02cc60d2994bbb2c4ef5764949257d10f43"}, + {file = "multidict-6.1.0-cp39-cp39-win32.whl", hash = "sha256:1ca0083e80e791cffc6efce7660ad24af66c8d4079d2a750b29001b53ff59ada"}, + {file = "multidict-6.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:aa466da5b15ccea564bdab9c89175c762bc12825f4659c11227f515cee76fa4a"}, + {file = "multidict-6.1.0-py3-none-any.whl", hash = "sha256:48e171e52d1c4d33888e529b999e5900356b9ae588c2f09a52dcefb158b27506"}, + {file = "multidict-6.1.0.tar.gz", hash = "sha256:22ae2ebf9b0c69d206c003e2f6a914ea33f0a932d4aa16f236afc049d9958f4a"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.1.0", markers = "python_version < \"3.11\""} + [[package]] name = "nh3" -version = "0.2.18" +version = "0.2.19" description = "Python bindings to the ammonia HTML sanitization library." optional = false python-versions = "*" files = [ - {file = "nh3-0.2.18-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:14c5a72e9fe82aea5fe3072116ad4661af5cf8e8ff8fc5ad3450f123e4925e86"}, - {file = "nh3-0.2.18-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:7b7c2a3c9eb1a827d42539aa64091640bd275b81e097cd1d8d82ef91ffa2e811"}, - {file = "nh3-0.2.18-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42c64511469005058cd17cc1537578eac40ae9f7200bedcfd1fc1a05f4f8c200"}, - {file = "nh3-0.2.18-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0411beb0589eacb6734f28d5497ca2ed379eafab8ad8c84b31bb5c34072b7164"}, - {file = "nh3-0.2.18-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:5f36b271dae35c465ef5e9090e1fdaba4a60a56f0bb0ba03e0932a66f28b9189"}, - {file = "nh3-0.2.18-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:34c03fa78e328c691f982b7c03d4423bdfd7da69cd707fe572f544cf74ac23ad"}, - {file = "nh3-0.2.18-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:19aaba96e0f795bd0a6c56291495ff59364f4300d4a39b29a0abc9cb3774a84b"}, - {file = "nh3-0.2.18-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:de3ceed6e661954871d6cd78b410213bdcb136f79aafe22aa7182e028b8c7307"}, - {file = "nh3-0.2.18-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6955369e4d9f48f41e3f238a9e60f9410645db7e07435e62c6a9ea6135a4907f"}, - {file = "nh3-0.2.18-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:f0eca9ca8628dbb4e916ae2491d72957fdd35f7a5d326b7032a345f111ac07fe"}, - {file = "nh3-0.2.18-cp37-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:3a157ab149e591bb638a55c8c6bcb8cdb559c8b12c13a8affaba6cedfe51713a"}, - {file = "nh3-0.2.18-cp37-abi3-musllinux_1_2_i686.whl", hash = "sha256:c8b3a1cebcba9b3669ed1a84cc65bf005728d2f0bc1ed2a6594a992e817f3a50"}, - {file = "nh3-0.2.18-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:36c95d4b70530b320b365659bb5034341316e6a9b30f0b25fa9c9eff4c27a204"}, - {file = "nh3-0.2.18-cp37-abi3-win32.whl", hash = "sha256:a7f1b5b2c15866f2db413a3649a8fe4fd7b428ae58be2c0f6bca5eefd53ca2be"}, - {file = "nh3-0.2.18-cp37-abi3-win_amd64.whl", hash = "sha256:8ce0f819d2f1933953fca255db2471ad58184a60508f03e6285e5114b6254844"}, - {file = "nh3-0.2.18.tar.gz", hash = "sha256:94a166927e53972a9698af9542ace4e38b9de50c34352b962f4d9a7d4c927af4"}, + {file = "nh3-0.2.19-cp313-cp313t-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:ec9c8bf86e397cb88c560361f60fdce478b5edb8b93f04ead419b72fbe937ea6"}, + {file = "nh3-0.2.19-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d0adf00e2b2026fa10a42537b60d161e516f206781c7515e4e97e09f72a8c5d0"}, + {file = "nh3-0.2.19-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3805161c4e12088bd74752ba69630e915bc30fe666034f47217a2f16b16efc37"}, + {file = "nh3-0.2.19-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:e3dedd7858a21312f7675841529941035a2ac91057db13402c8fe907aa19205a"}, + {file = "nh3-0.2.19-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:0b6820fc64f2ff7ef3e7253a093c946a87865c877b3889149a6d21d322ed8dbd"}, + {file = "nh3-0.2.19-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:833b3b5f1783ce95834a13030300cea00cbdfd64ea29260d01af9c4821da0aa9"}, + {file = "nh3-0.2.19-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:5d4f5e2189861b352b73acb803b5f4bb409c2f36275d22717e27d4e0c217ae55"}, + {file = "nh3-0.2.19-cp313-cp313t-win32.whl", hash = "sha256:2b926f179eb4bce72b651bfdf76f8aa05d167b2b72bc2f3657fd319f40232adc"}, + {file = "nh3-0.2.19-cp313-cp313t-win_amd64.whl", hash = "sha256:ac536a4b5c073fdadd8f5f4889adabe1cbdae55305366fb870723c96ca7f49c3"}, + {file = "nh3-0.2.19-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:c2e3f0d18cc101132fe10ab7ef5c4f41411297e639e23b64b5e888ccaad63f41"}, + {file = "nh3-0.2.19-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:11270b16c1b012677e3e2dd166c1aa273388776bf99a3e3677179db5097ee16a"}, + {file = "nh3-0.2.19-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fc483dd8d20f8f8c010783a25a84db3bebeadced92d24d34b40d687f8043ac69"}, + {file = "nh3-0.2.19-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:d53a4577b6123ca1d7e8483fad3e13cb7eda28913d516bd0a648c1a473aa21a9"}, + {file = "nh3-0.2.19-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fdb20740d24ab9f2a1341458a00a11205294e97e905de060eeab1ceca020c09c"}, + {file = "nh3-0.2.19-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d8325d51e47cb5b11f649d55e626d56c76041ba508cd59e0cb1cf687cc7612f1"}, + {file = "nh3-0.2.19-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b8eb7affc590e542fa7981ef508cd1644f62176bcd10d4429890fc629b47f0bc"}, + {file = "nh3-0.2.19-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2eb021804e9df1761abeb844bb86648d77aa118a663c82f50ea04110d87ed707"}, + {file = "nh3-0.2.19-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:a7b928862daddb29805a1010a0282f77f4b8b238a37b5f76bc6c0d16d930fd22"}, + {file = "nh3-0.2.19-cp38-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:ed06ed78f6b69d57463b46a04f68f270605301e69d80756a8adf7519002de57d"}, + {file = "nh3-0.2.19-cp38-abi3-musllinux_1_2_i686.whl", hash = "sha256:df8eac98fec80bd6f5fd0ae27a65de14f1e1a65a76d8e2237eb695f9cd1121d9"}, + {file = "nh3-0.2.19-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:00810cd5275f5c3f44b9eb0e521d1a841ee2f8023622de39ffc7d88bd533d8e0"}, + {file = "nh3-0.2.19-cp38-abi3-win32.whl", hash = "sha256:7e98621856b0a911c21faa5eef8f8ea3e691526c2433f9afc2be713cb6fbdb48"}, + {file = "nh3-0.2.19-cp38-abi3-win_amd64.whl", hash = "sha256:75c7cafb840f24430b009f7368945cb5ca88b2b54bb384ebfba495f16bc9c121"}, + {file = "nh3-0.2.19.tar.gz", hash = "sha256:790056b54c068ff8dceb443eaefb696b84beff58cca6c07afd754d17692a4804"}, ] [[package]] @@ -1210,66 +1575,66 @@ files = [ [[package]] name = "numpy" -version = "2.1.3" +version = "2.2.0" description = "Fundamental package for array computing in Python" optional = false python-versions = ">=3.10" files = [ - {file = "numpy-2.1.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c894b4305373b9c5576d7a12b473702afdf48ce5369c074ba304cc5ad8730dff"}, - {file = "numpy-2.1.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:b47fbb433d3260adcd51eb54f92a2ffbc90a4595f8970ee00e064c644ac788f5"}, - {file = "numpy-2.1.3-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:825656d0743699c529c5943554d223c021ff0494ff1442152ce887ef4f7561a1"}, - {file = "numpy-2.1.3-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:6a4825252fcc430a182ac4dee5a505053d262c807f8a924603d411f6718b88fd"}, - {file = "numpy-2.1.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e711e02f49e176a01d0349d82cb5f05ba4db7d5e7e0defd026328e5cfb3226d3"}, - {file = "numpy-2.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:78574ac2d1a4a02421f25da9559850d59457bac82f2b8d7a44fe83a64f770098"}, - {file = "numpy-2.1.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:c7662f0e3673fe4e832fe07b65c50342ea27d989f92c80355658c7f888fcc83c"}, - {file = "numpy-2.1.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:fa2d1337dc61c8dc417fbccf20f6d1e139896a30721b7f1e832b2bb6ef4eb6c4"}, - {file = "numpy-2.1.3-cp310-cp310-win32.whl", hash = "sha256:72dcc4a35a8515d83e76b58fdf8113a5c969ccd505c8a946759b24e3182d1f23"}, - {file = "numpy-2.1.3-cp310-cp310-win_amd64.whl", hash = "sha256:ecc76a9ba2911d8d37ac01de72834d8849e55473457558e12995f4cd53e778e0"}, - {file = "numpy-2.1.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4d1167c53b93f1f5d8a139a742b3c6f4d429b54e74e6b57d0eff40045187b15d"}, - {file = "numpy-2.1.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c80e4a09b3d95b4e1cac08643f1152fa71a0a821a2d4277334c88d54b2219a41"}, - {file = "numpy-2.1.3-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:576a1c1d25e9e02ed7fa5477f30a127fe56debd53b8d2c89d5578f9857d03ca9"}, - {file = "numpy-2.1.3-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:973faafebaae4c0aaa1a1ca1ce02434554d67e628b8d805e61f874b84e136b09"}, - {file = "numpy-2.1.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:762479be47a4863e261a840e8e01608d124ee1361e48b96916f38b119cfda04a"}, - {file = "numpy-2.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc6f24b3d1ecc1eebfbf5d6051faa49af40b03be1aaa781ebdadcbc090b4539b"}, - {file = "numpy-2.1.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:17ee83a1f4fef3c94d16dc1802b998668b5419362c8a4f4e8a491de1b41cc3ee"}, - {file = "numpy-2.1.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:15cb89f39fa6d0bdfb600ea24b250e5f1a3df23f901f51c8debaa6a5d122b2f0"}, - {file = "numpy-2.1.3-cp311-cp311-win32.whl", hash = "sha256:d9beb777a78c331580705326d2367488d5bc473b49a9bc3036c154832520aca9"}, - {file = "numpy-2.1.3-cp311-cp311-win_amd64.whl", hash = "sha256:d89dd2b6da69c4fff5e39c28a382199ddedc3a5be5390115608345dec660b9e2"}, - {file = "numpy-2.1.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:f55ba01150f52b1027829b50d70ef1dafd9821ea82905b63936668403c3b471e"}, - {file = "numpy-2.1.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:13138eadd4f4da03074851a698ffa7e405f41a0845a6b1ad135b81596e4e9958"}, - {file = "numpy-2.1.3-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:a6b46587b14b888e95e4a24d7b13ae91fa22386c199ee7b418f449032b2fa3b8"}, - {file = "numpy-2.1.3-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:0fa14563cc46422e99daef53d725d0c326e99e468a9320a240affffe87852564"}, - {file = "numpy-2.1.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8637dcd2caa676e475503d1f8fdb327bc495554e10838019651b76d17b98e512"}, - {file = "numpy-2.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2312b2aa89e1f43ecea6da6ea9a810d06aae08321609d8dc0d0eda6d946a541b"}, - {file = "numpy-2.1.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a38c19106902bb19351b83802531fea19dee18e5b37b36454f27f11ff956f7fc"}, - {file = "numpy-2.1.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:02135ade8b8a84011cbb67dc44e07c58f28575cf9ecf8ab304e51c05528c19f0"}, - {file = "numpy-2.1.3-cp312-cp312-win32.whl", hash = "sha256:e6988e90fcf617da2b5c78902fe8e668361b43b4fe26dbf2d7b0f8034d4cafb9"}, - {file = "numpy-2.1.3-cp312-cp312-win_amd64.whl", hash = "sha256:0d30c543f02e84e92c4b1f415b7c6b5326cbe45ee7882b6b77db7195fb971e3a"}, - {file = "numpy-2.1.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:96fe52fcdb9345b7cd82ecd34547fca4321f7656d500eca497eb7ea5a926692f"}, - {file = "numpy-2.1.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f653490b33e9c3a4c1c01d41bc2aef08f9475af51146e4a7710c450cf9761598"}, - {file = "numpy-2.1.3-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:dc258a761a16daa791081d026f0ed4399b582712e6fc887a95af09df10c5ca57"}, - {file = "numpy-2.1.3-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:016d0f6f5e77b0f0d45d77387ffa4bb89816b57c835580c3ce8e099ef830befe"}, - {file = "numpy-2.1.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c181ba05ce8299c7aa3125c27b9c2167bca4a4445b7ce73d5febc411ca692e43"}, - {file = "numpy-2.1.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5641516794ca9e5f8a4d17bb45446998c6554704d888f86df9b200e66bdcce56"}, - {file = "numpy-2.1.3-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ea4dedd6e394a9c180b33c2c872b92f7ce0f8e7ad93e9585312b0c5a04777a4a"}, - {file = "numpy-2.1.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:b0df3635b9c8ef48bd3be5f862cf71b0a4716fa0e702155c45067c6b711ddcef"}, - {file = "numpy-2.1.3-cp313-cp313-win32.whl", hash = "sha256:50ca6aba6e163363f132b5c101ba078b8cbd3fa92c7865fd7d4d62d9779ac29f"}, - {file = "numpy-2.1.3-cp313-cp313-win_amd64.whl", hash = "sha256:747641635d3d44bcb380d950679462fae44f54b131be347d5ec2bce47d3df9ed"}, - {file = "numpy-2.1.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:996bb9399059c5b82f76b53ff8bb686069c05acc94656bb259b1d63d04a9506f"}, - {file = "numpy-2.1.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:45966d859916ad02b779706bb43b954281db43e185015df6eb3323120188f9e4"}, - {file = "numpy-2.1.3-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:baed7e8d7481bfe0874b566850cb0b85243e982388b7b23348c6db2ee2b2ae8e"}, - {file = "numpy-2.1.3-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:a9f7f672a3388133335589cfca93ed468509cb7b93ba3105fce780d04a6576a0"}, - {file = "numpy-2.1.3-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7aac50327da5d208db2eec22eb11e491e3fe13d22653dce51b0f4109101b408"}, - {file = "numpy-2.1.3-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4394bc0dbd074b7f9b52024832d16e019decebf86caf909d94f6b3f77a8ee3b6"}, - {file = "numpy-2.1.3-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:50d18c4358a0a8a53f12a8ba9d772ab2d460321e6a93d6064fc22443d189853f"}, - {file = "numpy-2.1.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:14e253bd43fc6b37af4921b10f6add6925878a42a0c5fe83daee390bca80bc17"}, - {file = "numpy-2.1.3-cp313-cp313t-win32.whl", hash = "sha256:08788d27a5fd867a663f6fc753fd7c3ad7e92747efc73c53bca2f19f8bc06f48"}, - {file = "numpy-2.1.3-cp313-cp313t-win_amd64.whl", hash = "sha256:2564fbdf2b99b3f815f2107c1bbc93e2de8ee655a69c261363a1172a79a257d4"}, - {file = "numpy-2.1.3-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:4f2015dfe437dfebbfce7c85c7b53d81ba49e71ba7eadbf1df40c915af75979f"}, - {file = "numpy-2.1.3-pp310-pypy310_pp73-macosx_14_0_x86_64.whl", hash = "sha256:3522b0dfe983a575e6a9ab3a4a4dfe156c3e428468ff08ce582b9bb6bd1d71d4"}, - {file = "numpy-2.1.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c006b607a865b07cd981ccb218a04fc86b600411d83d6fc261357f1c0966755d"}, - {file = "numpy-2.1.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:e14e26956e6f1696070788252dcdff11b4aca4c3e8bd166e0df1bb8f315a67cb"}, - {file = "numpy-2.1.3.tar.gz", hash = "sha256:aa08e04e08aaf974d4458def539dece0d28146d866a39da5639596f4921fd761"}, + {file = "numpy-2.2.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1e25507d85da11ff5066269d0bd25d06e0a0f2e908415534f3e603d2a78e4ffa"}, + {file = "numpy-2.2.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a62eb442011776e4036af5c8b1a00b706c5bc02dc15eb5344b0c750428c94219"}, + {file = "numpy-2.2.0-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:b606b1aaf802e6468c2608c65ff7ece53eae1a6874b3765f69b8ceb20c5fa78e"}, + {file = "numpy-2.2.0-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:36b2b43146f646642b425dd2027730f99bac962618ec2052932157e213a040e9"}, + {file = "numpy-2.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7fe8f3583e0607ad4e43a954e35c1748b553bfe9fdac8635c02058023277d1b3"}, + {file = "numpy-2.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:122fd2fcfafdefc889c64ad99c228d5a1f9692c3a83f56c292618a59aa60ae83"}, + {file = "numpy-2.2.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:3f2f5cddeaa4424a0a118924b988746db6ffa8565e5829b1841a8a3bd73eb59a"}, + {file = "numpy-2.2.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:7fe4bb0695fe986a9e4deec3b6857003b4cfe5c5e4aac0b95f6a658c14635e31"}, + {file = "numpy-2.2.0-cp310-cp310-win32.whl", hash = "sha256:b30042fe92dbd79f1ba7f6898fada10bdaad1847c44f2dff9a16147e00a93661"}, + {file = "numpy-2.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:54dc1d6d66f8d37843ed281773c7174f03bf7ad826523f73435deb88ba60d2d4"}, + {file = "numpy-2.2.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:9874bc2ff574c40ab7a5cbb7464bf9b045d617e36754a7bc93f933d52bd9ffc6"}, + {file = "numpy-2.2.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:0da8495970f6b101ddd0c38ace92edea30e7e12b9a926b57f5fabb1ecc25bb90"}, + {file = "numpy-2.2.0-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:0557eebc699c1c34cccdd8c3778c9294e8196df27d713706895edc6f57d29608"}, + {file = "numpy-2.2.0-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:3579eaeb5e07f3ded59298ce22b65f877a86ba8e9fe701f5576c99bb17c283da"}, + {file = "numpy-2.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40deb10198bbaa531509aad0cd2f9fadb26c8b94070831e2208e7df543562b74"}, + {file = "numpy-2.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c2aed8fcf8abc3020d6a9ccb31dbc9e7d7819c56a348cc88fd44be269b37427e"}, + {file = "numpy-2.2.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:a222d764352c773aa5ebde02dd84dba3279c81c6db2e482d62a3fa54e5ece69b"}, + {file = "numpy-2.2.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:4e58666988605e251d42c2818c7d3d8991555381be26399303053b58a5bbf30d"}, + {file = "numpy-2.2.0-cp311-cp311-win32.whl", hash = "sha256:4723a50e1523e1de4fccd1b9a6dcea750c2102461e9a02b2ac55ffeae09a4410"}, + {file = "numpy-2.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:16757cf28621e43e252c560d25b15f18a2f11da94fea344bf26c599b9cf54b73"}, + {file = "numpy-2.2.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:cff210198bb4cae3f3c100444c5eaa573a823f05c253e7188e1362a5555235b3"}, + {file = "numpy-2.2.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:58b92a5828bd4d9aa0952492b7de803135038de47343b2aa3cc23f3b71a3dc4e"}, + {file = "numpy-2.2.0-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:ebe5e59545401fbb1b24da76f006ab19734ae71e703cdb4a8b347e84a0cece67"}, + {file = "numpy-2.2.0-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:e2b8cd48a9942ed3f85b95ca4105c45758438c7ed28fff1e4ce3e57c3b589d8e"}, + {file = "numpy-2.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:57fcc997ffc0bef234b8875a54d4058afa92b0b0c4223fc1f62f24b3b5e86038"}, + {file = "numpy-2.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:85ad7d11b309bd132d74397fcf2920933c9d1dc865487128f5c03d580f2c3d03"}, + {file = "numpy-2.2.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:cb24cca1968b21355cc6f3da1a20cd1cebd8a023e3c5b09b432444617949085a"}, + {file = "numpy-2.2.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:0798b138c291d792f8ea40fe3768610f3c7dd2574389e37c3f26573757c8f7ef"}, + {file = "numpy-2.2.0-cp312-cp312-win32.whl", hash = "sha256:afe8fb968743d40435c3827632fd36c5fbde633b0423da7692e426529b1759b1"}, + {file = "numpy-2.2.0-cp312-cp312-win_amd64.whl", hash = "sha256:3a4199f519e57d517ebd48cb76b36c82da0360781c6a0353e64c0cac30ecaad3"}, + {file = "numpy-2.2.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f8c8b141ef9699ae777c6278b52c706b653bf15d135d302754f6b2e90eb30367"}, + {file = "numpy-2.2.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0f0986e917aca18f7a567b812ef7ca9391288e2acb7a4308aa9d265bd724bdae"}, + {file = "numpy-2.2.0-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:1c92113619f7b272838b8d6702a7f8ebe5edea0df48166c47929611d0b4dea69"}, + {file = "numpy-2.2.0-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:5a145e956b374e72ad1dff82779177d4a3c62bc8248f41b80cb5122e68f22d13"}, + {file = "numpy-2.2.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:18142b497d70a34b01642b9feabb70156311b326fdddd875a9981f34a369b671"}, + {file = "numpy-2.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a7d41d1612c1a82b64697e894b75db6758d4f21c3ec069d841e60ebe54b5b571"}, + {file = "numpy-2.2.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a98f6f20465e7618c83252c02041517bd2f7ea29be5378f09667a8f654a5918d"}, + {file = "numpy-2.2.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e09d40edfdb4e260cb1567d8ae770ccf3b8b7e9f0d9b5c2a9992696b30ce2742"}, + {file = "numpy-2.2.0-cp313-cp313-win32.whl", hash = "sha256:3905a5fffcc23e597ee4d9fb3fcd209bd658c352657548db7316e810ca80458e"}, + {file = "numpy-2.2.0-cp313-cp313-win_amd64.whl", hash = "sha256:a184288538e6ad699cbe6b24859206e38ce5fba28f3bcfa51c90d0502c1582b2"}, + {file = "numpy-2.2.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:7832f9e8eb00be32f15fdfb9a981d6955ea9adc8574c521d48710171b6c55e95"}, + {file = "numpy-2.2.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:f0dd071b95bbca244f4cb7f70b77d2ff3aaaba7fa16dc41f58d14854a6204e6c"}, + {file = "numpy-2.2.0-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:b0b227dcff8cdc3efbce66d4e50891f04d0a387cce282fe1e66199146a6a8fca"}, + {file = "numpy-2.2.0-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:6ab153263a7c5ccaf6dfe7e53447b74f77789f28ecb278c3b5d49db7ece10d6d"}, + {file = "numpy-2.2.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e500aba968a48e9019e42c0c199b7ec0696a97fa69037bea163b55398e390529"}, + {file = "numpy-2.2.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:440cfb3db4c5029775803794f8638fbdbf71ec702caf32735f53b008e1eaece3"}, + {file = "numpy-2.2.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:a55dc7a7f0b6198b07ec0cd445fbb98b05234e8b00c5ac4874a63372ba98d4ab"}, + {file = "numpy-2.2.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:4bddbaa30d78c86329b26bd6aaaea06b1e47444da99eddac7bf1e2fab717bd72"}, + {file = "numpy-2.2.0-cp313-cp313t-win32.whl", hash = "sha256:30bf971c12e4365153afb31fc73f441d4da157153f3400b82db32d04de1e4066"}, + {file = "numpy-2.2.0-cp313-cp313t-win_amd64.whl", hash = "sha256:d35717333b39d1b6bb8433fa758a55f1081543de527171543a2b710551d40881"}, + {file = "numpy-2.2.0-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:e12c6c1ce84628c52d6367863773f7c8c8241be554e8b79686e91a43f1733773"}, + {file = "numpy-2.2.0-pp310-pypy310_pp73-macosx_14_0_x86_64.whl", hash = "sha256:b6207dc8fb3c8cb5668e885cef9ec7f70189bec4e276f0ff70d5aa078d32c88e"}, + {file = "numpy-2.2.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a50aeff71d0f97b6450d33940c7181b08be1441c6c193e678211bff11aa725e7"}, + {file = "numpy-2.2.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:df12a1f99b99f569a7c2ae59aa2d31724e8d835fc7f33e14f4792e3071d11221"}, + {file = "numpy-2.2.0.tar.gz", hash = "sha256:140dd80ff8981a583a60980be1a655068f8adebf7a45a06a6858c873fcdcd4a0"}, ] [[package]] @@ -1506,13 +1871,13 @@ test = ["covdefaults (>=2.3)", "diff-cover (>=8.0.1)", "pytest (>=7.4.3)", "pyte [[package]] name = "pkginfo" -version = "1.10.0" +version = "1.12.0" description = "Query metadata from sdists / bdists / installed packages." optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "pkginfo-1.10.0-py3-none-any.whl", hash = "sha256:889a6da2ed7ffc58ab5b900d888ddce90bce912f2d2de1dc1c26f4cb9fe65097"}, - {file = "pkginfo-1.10.0.tar.gz", hash = "sha256:5df73835398d10db79f8eecd5cd86b1f6d29317589ea70796994d49399af6297"}, + {file = "pkginfo-1.12.0-py3-none-any.whl", hash = "sha256:dcd589c9be4da8973eceffa247733c144812759aa67eaf4bbf97016a02f39088"}, + {file = "pkginfo-1.12.0.tar.gz", hash = "sha256:8ad91a0445a036782b9366ef8b8c2c50291f83a553478ba8580c73d3215700cf"}, ] [package.extras] @@ -1536,18 +1901,18 @@ type = ["mypy (>=1.11.2)"] [[package]] name = "playwright" -version = "1.48.0" +version = "1.49.1" description = "A high-level API to automate web browsers" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "playwright-1.48.0-py3-none-macosx_10_13_x86_64.whl", hash = "sha256:082bce2739f1078acc7d0734da8cc0e23eb91b7fae553f3316d733276f09a6b1"}, - {file = "playwright-1.48.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7da2eb51a19c7f3b523e9faa9d98e7af92e52eb983a099979ea79c9668e3cbf7"}, - {file = "playwright-1.48.0-py3-none-macosx_11_0_universal2.whl", hash = "sha256:115b988d1da322358b77bc3bf2d3cc90f8c881e691461538e7df91614c4833c9"}, - {file = "playwright-1.48.0-py3-none-manylinux1_x86_64.whl", hash = "sha256:8dabb80e62f667fe2640a8b694e26a7b884c0b4803f7514a3954fc849126227b"}, - {file = "playwright-1.48.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8ff8303409ebed76bed4c3d655340320b768817d900ba208b394fdd7d7939a5c"}, - {file = "playwright-1.48.0-py3-none-win32.whl", hash = "sha256:85598c360c590076d4f435525be991246d74a905b654ac19d26eab7ed9b98b2d"}, - {file = "playwright-1.48.0-py3-none-win_amd64.whl", hash = "sha256:e0e87b0c4dc8fce83c725dd851aec37bc4e882bb225ec8a96bd83cf32d4f1623"}, + {file = "playwright-1.49.1-py3-none-macosx_10_13_x86_64.whl", hash = "sha256:1041ffb45a0d0bc44d698d3a5aa3ac4b67c9bd03540da43a0b70616ad52592b8"}, + {file = "playwright-1.49.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:9f38ed3d0c1f4e0a6d1c92e73dd9a61f8855133249d6f0cec28648d38a7137be"}, + {file = "playwright-1.49.1-py3-none-macosx_11_0_universal2.whl", hash = "sha256:3be48c6d26dc819ca0a26567c1ae36a980a0303dcd4249feb6f59e115aaddfb8"}, + {file = "playwright-1.49.1-py3-none-manylinux1_x86_64.whl", hash = "sha256:753ca90ee31b4b03d165cfd36e477309ebf2b4381953f2a982ff612d85b147d2"}, + {file = "playwright-1.49.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cd9bc8dab37aa25198a01f555f0a2e2c3813fe200fef018ac34dfe86b34994b9"}, + {file = "playwright-1.49.1-py3-none-win32.whl", hash = "sha256:43b304be67f096058e587dac453ece550eff87b8fbed28de30f4f022cc1745bb"}, + {file = "playwright-1.49.1-py3-none-win_amd64.whl", hash = "sha256:47b23cb346283278f5b4d1e1990bcb6d6302f80c0aa0ca93dd0601a1400191df"}, ] [package.dependencies] @@ -1602,6 +1967,113 @@ nodeenv = ">=0.11.1" pyyaml = ">=5.1" virtualenv = ">=20.10.0" +[[package]] +name = "propcache" +version = "0.2.0" +description = "Accelerated property cache" +optional = false +python-versions = ">=3.8" +files = [ + {file = "propcache-0.2.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:c5869b8fd70b81835a6f187c5fdbe67917a04d7e52b6e7cc4e5fe39d55c39d58"}, + {file = "propcache-0.2.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:952e0d9d07609d9c5be361f33b0d6d650cd2bae393aabb11d9b719364521984b"}, + {file = "propcache-0.2.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:33ac8f098df0585c0b53009f039dfd913b38c1d2edafed0cedcc0c32a05aa110"}, + {file = "propcache-0.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:97e48e8875e6c13909c800fa344cd54cc4b2b0db1d5f911f840458a500fde2c2"}, + {file = "propcache-0.2.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:388f3217649d6d59292b722d940d4d2e1e6a7003259eb835724092a1cca0203a"}, + {file = "propcache-0.2.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f571aea50ba5623c308aa146eb650eebf7dbe0fd8c5d946e28343cb3b5aad577"}, + {file = "propcache-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3dfafb44f7bb35c0c06eda6b2ab4bfd58f02729e7c4045e179f9a861b07c9850"}, + {file = "propcache-0.2.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a3ebe9a75be7ab0b7da2464a77bb27febcb4fab46a34f9288f39d74833db7f61"}, + {file = "propcache-0.2.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d2f0d0f976985f85dfb5f3d685697ef769faa6b71993b46b295cdbbd6be8cc37"}, + {file = "propcache-0.2.0-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:a3dc1a4b165283bd865e8f8cb5f0c64c05001e0718ed06250d8cac9bec115b48"}, + {file = "propcache-0.2.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:9e0f07b42d2a50c7dd2d8675d50f7343d998c64008f1da5fef888396b7f84630"}, + {file = "propcache-0.2.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:e63e3e1e0271f374ed489ff5ee73d4b6e7c60710e1f76af5f0e1a6117cd26394"}, + {file = "propcache-0.2.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:56bb5c98f058a41bb58eead194b4db8c05b088c93d94d5161728515bd52b052b"}, + {file = "propcache-0.2.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:7665f04d0c7f26ff8bb534e1c65068409bf4687aa2534faf7104d7182debb336"}, + {file = "propcache-0.2.0-cp310-cp310-win32.whl", hash = "sha256:7cf18abf9764746b9c8704774d8b06714bcb0a63641518a3a89c7f85cc02c2ad"}, + {file = "propcache-0.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:cfac69017ef97db2438efb854edf24f5a29fd09a536ff3a992b75990720cdc99"}, + {file = "propcache-0.2.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:63f13bf09cc3336eb04a837490b8f332e0db41da66995c9fd1ba04552e516354"}, + {file = "propcache-0.2.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:608cce1da6f2672a56b24a015b42db4ac612ee709f3d29f27a00c943d9e851de"}, + {file = "propcache-0.2.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:466c219deee4536fbc83c08d09115249db301550625c7fef1c5563a584c9bc87"}, + {file = "propcache-0.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fc2db02409338bf36590aa985a461b2c96fce91f8e7e0f14c50c5fcc4f229016"}, + {file = "propcache-0.2.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a6ed8db0a556343d566a5c124ee483ae113acc9a557a807d439bcecc44e7dfbb"}, + {file = "propcache-0.2.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:91997d9cb4a325b60d4e3f20967f8eb08dfcb32b22554d5ef78e6fd1dda743a2"}, + {file = "propcache-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c7dde9e533c0a49d802b4f3f218fa9ad0a1ce21f2c2eb80d5216565202acab4"}, + {file = "propcache-0.2.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffcad6c564fe6b9b8916c1aefbb37a362deebf9394bd2974e9d84232e3e08504"}, + {file = "propcache-0.2.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:97a58a28bcf63284e8b4d7b460cbee1edaab24634e82059c7b8c09e65284f178"}, + {file = "propcache-0.2.0-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:945db8ee295d3af9dbdbb698cce9bbc5c59b5c3fe328bbc4387f59a8a35f998d"}, + {file = "propcache-0.2.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:39e104da444a34830751715f45ef9fc537475ba21b7f1f5b0f4d71a3b60d7fe2"}, + {file = "propcache-0.2.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:c5ecca8f9bab618340c8e848d340baf68bcd8ad90a8ecd7a4524a81c1764b3db"}, + {file = "propcache-0.2.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:c436130cc779806bdf5d5fae0d848713105472b8566b75ff70048c47d3961c5b"}, + {file = "propcache-0.2.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:191db28dc6dcd29d1a3e063c3be0b40688ed76434622c53a284e5427565bbd9b"}, + {file = "propcache-0.2.0-cp311-cp311-win32.whl", hash = "sha256:5f2564ec89058ee7c7989a7b719115bdfe2a2fb8e7a4543b8d1c0cc4cf6478c1"}, + {file = "propcache-0.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:6e2e54267980349b723cff366d1e29b138b9a60fa376664a157a342689553f71"}, + {file = "propcache-0.2.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:2ee7606193fb267be4b2e3b32714f2d58cad27217638db98a60f9efb5efeccc2"}, + {file = "propcache-0.2.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:91ee8fc02ca52e24bcb77b234f22afc03288e1dafbb1f88fe24db308910c4ac7"}, + {file = "propcache-0.2.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2e900bad2a8456d00a113cad8c13343f3b1f327534e3589acc2219729237a2e8"}, + {file = "propcache-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f52a68c21363c45297aca15561812d542f8fc683c85201df0bebe209e349f793"}, + {file = "propcache-0.2.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1e41d67757ff4fbc8ef2af99b338bfb955010444b92929e9e55a6d4dcc3c4f09"}, + {file = "propcache-0.2.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a64e32f8bd94c105cc27f42d3b658902b5bcc947ece3c8fe7bc1b05982f60e89"}, + {file = "propcache-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:55346705687dbd7ef0d77883ab4f6fabc48232f587925bdaf95219bae072491e"}, + {file = "propcache-0.2.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:00181262b17e517df2cd85656fcd6b4e70946fe62cd625b9d74ac9977b64d8d9"}, + {file = "propcache-0.2.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6994984550eaf25dd7fc7bd1b700ff45c894149341725bb4edc67f0ffa94efa4"}, + {file = "propcache-0.2.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:56295eb1e5f3aecd516d91b00cfd8bf3a13991de5a479df9e27dd569ea23959c"}, + {file = "propcache-0.2.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:439e76255daa0f8151d3cb325f6dd4a3e93043e6403e6491813bcaaaa8733887"}, + {file = "propcache-0.2.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:f6475a1b2ecb310c98c28d271a30df74f9dd436ee46d09236a6b750a7599ce57"}, + {file = "propcache-0.2.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:3444cdba6628accf384e349014084b1cacd866fbb88433cd9d279d90a54e0b23"}, + {file = "propcache-0.2.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:4a9d9b4d0a9b38d1c391bb4ad24aa65f306c6f01b512e10a8a34a2dc5675d348"}, + {file = "propcache-0.2.0-cp312-cp312-win32.whl", hash = "sha256:69d3a98eebae99a420d4b28756c8ce6ea5a29291baf2dc9ff9414b42676f61d5"}, + {file = "propcache-0.2.0-cp312-cp312-win_amd64.whl", hash = "sha256:ad9c9b99b05f163109466638bd30ada1722abb01bbb85c739c50b6dc11f92dc3"}, + {file = "propcache-0.2.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ecddc221a077a8132cf7c747d5352a15ed763b674c0448d811f408bf803d9ad7"}, + {file = "propcache-0.2.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0e53cb83fdd61cbd67202735e6a6687a7b491c8742dfc39c9e01e80354956763"}, + {file = "propcache-0.2.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:92fe151145a990c22cbccf9ae15cae8ae9eddabfc949a219c9f667877e40853d"}, + {file = "propcache-0.2.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d6a21ef516d36909931a2967621eecb256018aeb11fc48656e3257e73e2e247a"}, + {file = "propcache-0.2.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3f88a4095e913f98988f5b338c1d4d5d07dbb0b6bad19892fd447484e483ba6b"}, + {file = "propcache-0.2.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5a5b3bb545ead161be780ee85a2b54fdf7092815995661947812dde94a40f6fb"}, + {file = "propcache-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:67aeb72e0f482709991aa91345a831d0b707d16b0257e8ef88a2ad246a7280bf"}, + {file = "propcache-0.2.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3c997f8c44ec9b9b0bcbf2d422cc00a1d9b9c681f56efa6ca149a941e5560da2"}, + {file = "propcache-0.2.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:2a66df3d4992bc1d725b9aa803e8c5a66c010c65c741ad901e260ece77f58d2f"}, + {file = "propcache-0.2.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:3ebbcf2a07621f29638799828b8d8668c421bfb94c6cb04269130d8de4fb7136"}, + {file = "propcache-0.2.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:1235c01ddaa80da8235741e80815ce381c5267f96cc49b1477fdcf8c047ef325"}, + {file = "propcache-0.2.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:3947483a381259c06921612550867b37d22e1df6d6d7e8361264b6d037595f44"}, + {file = "propcache-0.2.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:d5bed7f9805cc29c780f3aee05de3262ee7ce1f47083cfe9f77471e9d6777e83"}, + {file = "propcache-0.2.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e4a91d44379f45f5e540971d41e4626dacd7f01004826a18cb048e7da7e96544"}, + {file = "propcache-0.2.0-cp313-cp313-win32.whl", hash = "sha256:f902804113e032e2cdf8c71015651c97af6418363bea8d78dc0911d56c335032"}, + {file = "propcache-0.2.0-cp313-cp313-win_amd64.whl", hash = "sha256:8f188cfcc64fb1266f4684206c9de0e80f54622c3f22a910cbd200478aeae61e"}, + {file = "propcache-0.2.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:53d1bd3f979ed529f0805dd35ddaca330f80a9a6d90bc0121d2ff398f8ed8861"}, + {file = "propcache-0.2.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:83928404adf8fb3d26793665633ea79b7361efa0287dfbd372a7e74311d51ee6"}, + {file = "propcache-0.2.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:77a86c261679ea5f3896ec060be9dc8e365788248cc1e049632a1be682442063"}, + {file = "propcache-0.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:218db2a3c297a3768c11a34812e63b3ac1c3234c3a086def9c0fee50d35add1f"}, + {file = "propcache-0.2.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7735e82e3498c27bcb2d17cb65d62c14f1100b71723b68362872bca7d0913d90"}, + {file = "propcache-0.2.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:20a617c776f520c3875cf4511e0d1db847a076d720714ae35ffe0df3e440be68"}, + {file = "propcache-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:67b69535c870670c9f9b14a75d28baa32221d06f6b6fa6f77a0a13c5a7b0a5b9"}, + {file = "propcache-0.2.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4569158070180c3855e9c0791c56be3ceeb192defa2cdf6a3f39e54319e56b89"}, + {file = "propcache-0.2.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:db47514ffdbd91ccdc7e6f8407aac4ee94cc871b15b577c1c324236b013ddd04"}, + {file = "propcache-0.2.0-cp38-cp38-musllinux_1_2_armv7l.whl", hash = "sha256:2a60ad3e2553a74168d275a0ef35e8c0a965448ffbc3b300ab3a5bb9956c2162"}, + {file = "propcache-0.2.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:662dd62358bdeaca0aee5761de8727cfd6861432e3bb828dc2a693aa0471a563"}, + {file = "propcache-0.2.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:25a1f88b471b3bc911d18b935ecb7115dff3a192b6fef46f0bfaf71ff4f12418"}, + {file = "propcache-0.2.0-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:f60f0ac7005b9f5a6091009b09a419ace1610e163fa5deaba5ce3484341840e7"}, + {file = "propcache-0.2.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:74acd6e291f885678631b7ebc85d2d4aec458dd849b8c841b57ef04047833bed"}, + {file = "propcache-0.2.0-cp38-cp38-win32.whl", hash = "sha256:d9b6ddac6408194e934002a69bcaadbc88c10b5f38fb9307779d1c629181815d"}, + {file = "propcache-0.2.0-cp38-cp38-win_amd64.whl", hash = "sha256:676135dcf3262c9c5081cc8f19ad55c8a64e3f7282a21266d05544450bffc3a5"}, + {file = "propcache-0.2.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:25c8d773a62ce0451b020c7b29a35cfbc05de8b291163a7a0f3b7904f27253e6"}, + {file = "propcache-0.2.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:375a12d7556d462dc64d70475a9ee5982465fbb3d2b364f16b86ba9135793638"}, + {file = "propcache-0.2.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1ec43d76b9677637a89d6ab86e1fef70d739217fefa208c65352ecf0282be957"}, + {file = "propcache-0.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f45eec587dafd4b2d41ac189c2156461ebd0c1082d2fe7013571598abb8505d1"}, + {file = "propcache-0.2.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bc092ba439d91df90aea38168e11f75c655880c12782facf5cf9c00f3d42b562"}, + {file = "propcache-0.2.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fa1076244f54bb76e65e22cb6910365779d5c3d71d1f18b275f1dfc7b0d71b4d"}, + {file = "propcache-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:682a7c79a2fbf40f5dbb1eb6bfe2cd865376deeac65acf9beb607505dced9e12"}, + {file = "propcache-0.2.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8e40876731f99b6f3c897b66b803c9e1c07a989b366c6b5b475fafd1f7ba3fb8"}, + {file = "propcache-0.2.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:363ea8cd3c5cb6679f1c2f5f1f9669587361c062e4899fce56758efa928728f8"}, + {file = "propcache-0.2.0-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:140fbf08ab3588b3468932974a9331aff43c0ab8a2ec2c608b6d7d1756dbb6cb"}, + {file = "propcache-0.2.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:e70fac33e8b4ac63dfc4c956fd7d85a0b1139adcfc0d964ce288b7c527537fea"}, + {file = "propcache-0.2.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:b33d7a286c0dc1a15f5fc864cc48ae92a846df287ceac2dd499926c3801054a6"}, + {file = "propcache-0.2.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:f6d5749fdd33d90e34c2efb174c7e236829147a2713334d708746e94c4bde40d"}, + {file = "propcache-0.2.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:22aa8f2272d81d9317ff5756bb108021a056805ce63dd3630e27d042c8092798"}, + {file = "propcache-0.2.0-cp39-cp39-win32.whl", hash = "sha256:73e4b40ea0eda421b115248d7e79b59214411109a5bc47d0d48e4c73e3b8fcf9"}, + {file = "propcache-0.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:9517d5e9e0731957468c29dbfd0f976736a0e55afaea843726e887f36fe017df"}, + {file = "propcache-0.2.0-py3-none-any.whl", hash = "sha256:2ccc28197af5313706511fab3a8b66dcd6da067a1331372c82ea1cb74285e036"}, + {file = "propcache-0.2.0.tar.gz", hash = "sha256:df81779732feb9d01e5d513fad0122efb3d53bbc75f61b2a4f29a020bc985e70"}, +] + [[package]] name = "psutil" version = "6.1.0" @@ -1656,13 +2128,13 @@ files = [ [[package]] name = "pydantic" -version = "2.10.1" +version = "2.10.3" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic-2.10.1-py3-none-any.whl", hash = "sha256:a8d20db84de64cf4a7d59e899c2caf0fe9d660c7cfc482528e7020d7dd189a7e"}, - {file = "pydantic-2.10.1.tar.gz", hash = "sha256:a4daca2dc0aa429555e0656d6bf94873a7dc5f54ee42b1f5873d666fb3f35560"}, + {file = "pydantic-2.10.3-py3-none-any.whl", hash = "sha256:be04d85bbc7b65651c5f8e6b9976ed9c6f41782a55524cef079a34a0bb82144d"}, + {file = "pydantic-2.10.3.tar.gz", hash = "sha256:cb5ac360ce894ceacd69c403187900a02c4b20b693a9dd1d643e1effab9eadf9"}, ] [package.dependencies] @@ -1860,13 +2332,13 @@ files = [ [[package]] name = "pytest" -version = "8.3.3" +version = "8.3.4" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.8" files = [ - {file = "pytest-8.3.3-py3-none-any.whl", hash = "sha256:a6853c7375b2663155079443d2e45de913a911a11d669df02a50814944db57b2"}, - {file = "pytest-8.3.3.tar.gz", hash = "sha256:70b98107bd648308a7952b06e6ca9a50bc660be218d53c257cc1fc94fda10181"}, + {file = "pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6"}, + {file = "pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761"}, ] [package.dependencies] @@ -1973,13 +2445,13 @@ dev = ["pre-commit", "pytest-asyncio", "tox"] [[package]] name = "pytest-playwright" -version = "0.5.2" +version = "0.6.2" description = "A pytest wrapper with fixtures for Playwright to automate web browsers" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "pytest_playwright-0.5.2-py3-none-any.whl", hash = "sha256:2c5720591364a1cdf66610b972ff8492512bc380953e043c85f705b78b2ed582"}, - {file = "pytest_playwright-0.5.2.tar.gz", hash = "sha256:c6d603df9e6c50b35f057b0528e11d41c0963283e98c257267117f5ed6ba1924"}, + {file = "pytest_playwright-0.6.2-py3-none-any.whl", hash = "sha256:0eff73bebe497b0158befed91e2f5fe94cfa17181f8b3acf575beed84e7e9043"}, + {file = "pytest_playwright-0.6.2.tar.gz", hash = "sha256:ff4054b19aa05df096ac6f74f0572591566aaf0f6d97f6cb9674db8a4d4ed06c"}, ] [package.dependencies] @@ -2023,13 +2495,13 @@ docs = ["sphinx"] [[package]] name = "python-multipart" -version = "0.0.17" +version = "0.0.19" description = "A streaming multipart parser for Python" optional = false python-versions = ">=3.8" files = [ - {file = "python_multipart-0.0.17-py3-none-any.whl", hash = "sha256:15dc4f487e0a9476cc1201261188ee0940165cffc94429b6fc565c4d3045cb5d"}, - {file = "python_multipart-0.0.17.tar.gz", hash = "sha256:41330d831cae6e2f22902704ead2826ea038d0419530eadff3ea80175aec5538"}, + {file = "python_multipart-0.0.19-py3-none-any.whl", hash = "sha256:f8d5b0b9c618575bf9df01c684ded1d94a338839bdd8223838afacfb4bb2082d"}, + {file = "python_multipart-0.0.19.tar.gz", hash = "sha256:905502ef39050557b7a6af411f454bc19526529ca46ae6831508438890ce12cc"}, ] [[package]] @@ -2174,13 +2646,13 @@ md = ["cmarkgfm (>=0.8.0)"] [[package]] name = "redis" -version = "5.2.0" +version = "5.2.1" description = "Python client for Redis database and key-value store" optional = false python-versions = ">=3.8" files = [ - {file = "redis-5.2.0-py3-none-any.whl", hash = "sha256:ae174f2bb3b1bf2b09d54bf3e51fbc1469cf6c10aa03e21141f51969801a7897"}, - {file = "redis-5.2.0.tar.gz", hash = "sha256:0b1087665a771b1ff2e003aa5bdd354f15a70c9e25d5a7dbf9c722c16528a7b0"}, + {file = "redis-5.2.1-py3-none-any.whl", hash = "sha256:ee7e1056b9aea0f04c6c2ed59452947f34c4940ee025f5dd83e6a6418b6989e4"}, + {file = "redis-5.2.1.tar.gz", hash = "sha256:16f2e22dff21d5125e8481515e386711a34cbec50f0e44413dd7d9c060a54e0f"}, ] [package.dependencies] @@ -2206,13 +2678,13 @@ reflex = ">=0.6.0a" [[package]] name = "reflex-hosting-cli" -version = "0.1.17" +version = "0.1.30" description = "Reflex Hosting CLI" optional = false python-versions = "<4.0,>=3.8" files = [ - {file = "reflex_hosting_cli-0.1.17-py3-none-any.whl", hash = "sha256:cf1accec70745557a40125ffa2a8929e6ef9834808afe78e4f4a01933ac0cb67"}, - {file = "reflex_hosting_cli-0.1.17.tar.gz", hash = "sha256:263d8dc217eb24d4198ac0bcfd710980bd7795d9818a5e522027657f94752710"}, + {file = "reflex_hosting_cli-0.1.30-py3-none-any.whl", hash = "sha256:778c98d635003d8668158c22eaa0f7124d2bac92c8a1aabaed710960ca97796e"}, + {file = "reflex_hosting_cli-0.1.30.tar.gz", hash = "sha256:a0fdc73e595e6b9fd661e1307ae37267fb3815cc457b7f15938ba921c12fc0b6"}, ] [package.dependencies] @@ -2224,7 +2696,7 @@ pydantic = ">=1.10.2,<3.0" python-dateutil = ">=2.8.1" rich = ">=13.0.0,<14.0" tabulate = ">=0.9.0,<0.10.0" -typer = ">=0.4.2,<1" +typer = ">=0.15.0,<1" websockets = ">=10.4" [[package]] @@ -2297,29 +2769,29 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"] [[package]] name = "ruff" -version = "0.7.4" +version = "0.8.2" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.7.4-py3-none-linux_armv6l.whl", hash = "sha256:a4919925e7684a3f18e18243cd6bea7cfb8e968a6eaa8437971f681b7ec51478"}, - {file = "ruff-0.7.4-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:cfb365c135b830778dda8c04fb7d4280ed0b984e1aec27f574445231e20d6c63"}, - {file = "ruff-0.7.4-py3-none-macosx_11_0_arm64.whl", hash = "sha256:63a569b36bc66fbadec5beaa539dd81e0527cb258b94e29e0531ce41bacc1f20"}, - {file = "ruff-0.7.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0d06218747d361d06fd2fdac734e7fa92df36df93035db3dc2ad7aa9852cb109"}, - {file = "ruff-0.7.4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e0cea28d0944f74ebc33e9f934238f15c758841f9f5edd180b5315c203293452"}, - {file = "ruff-0.7.4-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:80094ecd4793c68b2571b128f91754d60f692d64bc0d7272ec9197fdd09bf9ea"}, - {file = "ruff-0.7.4-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:997512325c6620d1c4c2b15db49ef59543ef9cd0f4aa8065ec2ae5103cedc7e7"}, - {file = "ruff-0.7.4-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:00b4cf3a6b5fad6d1a66e7574d78956bbd09abfd6c8a997798f01f5da3d46a05"}, - {file = "ruff-0.7.4-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7dbdc7d8274e1422722933d1edddfdc65b4336abf0b16dfcb9dedd6e6a517d06"}, - {file = "ruff-0.7.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e92dfb5f00eaedb1501b2f906ccabfd67b2355bdf117fea9719fc99ac2145bc"}, - {file = "ruff-0.7.4-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:3bd726099f277d735dc38900b6a8d6cf070f80828877941983a57bca1cd92172"}, - {file = "ruff-0.7.4-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:2e32829c429dd081ee5ba39aef436603e5b22335c3d3fff013cd585806a6486a"}, - {file = "ruff-0.7.4-py3-none-musllinux_1_2_i686.whl", hash = "sha256:662a63b4971807623f6f90c1fb664613f67cc182dc4d991471c23c541fee62dd"}, - {file = "ruff-0.7.4-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:876f5e09eaae3eb76814c1d3b68879891d6fde4824c015d48e7a7da4cf066a3a"}, - {file = "ruff-0.7.4-py3-none-win32.whl", hash = "sha256:75c53f54904be42dd52a548728a5b572344b50d9b2873d13a3f8c5e3b91f5cac"}, - {file = "ruff-0.7.4-py3-none-win_amd64.whl", hash = "sha256:745775c7b39f914238ed1f1b0bebed0b9155a17cd8bc0b08d3c87e4703b990d6"}, - {file = "ruff-0.7.4-py3-none-win_arm64.whl", hash = "sha256:11bff065102c3ae9d3ea4dc9ecdfe5a5171349cdd0787c1fc64761212fc9cf1f"}, - {file = "ruff-0.7.4.tar.gz", hash = "sha256:cd12e35031f5af6b9b93715d8c4f40360070b2041f81273d0527683d5708fce2"}, + {file = "ruff-0.8.2-py3-none-linux_armv6l.whl", hash = "sha256:c49ab4da37e7c457105aadfd2725e24305ff9bc908487a9bf8d548c6dad8bb3d"}, + {file = "ruff-0.8.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:ec016beb69ac16be416c435828be702ee694c0d722505f9c1f35e1b9c0cc1bf5"}, + {file = "ruff-0.8.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:f05cdf8d050b30e2ba55c9b09330b51f9f97d36d4673213679b965d25a785f3c"}, + {file = "ruff-0.8.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:60f578c11feb1d3d257b2fb043ddb47501ab4816e7e221fbb0077f0d5d4e7b6f"}, + {file = "ruff-0.8.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cbd5cf9b0ae8f30eebc7b360171bd50f59ab29d39f06a670b3e4501a36ba5897"}, + {file = "ruff-0.8.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b402ddee3d777683de60ff76da801fa7e5e8a71038f57ee53e903afbcefdaa58"}, + {file = "ruff-0.8.2-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:705832cd7d85605cb7858d8a13d75993c8f3ef1397b0831289109e953d833d29"}, + {file = "ruff-0.8.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:32096b41aaf7a5cc095fa45b4167b890e4c8d3fd217603f3634c92a541de7248"}, + {file = "ruff-0.8.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e769083da9439508833cfc7c23e351e1809e67f47c50248250ce1ac52c21fb93"}, + {file = "ruff-0.8.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5fe716592ae8a376c2673fdfc1f5c0c193a6d0411f90a496863c99cd9e2ae25d"}, + {file = "ruff-0.8.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:81c148825277e737493242b44c5388a300584d73d5774defa9245aaef55448b0"}, + {file = "ruff-0.8.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:d261d7850c8367704874847d95febc698a950bf061c9475d4a8b7689adc4f7fa"}, + {file = "ruff-0.8.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:1ca4e3a87496dc07d2427b7dd7ffa88a1e597c28dad65ae6433ecb9f2e4f022f"}, + {file = "ruff-0.8.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:729850feed82ef2440aa27946ab39c18cb4a8889c1128a6d589ffa028ddcfc22"}, + {file = "ruff-0.8.2-py3-none-win32.whl", hash = "sha256:ac42caaa0411d6a7d9594363294416e0e48fc1279e1b0e948391695db2b3d5b1"}, + {file = "ruff-0.8.2-py3-none-win_amd64.whl", hash = "sha256:2aae99ec70abf43372612a838d97bfe77d45146254568d94926e8ed5bbb409ea"}, + {file = "ruff-0.8.2-py3-none-win_arm64.whl", hash = "sha256:fb88e2a506b70cfbc2de6fae6681c4f944f7dd5f2fe87233a7233d888bad73e8"}, + {file = "ruff-0.8.2.tar.gz", hash = "sha256:b84f4f414dda8ac7f75075c1fa0b905ac0ff25361f42e6d5da681a465e0f78e5"}, ] [[package]] @@ -2339,13 +2811,13 @@ jeepney = ">=0.6" [[package]] name = "selenium" -version = "4.26.1" +version = "4.27.1" description = "Official Python bindings for Selenium WebDriver" optional = false python-versions = ">=3.8" files = [ - {file = "selenium-4.26.1-py3-none-any.whl", hash = "sha256:1db3f3a0cd5bb07624fa8a3905a6fdde1595a42185a0617077c361dc53d104fb"}, - {file = "selenium-4.26.1.tar.gz", hash = "sha256:7640f3f08ae7f4e450f895678e8a10a55eb4e4ca18311ed675ecc4684b96b683"}, + {file = "selenium-4.27.1-py3-none-any.whl", hash = "sha256:b89b1f62b5cfe8025868556fe82360d6b649d464f75d2655cb966c8f8447ea18"}, + {file = "selenium-4.27.1.tar.gz", hash = "sha256:5296c425a75ff1b44d0d5199042b36a6d1ef76c04fb775b97b40be739a9caae2"}, ] [package.dependencies] @@ -2407,13 +2879,13 @@ docs = ["sphinx"] [[package]] name = "six" -version = "1.16.0" +version = "1.17.0" description = "Python 2 and 3 compatibility utilities" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" files = [ - {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, - {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, + {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, + {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, ] [[package]] @@ -2642,13 +3114,43 @@ files = [ [[package]] name = "tomli" -version = "2.1.0" +version = "2.2.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.8" files = [ - {file = "tomli-2.1.0-py3-none-any.whl", hash = "sha256:a5c57c3d1c56f5ccdf89f6523458f60ef716e210fc47c4cfb188c5ba473e0391"}, - {file = "tomli-2.1.0.tar.gz", hash = "sha256:3f646cae2aec94e17d04973e4249548320197cfabdf130015d023de4b74d8ab8"}, + {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, + {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8"}, + {file = "tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff"}, + {file = "tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b"}, + {file = "tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea"}, + {file = "tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e"}, + {file = "tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98"}, + {file = "tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4"}, + {file = "tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7"}, + {file = "tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744"}, + {file = "tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec"}, + {file = "tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69"}, + {file = "tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc"}, + {file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"}, ] [[package]] @@ -2700,19 +3202,20 @@ wsproto = ">=0.14" [[package]] name = "twine" -version = "5.1.1" +version = "6.0.1" description = "Collection of utilities for publishing packages on PyPI" optional = false python-versions = ">=3.8" files = [ - {file = "twine-5.1.1-py3-none-any.whl", hash = "sha256:215dbe7b4b94c2c50a7315c0275d2258399280fbb7d04182c7e55e24b5f93997"}, - {file = "twine-5.1.1.tar.gz", hash = "sha256:9aa0825139c02b3434d913545c7b847a21c835e11597f5255842d457da2322db"}, + {file = "twine-6.0.1-py3-none-any.whl", hash = "sha256:9c6025b203b51521d53e200f4a08b116dee7500a38591668c6a6033117bdc218"}, + {file = "twine-6.0.1.tar.gz", hash = "sha256:36158b09df5406e1c9c1fb8edb24fc2be387709443e7376689b938531582ee27"}, ] [package.dependencies] -importlib-metadata = ">=3.6" -keyring = ">=15.1" -pkginfo = ">=1.8.1,<1.11" +importlib-metadata = {version = ">=3.6", markers = "python_version < \"3.10\""} +keyring = {version = ">=15.1", markers = "platform_machine != \"ppc64le\" and platform_machine != \"s390x\""} +packaging = "*" +pkginfo = ">=1.8.1" readme-renderer = ">=35.0" requests = ">=2.20" requests-toolbelt = ">=0.8.0,<0.9.0 || >0.9.0" @@ -2720,15 +3223,18 @@ rfc3986 = ">=1.4.0" rich = ">=12.0.0" urllib3 = ">=1.26.0" +[package.extras] +keyring = ["keyring (>=15.1)"] + [[package]] name = "typer" -version = "0.13.1" +version = "0.15.1" description = "Typer, build great CLIs. Easy to code. Based on Python type hints." optional = false python-versions = ">=3.7" files = [ - {file = "typer-0.13.1-py3-none-any.whl", hash = "sha256:5b59580fd925e89463a29d363e0a43245ec02765bde9fb77d39e5d0f29dd7157"}, - {file = "typer-0.13.1.tar.gz", hash = "sha256:9d444cb96cc268ce6f8b94e13b4335084cef4c079998a9f4851a90229a3bd25c"}, + {file = "typer-0.15.1-py3-none-any.whl", hash = "sha256:7994fb7b8155b64d3402518560648446072864beefd44aa2dc36972a5972e847"}, + {file = "typer-0.15.1.tar.gz", hash = "sha256:a0588c0a7fa68a1978a069818657778f86abe6ff5ea6abf472f940a08bfe4f0a"}, ] [package.dependencies] @@ -2800,13 +3306,13 @@ standard = ["colorama (>=0.4)", "httptools (>=0.6.3)", "python-dotenv (>=0.13)", [[package]] name = "virtualenv" -version = "20.27.1" +version = "20.28.0" description = "Virtual Python Environment builder" optional = false python-versions = ">=3.8" files = [ - {file = "virtualenv-20.27.1-py3-none-any.whl", hash = "sha256:f11f1b8a29525562925f745563bfd48b189450f61fb34c4f9cc79dd5aa32a1f4"}, - {file = "virtualenv-20.27.1.tar.gz", hash = "sha256:142c6be10212543b32c6c45d3d3893dff89112cc588b7d0879ae5a1ec03a47ba"}, + {file = "virtualenv-20.28.0-py3-none-any.whl", hash = "sha256:23eae1b4516ecd610481eda647f3a7c09aea295055337331bb4e6892ecce47b0"}, + {file = "virtualenv-20.28.0.tar.gz", hash = "sha256:2c9c3262bb8e7b87ea801d715fae4495e6032450c71d2309be9550e7364049aa"}, ] [package.dependencies] @@ -2914,13 +3420,13 @@ files = [ [[package]] name = "wheel" -version = "0.45.0" +version = "0.45.1" description = "A built-package format for Python" optional = false python-versions = ">=3.8" files = [ - {file = "wheel-0.45.0-py3-none-any.whl", hash = "sha256:52f0baa5e6522155090a09c6bd95718cc46956d1b51d537ea5454249edb671c7"}, - {file = "wheel-0.45.0.tar.gz", hash = "sha256:a57353941a3183b3d5365346b567a260a0602a0f8a635926a7dede41b94c674a"}, + {file = "wheel-0.45.1-py3-none-any.whl", hash = "sha256:708e7481cc80179af0e556bbf0cc00b8444c7321e2700b8d8580231d13017248"}, + {file = "wheel-0.45.1.tar.gz", hash = "sha256:661e1abd9198507b1409a20c02106d9670b2576e916d58f520316666abca6729"}, ] [package.extras] @@ -2928,81 +3434,76 @@ test = ["pytest (>=6.0.0)", "setuptools (>=65)"] [[package]] name = "wrapt" -version = "1.16.0" +version = "1.17.0" description = "Module for decorators, wrappers and monkey patching." optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "wrapt-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ffa565331890b90056c01db69c0fe634a776f8019c143a5ae265f9c6bc4bd6d4"}, - {file = "wrapt-1.16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e4fdb9275308292e880dcbeb12546df7f3e0f96c6b41197e0cf37d2826359020"}, - {file = "wrapt-1.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bb2dee3874a500de01c93d5c71415fcaef1d858370d405824783e7a8ef5db440"}, - {file = "wrapt-1.16.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2a88e6010048489cda82b1326889ec075a8c856c2e6a256072b28eaee3ccf487"}, - {file = "wrapt-1.16.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ac83a914ebaf589b69f7d0a1277602ff494e21f4c2f743313414378f8f50a4cf"}, - {file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:73aa7d98215d39b8455f103de64391cb79dfcad601701a3aa0dddacf74911d72"}, - {file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:807cc8543a477ab7422f1120a217054f958a66ef7314f76dd9e77d3f02cdccd0"}, - {file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bf5703fdeb350e36885f2875d853ce13172ae281c56e509f4e6eca049bdfb136"}, - {file = "wrapt-1.16.0-cp310-cp310-win32.whl", hash = "sha256:f6b2d0c6703c988d334f297aa5df18c45e97b0af3679bb75059e0e0bd8b1069d"}, - {file = "wrapt-1.16.0-cp310-cp310-win_amd64.whl", hash = "sha256:decbfa2f618fa8ed81c95ee18a387ff973143c656ef800c9f24fb7e9c16054e2"}, - {file = "wrapt-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1a5db485fe2de4403f13fafdc231b0dbae5eca4359232d2efc79025527375b09"}, - {file = "wrapt-1.16.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:75ea7d0ee2a15733684badb16de6794894ed9c55aa5e9903260922f0482e687d"}, - {file = "wrapt-1.16.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a452f9ca3e3267cd4d0fcf2edd0d035b1934ac2bd7e0e57ac91ad6b95c0c6389"}, - {file = "wrapt-1.16.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:43aa59eadec7890d9958748db829df269f0368521ba6dc68cc172d5d03ed8060"}, - {file = "wrapt-1.16.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:72554a23c78a8e7aa02abbd699d129eead8b147a23c56e08d08dfc29cfdddca1"}, - {file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d2efee35b4b0a347e0d99d28e884dfd82797852d62fcd7ebdeee26f3ceb72cf3"}, - {file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:6dcfcffe73710be01d90cae08c3e548d90932d37b39ef83969ae135d36ef3956"}, - {file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:eb6e651000a19c96f452c85132811d25e9264d836951022d6e81df2fff38337d"}, - {file = "wrapt-1.16.0-cp311-cp311-win32.whl", hash = "sha256:66027d667efe95cc4fa945af59f92c5a02c6f5bb6012bff9e60542c74c75c362"}, - {file = "wrapt-1.16.0-cp311-cp311-win_amd64.whl", hash = "sha256:aefbc4cb0a54f91af643660a0a150ce2c090d3652cf4052a5397fb2de549cd89"}, - {file = "wrapt-1.16.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:5eb404d89131ec9b4f748fa5cfb5346802e5ee8836f57d516576e61f304f3b7b"}, - {file = "wrapt-1.16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:9090c9e676d5236a6948330e83cb89969f433b1943a558968f659ead07cb3b36"}, - {file = "wrapt-1.16.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:94265b00870aa407bd0cbcfd536f17ecde43b94fb8d228560a1e9d3041462d73"}, - {file = "wrapt-1.16.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f2058f813d4f2b5e3a9eb2eb3faf8f1d99b81c3e51aeda4b168406443e8ba809"}, - {file = "wrapt-1.16.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:98b5e1f498a8ca1858a1cdbffb023bfd954da4e3fa2c0cb5853d40014557248b"}, - {file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:14d7dc606219cdd7405133c713f2c218d4252f2a469003f8c46bb92d5d095d81"}, - {file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:49aac49dc4782cb04f58986e81ea0b4768e4ff197b57324dcbd7699c5dfb40b9"}, - {file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:418abb18146475c310d7a6dc71143d6f7adec5b004ac9ce08dc7a34e2babdc5c"}, - {file = "wrapt-1.16.0-cp312-cp312-win32.whl", hash = "sha256:685f568fa5e627e93f3b52fda002c7ed2fa1800b50ce51f6ed1d572d8ab3e7fc"}, - {file = "wrapt-1.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:dcdba5c86e368442528f7060039eda390cc4091bfd1dca41e8046af7c910dda8"}, - {file = "wrapt-1.16.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:d462f28826f4657968ae51d2181a074dfe03c200d6131690b7d65d55b0f360f8"}, - {file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a33a747400b94b6d6b8a165e4480264a64a78c8a4c734b62136062e9a248dd39"}, - {file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b3646eefa23daeba62643a58aac816945cadc0afaf21800a1421eeba5f6cfb9c"}, - {file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ebf019be5c09d400cf7b024aa52b1f3aeebeff51550d007e92c3c1c4afc2a40"}, - {file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:0d2691979e93d06a95a26257adb7bfd0c93818e89b1406f5a28f36e0d8c1e1fc"}, - {file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:1acd723ee2a8826f3d53910255643e33673e1d11db84ce5880675954183ec47e"}, - {file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:bc57efac2da352a51cc4658878a68d2b1b67dbe9d33c36cb826ca449d80a8465"}, - {file = "wrapt-1.16.0-cp36-cp36m-win32.whl", hash = "sha256:da4813f751142436b075ed7aa012a8778aa43a99f7b36afe9b742d3ed8bdc95e"}, - {file = "wrapt-1.16.0-cp36-cp36m-win_amd64.whl", hash = "sha256:6f6eac2360f2d543cc875a0e5efd413b6cbd483cb3ad7ebf888884a6e0d2e966"}, - {file = "wrapt-1.16.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a0ea261ce52b5952bf669684a251a66df239ec6d441ccb59ec7afa882265d593"}, - {file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7bd2d7ff69a2cac767fbf7a2b206add2e9a210e57947dd7ce03e25d03d2de292"}, - {file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9159485323798c8dc530a224bd3ffcf76659319ccc7bbd52e01e73bd0241a0c5"}, - {file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a86373cf37cd7764f2201b76496aba58a52e76dedfaa698ef9e9688bfd9e41cf"}, - {file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:73870c364c11f03ed072dda68ff7aea6d2a3a5c3fe250d917a429c7432e15228"}, - {file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:b935ae30c6e7400022b50f8d359c03ed233d45b725cfdd299462f41ee5ffba6f"}, - {file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:db98ad84a55eb09b3c32a96c576476777e87c520a34e2519d3e59c44710c002c"}, - {file = "wrapt-1.16.0-cp37-cp37m-win32.whl", hash = "sha256:9153ed35fc5e4fa3b2fe97bddaa7cbec0ed22412b85bcdaf54aeba92ea37428c"}, - {file = "wrapt-1.16.0-cp37-cp37m-win_amd64.whl", hash = "sha256:66dfbaa7cfa3eb707bbfcd46dab2bc6207b005cbc9caa2199bcbc81d95071a00"}, - {file = "wrapt-1.16.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1dd50a2696ff89f57bd8847647a1c363b687d3d796dc30d4dd4a9d1689a706f0"}, - {file = "wrapt-1.16.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:44a2754372e32ab315734c6c73b24351d06e77ffff6ae27d2ecf14cf3d229202"}, - {file = "wrapt-1.16.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e9723528b9f787dc59168369e42ae1c3b0d3fadb2f1a71de14531d321ee05b0"}, - {file = "wrapt-1.16.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dbed418ba5c3dce92619656802cc5355cb679e58d0d89b50f116e4a9d5a9603e"}, - {file = "wrapt-1.16.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:941988b89b4fd6b41c3f0bfb20e92bd23746579736b7343283297c4c8cbae68f"}, - {file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:6a42cd0cfa8ffc1915aef79cb4284f6383d8a3e9dcca70c445dcfdd639d51267"}, - {file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:1ca9b6085e4f866bd584fb135a041bfc32cab916e69f714a7d1d397f8c4891ca"}, - {file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:d5e49454f19ef621089e204f862388d29e6e8d8b162efce05208913dde5b9ad6"}, - {file = "wrapt-1.16.0-cp38-cp38-win32.whl", hash = "sha256:c31f72b1b6624c9d863fc095da460802f43a7c6868c5dda140f51da24fd47d7b"}, - {file = "wrapt-1.16.0-cp38-cp38-win_amd64.whl", hash = "sha256:490b0ee15c1a55be9c1bd8609b8cecd60e325f0575fc98f50058eae366e01f41"}, - {file = "wrapt-1.16.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9b201ae332c3637a42f02d1045e1d0cccfdc41f1f2f801dafbaa7e9b4797bfc2"}, - {file = "wrapt-1.16.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2076fad65c6736184e77d7d4729b63a6d1ae0b70da4868adeec40989858eb3fb"}, - {file = "wrapt-1.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c5cd603b575ebceca7da5a3a251e69561bec509e0b46e4993e1cac402b7247b8"}, - {file = "wrapt-1.16.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b47cfad9e9bbbed2339081f4e346c93ecd7ab504299403320bf85f7f85c7d46c"}, - {file = "wrapt-1.16.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f8212564d49c50eb4565e502814f694e240c55551a5f1bc841d4fcaabb0a9b8a"}, - {file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:5f15814a33e42b04e3de432e573aa557f9f0f56458745c2074952f564c50e664"}, - {file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:db2e408d983b0e61e238cf579c09ef7020560441906ca990fe8412153e3b291f"}, - {file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:edfad1d29c73f9b863ebe7082ae9321374ccb10879eeabc84ba3b69f2579d537"}, - {file = "wrapt-1.16.0-cp39-cp39-win32.whl", hash = "sha256:ed867c42c268f876097248e05b6117a65bcd1e63b779e916fe2e33cd6fd0d3c3"}, - {file = "wrapt-1.16.0-cp39-cp39-win_amd64.whl", hash = "sha256:eb1b046be06b0fce7249f1d025cd359b4b80fc1c3e24ad9eca33e0dcdb2e4a35"}, - {file = "wrapt-1.16.0-py3-none-any.whl", hash = "sha256:6906c4100a8fcbf2fa735f6059214bb13b97f75b1a61777fcf6432121ef12ef1"}, - {file = "wrapt-1.16.0.tar.gz", hash = "sha256:5f370f952971e7d17c7d1ead40e49f32345a7f7a5373571ef44d800d06b1899d"}, + {file = "wrapt-1.17.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2a0c23b8319848426f305f9cb0c98a6e32ee68a36264f45948ccf8e7d2b941f8"}, + {file = "wrapt-1.17.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b1ca5f060e205f72bec57faae5bd817a1560fcfc4af03f414b08fa29106b7e2d"}, + {file = "wrapt-1.17.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e185ec6060e301a7e5f8461c86fb3640a7beb1a0f0208ffde7a65ec4074931df"}, + {file = "wrapt-1.17.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bb90765dd91aed05b53cd7a87bd7f5c188fcd95960914bae0d32c5e7f899719d"}, + {file = "wrapt-1.17.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:879591c2b5ab0a7184258274c42a126b74a2c3d5a329df16d69f9cee07bba6ea"}, + {file = "wrapt-1.17.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:fce6fee67c318fdfb7f285c29a82d84782ae2579c0e1b385b7f36c6e8074fffb"}, + {file = "wrapt-1.17.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:0698d3a86f68abc894d537887b9bbf84d29bcfbc759e23f4644be27acf6da301"}, + {file = "wrapt-1.17.0-cp310-cp310-win32.whl", hash = "sha256:69d093792dc34a9c4c8a70e4973a3361c7a7578e9cd86961b2bbf38ca71e4e22"}, + {file = "wrapt-1.17.0-cp310-cp310-win_amd64.whl", hash = "sha256:f28b29dc158ca5d6ac396c8e0a2ef45c4e97bb7e65522bfc04c989e6fe814575"}, + {file = "wrapt-1.17.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:74bf625b1b4caaa7bad51d9003f8b07a468a704e0644a700e936c357c17dd45a"}, + {file = "wrapt-1.17.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0f2a28eb35cf99d5f5bd12f5dd44a0f41d206db226535b37b0c60e9da162c3ed"}, + {file = "wrapt-1.17.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:81b1289e99cf4bad07c23393ab447e5e96db0ab50974a280f7954b071d41b489"}, + {file = "wrapt-1.17.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9f2939cd4a2a52ca32bc0b359015718472d7f6de870760342e7ba295be9ebaf9"}, + {file = "wrapt-1.17.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:6a9653131bda68a1f029c52157fd81e11f07d485df55410401f745007bd6d339"}, + {file = "wrapt-1.17.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4e4b4385363de9052dac1a67bfb535c376f3d19c238b5f36bddc95efae15e12d"}, + {file = "wrapt-1.17.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:bdf62d25234290db1837875d4dceb2151e4ea7f9fff2ed41c0fde23ed542eb5b"}, + {file = "wrapt-1.17.0-cp311-cp311-win32.whl", hash = "sha256:5d8fd17635b262448ab8f99230fe4dac991af1dabdbb92f7a70a6afac8a7e346"}, + {file = "wrapt-1.17.0-cp311-cp311-win_amd64.whl", hash = "sha256:92a3d214d5e53cb1db8b015f30d544bc9d3f7179a05feb8f16df713cecc2620a"}, + {file = "wrapt-1.17.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:89fc28495896097622c3fc238915c79365dd0ede02f9a82ce436b13bd0ab7569"}, + {file = "wrapt-1.17.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:875d240fdbdbe9e11f9831901fb8719da0bd4e6131f83aa9f69b96d18fae7504"}, + {file = "wrapt-1.17.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e5ed16d95fd142e9c72b6c10b06514ad30e846a0d0917ab406186541fe68b451"}, + {file = "wrapt-1.17.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:18b956061b8db634120b58f668592a772e87e2e78bc1f6a906cfcaa0cc7991c1"}, + {file = "wrapt-1.17.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:daba396199399ccabafbfc509037ac635a6bc18510ad1add8fd16d4739cdd106"}, + {file = "wrapt-1.17.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:4d63f4d446e10ad19ed01188d6c1e1bb134cde8c18b0aa2acfd973d41fcc5ada"}, + {file = "wrapt-1.17.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:8a5e7cc39a45fc430af1aefc4d77ee6bad72c5bcdb1322cfde852c15192b8bd4"}, + {file = "wrapt-1.17.0-cp312-cp312-win32.whl", hash = "sha256:0a0a1a1ec28b641f2a3a2c35cbe86c00051c04fffcfcc577ffcdd707df3f8635"}, + {file = "wrapt-1.17.0-cp312-cp312-win_amd64.whl", hash = "sha256:3c34f6896a01b84bab196f7119770fd8466c8ae3dfa73c59c0bb281e7b588ce7"}, + {file = "wrapt-1.17.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:714c12485aa52efbc0fc0ade1e9ab3a70343db82627f90f2ecbc898fdf0bb181"}, + {file = "wrapt-1.17.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da427d311782324a376cacb47c1a4adc43f99fd9d996ffc1b3e8529c4074d393"}, + {file = "wrapt-1.17.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ba1739fb38441a27a676f4de4123d3e858e494fac05868b7a281c0a383c098f4"}, + {file = "wrapt-1.17.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e711fc1acc7468463bc084d1b68561e40d1eaa135d8c509a65dd534403d83d7b"}, + {file = "wrapt-1.17.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:140ea00c87fafc42739bd74a94a5a9003f8e72c27c47cd4f61d8e05e6dec8721"}, + {file = "wrapt-1.17.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:73a96fd11d2b2e77d623a7f26e004cc31f131a365add1ce1ce9a19e55a1eef90"}, + {file = "wrapt-1.17.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:0b48554952f0f387984da81ccfa73b62e52817a4386d070c75e4db7d43a28c4a"}, + {file = "wrapt-1.17.0-cp313-cp313-win32.whl", hash = "sha256:498fec8da10e3e62edd1e7368f4b24aa362ac0ad931e678332d1b209aec93045"}, + {file = "wrapt-1.17.0-cp313-cp313-win_amd64.whl", hash = "sha256:fd136bb85f4568fffca995bd3c8d52080b1e5b225dbf1c2b17b66b4c5fa02838"}, + {file = "wrapt-1.17.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:17fcf043d0b4724858f25b8826c36e08f9fb2e475410bece0ec44a22d533da9b"}, + {file = "wrapt-1.17.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e4a557d97f12813dc5e18dad9fa765ae44ddd56a672bb5de4825527c847d6379"}, + {file = "wrapt-1.17.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0229b247b0fc7dee0d36176cbb79dbaf2a9eb7ecc50ec3121f40ef443155fb1d"}, + {file = "wrapt-1.17.0-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8425cfce27b8b20c9b89d77fb50e368d8306a90bf2b6eef2cdf5cd5083adf83f"}, + {file = "wrapt-1.17.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9c900108df470060174108012de06d45f514aa4ec21a191e7ab42988ff42a86c"}, + {file = "wrapt-1.17.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:4e547b447073fc0dbfcbff15154c1be8823d10dab4ad401bdb1575e3fdedff1b"}, + {file = "wrapt-1.17.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:914f66f3b6fc7b915d46c1cc424bc2441841083de01b90f9e81109c9759e43ab"}, + {file = "wrapt-1.17.0-cp313-cp313t-win32.whl", hash = "sha256:a4192b45dff127c7d69b3bdfb4d3e47b64179a0b9900b6351859f3001397dabf"}, + {file = "wrapt-1.17.0-cp313-cp313t-win_amd64.whl", hash = "sha256:4f643df3d4419ea3f856c5c3f40fec1d65ea2e89ec812c83f7767c8730f9827a"}, + {file = "wrapt-1.17.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:69c40d4655e078ede067a7095544bcec5a963566e17503e75a3a3e0fe2803b13"}, + {file = "wrapt-1.17.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2f495b6754358979379f84534f8dd7a43ff8cff2558dcdea4a148a6e713a758f"}, + {file = "wrapt-1.17.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:baa7ef4e0886a6f482e00d1d5bcd37c201b383f1d314643dfb0367169f94f04c"}, + {file = "wrapt-1.17.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a8fc931382e56627ec4acb01e09ce66e5c03c384ca52606111cee50d931a342d"}, + {file = "wrapt-1.17.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:8f8909cdb9f1b237786c09a810e24ee5e15ef17019f7cecb207ce205b9b5fcce"}, + {file = "wrapt-1.17.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:ad47b095f0bdc5585bced35bd088cbfe4177236c7df9984b3cc46b391cc60627"}, + {file = "wrapt-1.17.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:948a9bd0fb2c5120457b07e59c8d7210cbc8703243225dbd78f4dfc13c8d2d1f"}, + {file = "wrapt-1.17.0-cp38-cp38-win32.whl", hash = "sha256:5ae271862b2142f4bc687bdbfcc942e2473a89999a54231aa1c2c676e28f29ea"}, + {file = "wrapt-1.17.0-cp38-cp38-win_amd64.whl", hash = "sha256:f335579a1b485c834849e9075191c9898e0731af45705c2ebf70e0cd5d58beed"}, + {file = "wrapt-1.17.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:d751300b94e35b6016d4b1e7d0e7bbc3b5e1751e2405ef908316c2a9024008a1"}, + {file = "wrapt-1.17.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7264cbb4a18dc4acfd73b63e4bcfec9c9802614572025bdd44d0721983fc1d9c"}, + {file = "wrapt-1.17.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:33539c6f5b96cf0b1105a0ff4cf5db9332e773bb521cc804a90e58dc49b10578"}, + {file = "wrapt-1.17.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c30970bdee1cad6a8da2044febd824ef6dc4cc0b19e39af3085c763fdec7de33"}, + {file = "wrapt-1.17.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:bc7f729a72b16ee21795a943f85c6244971724819819a41ddbaeb691b2dd85ad"}, + {file = "wrapt-1.17.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:6ff02a91c4fc9b6a94e1c9c20f62ea06a7e375f42fe57587f004d1078ac86ca9"}, + {file = "wrapt-1.17.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:2dfb7cff84e72e7bf975b06b4989477873dcf160b2fd89959c629535df53d4e0"}, + {file = "wrapt-1.17.0-cp39-cp39-win32.whl", hash = "sha256:2399408ac33ffd5b200480ee858baa58d77dd30e0dd0cab6a8a9547135f30a88"}, + {file = "wrapt-1.17.0-cp39-cp39-win_amd64.whl", hash = "sha256:4f763a29ee6a20c529496a20a7bcb16a73de27f5da6a843249c7047daf135977"}, + {file = "wrapt-1.17.0-py3-none-any.whl", hash = "sha256:d2c63b93548eda58abf5188e505ffed0229bf675f7c3090f8e36ad55b8cbc371"}, + {file = "wrapt-1.17.0.tar.gz", hash = "sha256:16187aa2317c731170a88ef35e8937ae0f533c402872c1ee5e6d079fcf320801"}, ] [[package]] @@ -3019,6 +3520,102 @@ files = [ [package.dependencies] h11 = ">=0.9.0,<1" +[[package]] +name = "yarl" +version = "1.17.1" +description = "Yet another URL library" +optional = false +python-versions = ">=3.9" +files = [ + {file = "yarl-1.17.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:0b1794853124e2f663f0ea54efb0340b457f08d40a1cef78edfa086576179c91"}, + {file = "yarl-1.17.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:fbea1751729afe607d84acfd01efd95e3b31db148a181a441984ce9b3d3469da"}, + {file = "yarl-1.17.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8ee427208c675f1b6e344a1f89376a9613fc30b52646a04ac0c1f6587c7e46ec"}, + {file = "yarl-1.17.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3b74ff4767d3ef47ffe0cd1d89379dc4d828d4873e5528976ced3b44fe5b0a21"}, + {file = "yarl-1.17.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:62a91aefff3d11bf60e5956d340eb507a983a7ec802b19072bb989ce120cd948"}, + {file = "yarl-1.17.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:846dd2e1243407133d3195d2d7e4ceefcaa5f5bf7278f0a9bda00967e6326b04"}, + {file = "yarl-1.17.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3e844be8d536afa129366d9af76ed7cb8dfefec99f5f1c9e4f8ae542279a6dc3"}, + {file = "yarl-1.17.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cc7c92c1baa629cb03ecb0c3d12564f172218fb1739f54bf5f3881844daadc6d"}, + {file = "yarl-1.17.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:ae3476e934b9d714aa8000d2e4c01eb2590eee10b9d8cd03e7983ad65dfbfcba"}, + {file = "yarl-1.17.1-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:c7e177c619342e407415d4f35dec63d2d134d951e24b5166afcdfd1362828e17"}, + {file = "yarl-1.17.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:64cc6e97f14cf8a275d79c5002281f3040c12e2e4220623b5759ea7f9868d6a5"}, + {file = "yarl-1.17.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:84c063af19ef5130084db70ada40ce63a84f6c1ef4d3dbc34e5e8c4febb20822"}, + {file = "yarl-1.17.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:482c122b72e3c5ec98f11457aeb436ae4aecca75de19b3d1de7cf88bc40db82f"}, + {file = "yarl-1.17.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:380e6c38ef692b8fd5a0f6d1fa8774d81ebc08cfbd624b1bca62a4d4af2f9931"}, + {file = "yarl-1.17.1-cp310-cp310-win32.whl", hash = "sha256:16bca6678a83657dd48df84b51bd56a6c6bd401853aef6d09dc2506a78484c7b"}, + {file = "yarl-1.17.1-cp310-cp310-win_amd64.whl", hash = "sha256:561c87fea99545ef7d692403c110b2f99dced6dff93056d6e04384ad3bc46243"}, + {file = "yarl-1.17.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:cbad927ea8ed814622305d842c93412cb47bd39a496ed0f96bfd42b922b4a217"}, + {file = "yarl-1.17.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:fca4b4307ebe9c3ec77a084da3a9d1999d164693d16492ca2b64594340999988"}, + {file = "yarl-1.17.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ff5c6771c7e3511a06555afa317879b7db8d640137ba55d6ab0d0c50425cab75"}, + {file = "yarl-1.17.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5b29beab10211a746f9846baa39275e80034e065460d99eb51e45c9a9495bcca"}, + {file = "yarl-1.17.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1a52a1ffdd824fb1835272e125385c32fd8b17fbdefeedcb4d543cc23b332d74"}, + {file = "yarl-1.17.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:58c8e9620eb82a189c6c40cb6b59b4e35b2ee68b1f2afa6597732a2b467d7e8f"}, + {file = "yarl-1.17.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d216e5d9b8749563c7f2c6f7a0831057ec844c68b4c11cb10fc62d4fd373c26d"}, + {file = "yarl-1.17.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:881764d610e3269964fc4bb3c19bb6fce55422828e152b885609ec176b41cf11"}, + {file = "yarl-1.17.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8c79e9d7e3d8a32d4824250a9c6401194fb4c2ad9a0cec8f6a96e09a582c2cc0"}, + {file = "yarl-1.17.1-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:299f11b44d8d3a588234adbe01112126010bd96d9139c3ba7b3badd9829261c3"}, + {file = "yarl-1.17.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:cc7d768260f4ba4ea01741c1b5fe3d3a6c70eb91c87f4c8761bbcce5181beafe"}, + {file = "yarl-1.17.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:de599af166970d6a61accde358ec9ded821234cbbc8c6413acfec06056b8e860"}, + {file = "yarl-1.17.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:2b24ec55fad43e476905eceaf14f41f6478780b870eda5d08b4d6de9a60b65b4"}, + {file = "yarl-1.17.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9fb815155aac6bfa8d86184079652c9715c812d506b22cfa369196ef4e99d1b4"}, + {file = "yarl-1.17.1-cp311-cp311-win32.whl", hash = "sha256:7615058aabad54416ddac99ade09a5510cf77039a3b903e94e8922f25ed203d7"}, + {file = "yarl-1.17.1-cp311-cp311-win_amd64.whl", hash = "sha256:14bc88baa44e1f84164a392827b5defb4fa8e56b93fecac3d15315e7c8e5d8b3"}, + {file = "yarl-1.17.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:327828786da2006085a4d1feb2594de6f6d26f8af48b81eb1ae950c788d97f61"}, + {file = "yarl-1.17.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:cc353841428d56b683a123a813e6a686e07026d6b1c5757970a877195f880c2d"}, + {file = "yarl-1.17.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c73df5b6e8fabe2ddb74876fb82d9dd44cbace0ca12e8861ce9155ad3c886139"}, + {file = "yarl-1.17.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0bdff5e0995522706c53078f531fb586f56de9c4c81c243865dd5c66c132c3b5"}, + {file = "yarl-1.17.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:06157fb3c58f2736a5e47c8fcbe1afc8b5de6fb28b14d25574af9e62150fcaac"}, + {file = "yarl-1.17.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1654ec814b18be1af2c857aa9000de7a601400bd4c9ca24629b18486c2e35463"}, + {file = "yarl-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f6595c852ca544aaeeb32d357e62c9c780eac69dcd34e40cae7b55bc4fb1147"}, + {file = "yarl-1.17.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:459e81c2fb920b5f5df744262d1498ec2c8081acdcfe18181da44c50f51312f7"}, + {file = "yarl-1.17.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:7e48cdb8226644e2fbd0bdb0a0f87906a3db07087f4de77a1b1b1ccfd9e93685"}, + {file = "yarl-1.17.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:d9b6b28a57feb51605d6ae5e61a9044a31742db557a3b851a74c13bc61de5172"}, + {file = "yarl-1.17.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:e594b22688d5747b06e957f1ef822060cb5cb35b493066e33ceac0cf882188b7"}, + {file = "yarl-1.17.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:5f236cb5999ccd23a0ab1bd219cfe0ee3e1c1b65aaf6dd3320e972f7ec3a39da"}, + {file = "yarl-1.17.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:a2a64e62c7a0edd07c1c917b0586655f3362d2c2d37d474db1a509efb96fea1c"}, + {file = "yarl-1.17.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:d0eea830b591dbc68e030c86a9569826145df485b2b4554874b07fea1275a199"}, + {file = "yarl-1.17.1-cp312-cp312-win32.whl", hash = "sha256:46ddf6e0b975cd680eb83318aa1d321cb2bf8d288d50f1754526230fcf59ba96"}, + {file = "yarl-1.17.1-cp312-cp312-win_amd64.whl", hash = "sha256:117ed8b3732528a1e41af3aa6d4e08483c2f0f2e3d3d7dca7cf538b3516d93df"}, + {file = "yarl-1.17.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:5d1d42556b063d579cae59e37a38c61f4402b47d70c29f0ef15cee1acaa64488"}, + {file = "yarl-1.17.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:c0167540094838ee9093ef6cc2c69d0074bbf84a432b4995835e8e5a0d984374"}, + {file = "yarl-1.17.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2f0a6423295a0d282d00e8701fe763eeefba8037e984ad5de44aa349002562ac"}, + {file = "yarl-1.17.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5b078134f48552c4d9527db2f7da0b5359abd49393cdf9794017baec7506170"}, + {file = "yarl-1.17.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d401f07261dc5aa36c2e4efc308548f6ae943bfff20fcadb0a07517a26b196d8"}, + {file = "yarl-1.17.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b5f1ac7359e17efe0b6e5fec21de34145caef22b260e978336f325d5c84e6938"}, + {file = "yarl-1.17.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f63d176a81555984e91f2c84c2a574a61cab7111cc907e176f0f01538e9ff6e"}, + {file = "yarl-1.17.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9e275792097c9f7e80741c36de3b61917aebecc08a67ae62899b074566ff8556"}, + {file = "yarl-1.17.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:81713b70bea5c1386dc2f32a8f0dab4148a2928c7495c808c541ee0aae614d67"}, + {file = "yarl-1.17.1-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:aa46dce75078fceaf7cecac5817422febb4355fbdda440db55206e3bd288cfb8"}, + {file = "yarl-1.17.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:1ce36ded585f45b1e9bb36d0ae94765c6608b43bd2e7f5f88079f7a85c61a4d3"}, + {file = "yarl-1.17.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:2d374d70fdc36f5863b84e54775452f68639bc862918602d028f89310a034ab0"}, + {file = "yarl-1.17.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:2d9f0606baaec5dd54cb99667fcf85183a7477f3766fbddbe3f385e7fc253299"}, + {file = "yarl-1.17.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:b0341e6d9a0c0e3cdc65857ef518bb05b410dbd70d749a0d33ac0f39e81a4258"}, + {file = "yarl-1.17.1-cp313-cp313-win32.whl", hash = "sha256:2e7ba4c9377e48fb7b20dedbd473cbcbc13e72e1826917c185157a137dac9df2"}, + {file = "yarl-1.17.1-cp313-cp313-win_amd64.whl", hash = "sha256:949681f68e0e3c25377462be4b658500e85ca24323d9619fdc41f68d46a1ffda"}, + {file = "yarl-1.17.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:8994b29c462de9a8fce2d591028b986dbbe1b32f3ad600b2d3e1c482c93abad6"}, + {file = "yarl-1.17.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f9cbfbc5faca235fbdf531b93aa0f9f005ec7d267d9d738761a4d42b744ea159"}, + {file = "yarl-1.17.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b40d1bf6e6f74f7c0a567a9e5e778bbd4699d1d3d2c0fe46f4b717eef9e96b95"}, + {file = "yarl-1.17.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f5efe0661b9fcd6246f27957f6ae1c0eb29bc60552820f01e970b4996e016004"}, + {file = "yarl-1.17.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b5c4804e4039f487e942c13381e6c27b4b4e66066d94ef1fae3f6ba8b953f383"}, + {file = "yarl-1.17.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b5d6a6c9602fd4598fa07e0389e19fe199ae96449008d8304bf5d47cb745462e"}, + {file = "yarl-1.17.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f4c9156c4d1eb490fe374fb294deeb7bc7eaccda50e23775b2354b6a6739934"}, + {file = "yarl-1.17.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d6324274b4e0e2fa1b3eccb25997b1c9ed134ff61d296448ab8269f5ac068c4c"}, + {file = "yarl-1.17.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:d8a8b74d843c2638f3864a17d97a4acda58e40d3e44b6303b8cc3d3c44ae2d29"}, + {file = "yarl-1.17.1-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:7fac95714b09da9278a0b52e492466f773cfe37651cf467a83a1b659be24bf71"}, + {file = "yarl-1.17.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:c180ac742a083e109c1a18151f4dd8675f32679985a1c750d2ff806796165b55"}, + {file = "yarl-1.17.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:578d00c9b7fccfa1745a44f4eddfdc99d723d157dad26764538fbdda37209857"}, + {file = "yarl-1.17.1-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:1a3b91c44efa29e6c8ef8a9a2b583347998e2ba52c5d8280dbd5919c02dfc3b5"}, + {file = "yarl-1.17.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:a7ac5b4984c468ce4f4a553df281450df0a34aefae02e58d77a0847be8d1e11f"}, + {file = "yarl-1.17.1-cp39-cp39-win32.whl", hash = "sha256:7294e38f9aa2e9f05f765b28ffdc5d81378508ce6dadbe93f6d464a8c9594473"}, + {file = "yarl-1.17.1-cp39-cp39-win_amd64.whl", hash = "sha256:eb6dce402734575e1a8cc0bb1509afca508a400a57ce13d306ea2c663bad1138"}, + {file = "yarl-1.17.1-py3-none-any.whl", hash = "sha256:f1790a4b1e8e8e028c391175433b9c8122c39b46e1663228158e61e6f915bf06"}, + {file = "yarl-1.17.1.tar.gz", hash = "sha256:067a63fcfda82da6b198fa73079b1ca40b7c9b7994995b6ee38acda728b64d47"}, +] + +[package.dependencies] +idna = ">=2.0" +multidict = ">=4.0" +propcache = ">=0.2.0" + [[package]] name = "zipp" version = "3.21.0" @@ -3038,7 +3635,10 @@ enabler = ["pytest-enabler (>=2.2)"] test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-ignore-flaky"] type = ["pytest-mypy"] +[extras] +proxy = ["asgiproxy"] + [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "8000601d48cfc1b10d0ae18c6046cc59a50cb6c45e6d3ef4775a3203769f2154" +content-hash = "a2923e478d2f16aa84c5c36b4b9169e7a2d263e3b1060585bf33b9980a10324a" diff --git a/pyproject.toml b/pyproject.toml index 619c4ff47..3e76ec5b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,29 +1,21 @@ [tool.poetry] name = "reflex" -version = "0.6.7dev1" +version = "0.6.8dev1" description = "Web apps in pure Python." license = "Apache-2.0" authors = [ - "Nikhil Rao ", - "Alek Petuskey ", - "Masen Furer ", - "Elijah Ahianyo ", - "Thomas Brandého ", + "Nikhil Rao ", + "Alek Petuskey ", + "Masen Furer ", + "Elijah Ahianyo ", + "Thomas Brandého ", ] readme = "README.md" homepage = "https://reflex.dev" repository = "https://github.com/reflex-dev/reflex" documentation = "https://reflex.dev/docs/getting-started/introduction" -keywords = [ - "web", - "framework", -] -classifiers = [ - "Development Status :: 4 - Beta", -] -packages = [ - {include = "reflex"} -] +keywords = ["web", "framework"] +classifiers = ["Development Status :: 4 - Beta"] [tool.poetry.dependencies] python = "^3.9" @@ -42,21 +34,22 @@ uvicorn = ">=0.20.0" starlette-admin = ">=0.11.0,<1.0" alembic = ">=1.11.1,<2.0" platformdirs = ">=3.10.0,<5.0" -distro = {version = ">=1.8.0,<2.0", platform = "linux"} +distro = { version = ">=1.8.0,<2.0", platform = "linux" } python-engineio = "!=4.6.0" wrapt = [ - {version = ">=1.14.0,<2.0", python = ">=3.11"}, - {version = ">=1.11.0,<2.0", python = "<3.11"}, + { version = ">=1.14.0,<2.0", python = ">=3.11" }, + { version = ">=1.11.0,<2.0", python = "<3.11" }, ] packaging = ">=23.1,<25.0" -reflex-hosting-cli = ">=0.1.17,<2.0" +reflex-hosting-cli = ">=0.1.29,<2.0" charset-normalizer = ">=3.3.2,<4.0" wheel = ">=0.42.0,<1.0" build = ">=1.0.3,<2.0" setuptools = ">=75.0" httpx = ">=0.25.1,<1.0" -twine = ">=4.0.0,<6.0" +twine = ">=4.0.0,<7.0" tomlkit = ">=0.12.4,<1.0" +asgiproxy = { version = "==0.1.1", optional = true } lazy_loader = ">=0.4" reflex-chakra = ">=0.6.0" typing_extensions = ">=4.6.0" @@ -70,7 +63,7 @@ dill = ">=0.3.8" toml = ">=0.10.2,<1.0" pytest-asyncio = ">=0.24.0" pytest-cov = ">=4.0.0,<7.0" -ruff = "0.7.4" +ruff = "0.8.2" pandas = ">=2.1.1,<3.0" pillow = ">=10.0.0,<12.0" plotly = ">=5.13.0,<6.0" @@ -80,10 +73,14 @@ selenium = ">=4.11.0,<5.0" pytest-benchmark = ">=4.0.0,<6.0" playwright = ">=1.46.0" pytest-playwright = ">=0.5.1" +asgiproxy = "==0.1.1" [tool.poetry.scripts] reflex = "reflex.reflex:cli" +[tool.poetry.extras] +proxy = ["asgiproxy"] + [build-system] requires = ["poetry-core>=1.5.1"] build-backend = "poetry.core.masonry.api" @@ -92,14 +89,15 @@ build-backend = "poetry.core.masonry.api" [tool.ruff] target-version = "py39" +output-format = "concise" lint.isort.split-on-trailing-comma = false -lint.select = ["B", "D", "E", "F", "I", "SIM", "W"] -lint.ignore = ["B008", "D205", "E501", "F403", "SIM115"] +lint.select = ["B", "C4", "D", "E", "ERA", "F", "FURB", "I", "PERF", "PTH", "RUF", "SIM", "T", "W"] +lint.ignore = ["B008", "D205", "E501", "F403", "SIM115", "RUF006", "RUF012"] lint.pydocstyle.convention = "google" [tool.ruff.lint.per-file-ignores] "__init__.py" = ["F401"] -"tests/*.py" = ["D100", "D103", "D104", "B018"] +"tests/*.py" = ["D100", "D103", "D104", "B018", "PERF", "T"] "reflex/.templates/*.py" = ["D100", "D103", "D104"] "*.pyi" = ["D301", "D415", "D417", "D418", "E742"] "*/blank.py" = ["I001"] @@ -107,3 +105,7 @@ lint.pydocstyle.convention = "google" [tool.pytest.ini_options] asyncio_default_fixture_loop_scope = "function" asyncio_mode = "auto" + +[tool.codespell] +skip = "docs/*,*.html,examples/*, *.pyi" +ignore-words-list = "te, TreeE" \ No newline at end of file diff --git a/reflex/.templates/jinja/web/pages/_app.js.jinja2 b/reflex/.templates/jinja/web/pages/_app.js.jinja2 index 21cfd921a..40e31dee6 100644 --- a/reflex/.templates/jinja/web/pages/_app.js.jinja2 +++ b/reflex/.templates/jinja/web/pages/_app.js.jinja2 @@ -1,4 +1,5 @@ {% extends "web/pages/base_page.js.jinja2" %} +{% from "web/pages/macros.js.jinja2" import renderHooks %} {% block early_imports %} import '$/styles/styles.css' @@ -18,10 +19,7 @@ import * as {{library_alias}} from "{{library_path}}"; {% block export %} function AppWrap({children}) { - - {% for hook in hooks %} - {{ hook }} - {% endfor %} + {{ renderHooks(hooks) }} return ( {{utils.render(render, indent_width=0)}} diff --git a/reflex/.templates/jinja/web/pages/custom_component.js.jinja2 b/reflex/.templates/jinja/web/pages/custom_component.js.jinja2 index 222524d2d..e729d7273 100644 --- a/reflex/.templates/jinja/web/pages/custom_component.js.jinja2 +++ b/reflex/.templates/jinja/web/pages/custom_component.js.jinja2 @@ -1,5 +1,5 @@ {% extends "web/pages/base_page.js.jinja2" %} - +{% from "web/pages/macros.js.jinja2" import renderHooks %} {% block export %} {% for component in components %} @@ -8,9 +8,8 @@ {% endfor %} export const {{component.name}} = memo(({ {{-component.props|join(", ")-}} }) => { - {% for hook in component.hooks %} - {{ hook }} - {% endfor %} + {{ renderHooks(component.hooks) }} + return( {{utils.render(component.render)}} ) diff --git a/reflex/.templates/jinja/web/pages/index.js.jinja2 b/reflex/.templates/jinja/web/pages/index.js.jinja2 index efb086ef5..5551ad5fc 100644 --- a/reflex/.templates/jinja/web/pages/index.js.jinja2 +++ b/reflex/.templates/jinja/web/pages/index.js.jinja2 @@ -1,4 +1,5 @@ {% extends "web/pages/base_page.js.jinja2" %} +{% from "web/pages/macros.js.jinja2" import renderHooks %} {% block declaration %} {% for custom_code in custom_codes %} @@ -8,9 +9,7 @@ {% block export %} export default function Component() { - {% for hook in hooks %} - {{ hook }} - {% endfor %} + {{ renderHooks(hooks)}} return ( {{utils.render(render, indent_width=0)}} diff --git a/reflex/.templates/jinja/web/pages/macros.js.jinja2 b/reflex/.templates/jinja/web/pages/macros.js.jinja2 new file mode 100644 index 000000000..68810d896 --- /dev/null +++ b/reflex/.templates/jinja/web/pages/macros.js.jinja2 @@ -0,0 +1,38 @@ +{% macro renderHooks(hooks) %} + {% set sorted_hooks = sort_hooks(hooks) %} + + {# Render the grouped hooks #} + {% for hook, _ in sorted_hooks[const.hook_position.INTERNAL] %} + {{ hook }} + {% endfor %} + + {% for hook, _ in sorted_hooks[const.hook_position.PRE_TRIGGER] %} + {{ hook }} + {% endfor %} + + {% for hook, _ in sorted_hooks[const.hook_position.POST_TRIGGER] %} + {{ hook }} + {% endfor %} +{% endmacro %} + +{% macro renderHooksWithMemo(hooks, memo)%} + {% set sorted_hooks = sort_hooks(hooks) %} + + {# Render the grouped hooks #} + {% for hook, _ in sorted_hooks[const.hook_position.INTERNAL] %} + {{ hook }} + {% endfor %} + + {% for hook, _ in sorted_hooks[const.hook_position.PRE_TRIGGER] %} + {{ hook }} + {% endfor %} + + {% for hook in memo %} + {{ hook }} + {% endfor %} + + {% for hook, _ in sorted_hooks[const.hook_position.POST_TRIGGER] %} + {{ hook }} + {% endfor %} + +{% endmacro %} \ No newline at end of file diff --git a/reflex/.templates/jinja/web/pages/stateful_component.js.jinja2 b/reflex/.templates/jinja/web/pages/stateful_component.js.jinja2 index 4a40ef545..208a5755f 100644 --- a/reflex/.templates/jinja/web/pages/stateful_component.js.jinja2 +++ b/reflex/.templates/jinja/web/pages/stateful_component.js.jinja2 @@ -1,18 +1,10 @@ {% import 'web/pages/utils.js.jinja2' as utils %} +{% from 'web/pages/macros.js.jinja2' import renderHooksWithMemo %} +{% set all_hooks = component._get_all_hooks() %} export function {{tag_name}} () { - {% for hook in component._get_all_hooks_internal() %} - {{ hook }} - {% endfor %} - - {% for hook in memo_trigger_hooks %} - {{ hook }} - {% endfor %} - - {% for hook in component._get_all_hooks() %} - {{ hook }} - {% endfor %} - + {{ renderHooksWithMemo(all_hooks, memo_trigger_hooks) }} + return ( {{utils.render(component.render(), indent_width=0)}} ) diff --git a/reflex/.templates/jinja/web/utils/context.js.jinja2 b/reflex/.templates/jinja/web/utils/context.js.jinja2 index 2428cfa9d..32be61ebb 100644 --- a/reflex/.templates/jinja/web/utils/context.js.jinja2 +++ b/reflex/.templates/jinja/web/utils/context.js.jinja2 @@ -28,7 +28,7 @@ export const state_name = "{{state_name}}" export const exception_state_name = "{{const.frontend_exception_state}}" -// Theses events are triggered on initial load and each page navigation. +// These events are triggered on initial load and each page navigation. export const onLoadInternalEvent = () => { const internal_events = []; diff --git a/reflex/.templates/web/utils/state.js b/reflex/.templates/web/utils/state.js index 622f171ad..41dbee446 100644 --- a/reflex/.templates/web/utils/state.js +++ b/reflex/.templates/web/utils/state.js @@ -40,9 +40,6 @@ let event_processing = false; // Array holding pending events to be processed. const event_queue = []; -// Pending upload promises, by id -const upload_controllers = {}; - /** * Generate a UUID (Used for session tokens). * Taken from: https://stackoverflow.com/questions/105034/how-do-i-create-a-guid-uuid @@ -211,11 +208,16 @@ export const applyEvent = async (event, socket) => { if (event.name == "_download") { const a = document.createElement("a"); a.hidden = true; + a.href = event.payload.url; // Special case when linking to uploaded files - a.href = event.payload.url.replace( - "${getBackendURL(env.UPLOAD)}", - getBackendURL(env.UPLOAD) - ); + if (a.href.includes("getBackendURL(env.UPLOAD)")) { + a.href = eval?.( + event.payload.url.replace( + "getBackendURL(env.UPLOAD)", + `"${getBackendURL(env.UPLOAD)}"` + ) + ); + } a.download = event.payload.filename; a.click(); a.remove(); @@ -300,7 +302,7 @@ export const applyEvent = async (event, socket) => { if (socket) { socket.emit( "event", - JSON.stringify(event, (k, v) => (v === undefined ? null : v)) + event, ); return true; } @@ -407,6 +409,8 @@ export const connect = async ( transports: transports, autoUnref: false, }); + // Ensure undefined fields in events are sent as null instead of removed + socket.current.io.encoder.replacer = (k, v) => (v === undefined ? null : v) function checkVisibility() { if (document.visibilityState === "visible") { @@ -443,8 +447,7 @@ export const connect = async ( }); // On each received message, queue the updates and events. - socket.current.on("event", async (message) => { - const update = JSON5.parse(message); + socket.current.on("event", async (update) => { for (const substate in update.delta) { dispatch[substate](update.delta[substate]); } @@ -456,7 +459,7 @@ export const connect = async ( }); socket.current.on("reload", async (event) => { event_processing = false; - queueEvents([...initialEvents(), JSON5.parse(event)], socket); + queueEvents([...initialEvents(), event], socket); }); document.addEventListener("visibilitychange", checkVisibility); @@ -485,7 +488,9 @@ export const uploadFiles = async ( return false; } - if (upload_controllers[upload_id]) { + const upload_ref_name = `__upload_controllers_${upload_id}` + + if (refs[upload_ref_name]) { console.log("Upload already in progress for ", upload_id); return false; } @@ -497,23 +502,31 @@ export const uploadFiles = async ( // Whenever called, responseText will contain the entire response so far. const chunks = progressEvent.event.target.responseText.trim().split("\n"); // So only process _new_ chunks beyond resp_idx. - chunks.slice(resp_idx).map((chunk) => { - event_callbacks.map((f, ix) => { - f(chunk) - .then(() => { - if (ix === event_callbacks.length - 1) { - // Mark this chunk as processed. - resp_idx += 1; - } - }) - .catch((e) => { - if (progressEvent.progress === 1) { - // Chunk may be incomplete, so only report errors when full response is available. - console.log("Error parsing chunk", chunk, e); - } - return; - }); - }); + chunks.slice(resp_idx).map((chunk_json) => { + try { + const chunk = JSON5.parse(chunk_json); + event_callbacks.map((f, ix) => { + f(chunk) + .then(() => { + if (ix === event_callbacks.length - 1) { + // Mark this chunk as processed. + resp_idx += 1; + } + }) + .catch((e) => { + if (progressEvent.progress === 1) { + // Chunk may be incomplete, so only report errors when full response is available. + console.log("Error processing chunk", chunk, e); + } + return; + }); + }); + } catch (e) { + if (progressEvent.progress === 1) { + console.log("Error parsing chunk", chunk_json, e); + } + return; + } }); }; @@ -537,7 +550,7 @@ export const uploadFiles = async ( }); // Send the file to the server. - upload_controllers[upload_id] = controller; + refs[upload_ref_name] = controller; try { return await axios.post(getBackendURL(UPLOADURL), formdata, config); @@ -557,7 +570,7 @@ export const uploadFiles = async ( } return false; } finally { - delete upload_controllers[upload_id]; + delete refs[upload_ref_name]; } }; @@ -799,7 +812,7 @@ export const useEventLoop = ( connect( socket, dispatch, - ["websocket", "polling"], + ["websocket"], setConnectErrors, client_storage ); diff --git a/reflex/__init__.py b/reflex/__init__.py index 562524416..0be568b1a 100644 --- a/reflex/__init__.py +++ b/reflex/__init__.py @@ -331,7 +331,7 @@ _MAPPING: dict = { "SessionStorage", ], "middleware": ["middleware", "Middleware"], - "model": ["session", "Model"], + "model": ["asession", "session", "Model"], "state": [ "var", "ComponentState", diff --git a/reflex/__init__.pyi b/reflex/__init__.pyi index 6f61435e6..6bdfa11a0 100644 --- a/reflex/__init__.pyi +++ b/reflex/__init__.pyi @@ -186,6 +186,7 @@ from .istate.wrappers import get_state as get_state from .middleware import Middleware as Middleware from .middleware import middleware as middleware from .model import Model as Model +from .model import asession as asession from .model import session as session from .page import page as page from .state import ComponentState as ComponentState diff --git a/reflex/app.py b/reflex/app.py index cdf21aa35..259fcca29 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -17,6 +17,7 @@ import sys import traceback from datetime import datetime from pathlib import Path +from types import SimpleNamespace from typing import ( TYPE_CHECKING, Any, @@ -330,6 +331,12 @@ class App(MiddlewareMixin, LifespanMixin): self.register_lifespan_task(windows_hot_reload_lifespan_hack) + # Enable proxying to frontend server. + if not environment.REFLEX_BACKEND_ONLY.get(): + from reflex.proxy import proxy_middleware + + self.register_lifespan_task(proxy_middleware) + def _enable_state(self) -> None: """Enable state for the app.""" if not self.state: @@ -363,6 +370,11 @@ class App(MiddlewareMixin, LifespanMixin): max_http_buffer_size=constants.POLLING_MAX_HTTP_BUFFER_SIZE, ping_interval=constants.Ping.INTERVAL, ping_timeout=constants.Ping.TIMEOUT, + json=SimpleNamespace( + dumps=staticmethod(format.json_dumps), + loads=staticmethod(json.loads), + ), + transports=["websocket"], ) elif getattr(self.sio, "async_mode", "") != "asgi": raise RuntimeError( @@ -430,7 +442,7 @@ class App(MiddlewareMixin, LifespanMixin): allow_credentials=True, allow_methods=["*"], allow_headers=["*"], - allow_origins=["*"], + allow_origins=get_config().cors_allowed_origins, ) @property @@ -467,7 +479,7 @@ class App(MiddlewareMixin, LifespanMixin): def add_page( self, - component: Component | ComponentCallable, + component: Component | ComponentCallable | None = None, route: str | None = None, title: str | Var | None = None, description: str | Var | None = None, @@ -490,17 +502,33 @@ class App(MiddlewareMixin, LifespanMixin): meta: The metadata of the page. Raises: - ValueError: When the specified route name already exists. + PageValueError: When the component is not set for a non-404 page. + RouteValueError: When the specified route name already exists. """ # If the route is not set, get it from the callable. if route is None: if not isinstance(component, Callable): - raise ValueError("Route must be set if component is not a callable.") + raise exceptions.RouteValueError( + "Route must be set if component is not a callable." + ) # Format the route. route = format.format_route(component.__name__) else: route = format.format_route(route, format_case=False) + if route == constants.Page404.SLUG: + if component is None: + component = Default404Page.create() + component = wait_for_client_redirect(self._generate_component(component)) + title = title or constants.Page404.TITLE + description = description or constants.Page404.DESCRIPTION + image = image or constants.Page404.IMAGE + else: + if component is None: + raise exceptions.PageValueError( + "Component must be set for a non-404 page." + ) + # Check if the route given is valid verify_route_validity(route) @@ -516,7 +544,7 @@ class App(MiddlewareMixin, LifespanMixin): if route == constants.PageNames.INDEX_ROUTE else f"`{route}`" ) - raise ValueError( + raise exceptions.RouteValueError( f"Duplicate page route {route_name} already exists. Make sure you do not have two" f" pages with the same route" ) @@ -633,10 +661,14 @@ class App(MiddlewareMixin, LifespanMixin): on_load: The event handler(s) that will be called each time the page load. meta: The metadata of the page. """ - if component is None: - component = Default404Page.create() + console.deprecate( + feature_name="App.add_custom_404_page", + reason=f"Use app.add_page(component, route='/{constants.Page404.SLUG}') instead.", + deprecation_version="0.6.7", + removal_version="0.8.0", + ) self.add_page( - component=wait_for_client_redirect(self._generate_component(component)), + component=component, route=constants.Page404.SLUG, title=title or constants.Page404.TITLE, image=image or constants.Page404.IMAGE, @@ -837,7 +869,7 @@ class App(MiddlewareMixin, LifespanMixin): # Render a default 404 page if the user didn't supply one if constants.Page404.SLUG not in self.unevaluated_pages: - self.add_custom_404_page() + self.add_page(route=constants.Page404.SLUG) # Fix up the style. self.style = evaluate_style_namespaces(self.style) @@ -947,12 +979,12 @@ class App(MiddlewareMixin, LifespanMixin): is not None ): executor = concurrent.futures.ProcessPoolExecutor( - max_workers=number_of_processes, + max_workers=number_of_processes or None, mp_context=multiprocessing.get_context("fork"), ) else: executor = concurrent.futures.ThreadPoolExecutor( - max_workers=environment.REFLEX_COMPILE_THREADS.get() + max_workers=environment.REFLEX_COMPILE_THREADS.get() or None ) for route, component in zip(self.pages, page_components): @@ -965,7 +997,6 @@ class App(MiddlewareMixin, LifespanMixin): def _submit_work(fn, *args, **kwargs): f = executor.submit(fn, *args, **kwargs) - # f = executor.apipe(fn, *args, **kwargs) result_futures.append(f) # Compile the pre-compiled pages. @@ -1157,7 +1188,7 @@ class App(MiddlewareMixin, LifespanMixin): if hasattr(handler_fn, "__name__"): _fn_name = handler_fn.__name__ else: - _fn_name = handler_fn.__class__.__name__ + _fn_name = type(handler_fn).__name__ if isinstance(handler_fn, functools.partial): raise ValueError( @@ -1270,7 +1301,7 @@ async def process( await asyncio.create_task( app.event_namespace.emit( "reload", - data=format.json_dumps(event), + data=event, to=sid, ) ) @@ -1331,20 +1362,22 @@ async def health() -> JSONResponse: health_status = {"status": True} status_code = 200 - db_status, redis_status = await asyncio.gather( - get_db_status(), prerequisites.get_redis_status() - ) + tasks = [] - health_status["db"] = db_status + if prerequisites.check_db_used(): + tasks.append(get_db_status()) + if prerequisites.check_redis_used(): + tasks.append(prerequisites.get_redis_status()) - if redis_status is None: + results = await asyncio.gather(*tasks) + + for result in results: + health_status |= result + + if "redis" in health_status and health_status["redis"] is None: health_status["redis"] = False - else: - health_status["redis"] = redis_status - if not health_status["db"] or ( - not health_status["redis"] and redis_status is not None - ): + if not all(health_status.values()): health_status["status"] = False status_code = 503 @@ -1523,7 +1556,7 @@ class EventNamespace(AsyncNamespace): """ # Creating a task prevents the update from being blocked behind other coroutines. await asyncio.create_task( - self.emit(str(constants.SocketEvent.EVENT), update.json(), to=sid) + self.emit(str(constants.SocketEvent.EVENT), update, to=sid) ) async def on_event(self, sid, data): @@ -1536,7 +1569,7 @@ class EventNamespace(AsyncNamespace): sid: The Socket.IO session id. data: The event data. """ - fields = json.loads(data) + fields = data # Get the event. event = Event( **{k: v for k, v in fields.items() if k not in ("handler", "event_actions")} diff --git a/reflex/assets.py b/reflex/assets.py index 8a50664b6..a9aa7a6a9 100644 --- a/reflex/assets.py +++ b/reflex/assets.py @@ -5,7 +5,7 @@ from pathlib import Path from typing import Optional from reflex import constants -from reflex.utils.exec import is_backend_only +from reflex.config import EnvironmentVariables def asset( @@ -52,7 +52,7 @@ def asset( The relative URL to the asset. """ assets = constants.Dirs.APP_ASSETS - backend_only = is_backend_only() + backend_only = EnvironmentVariables.REFLEX_BACKEND_ONLY.get() # Local asset handling if not shared: diff --git a/reflex/base.py b/reflex/base.py index 692f123a8..a88e557ef 100644 --- a/reflex/base.py +++ b/reflex/base.py @@ -30,15 +30,16 @@ def validate_field_name(bases: List[Type["BaseModel"]], field_name: str) -> None # can't use reflex.config.environment here cause of circular import reload = os.getenv("__RELOAD_CONFIG", "").lower() == "true" - for base in bases: - try: + base = None + try: + for base in bases: if not reload and getattr(base, field_name, None): pass - except TypeError as te: - raise VarNameError( - f'State var "{field_name}" in {base} has been shadowed by a substate var; ' - f'use a different field name instead".' - ) from te + except TypeError as te: + raise VarNameError( + f'State var "{field_name}" in {base} has been shadowed by a substate var; ' + f'use a different field name instead".' + ) from te # monkeypatch pydantic validate_field_name method to skip validating diff --git a/reflex/compiler/compiler.py b/reflex/compiler/compiler.py index 9f81f319d..218dd0c55 100644 --- a/reflex/compiler/compiler.py +++ b/reflex/compiler/compiler.py @@ -75,7 +75,7 @@ def _compile_app(app_root: Component) -> str: return templates.APP_ROOT.render( imports=utils.compile_imports(app_root._get_all_imports()), custom_codes=app_root._get_all_custom_code(), - hooks={**app_root._get_all_hooks_internal(), **app_root._get_all_hooks()}, + hooks=app_root._get_all_hooks(), window_libraries=window_libraries, render=app_root.render(), ) @@ -149,7 +149,7 @@ def _compile_page( imports=imports, dynamic_imports=component._get_all_dynamic_imports(), custom_codes=component._get_all_custom_code(), - hooks={**component._get_all_hooks_internal(), **component._get_all_hooks()}, + hooks=component._get_all_hooks(), render=component.render(), **kwargs, ) diff --git a/reflex/compiler/templates.py b/reflex/compiler/templates.py index c868a0cbb..117b655a9 100644 --- a/reflex/compiler/templates.py +++ b/reflex/compiler/templates.py @@ -1,9 +1,46 @@ """Templates to use in the reflex compiler.""" +from __future__ import annotations + from jinja2 import Environment, FileSystemLoader, Template from reflex import constants +from reflex.constants import Hooks from reflex.utils.format import format_state_name, json_dumps +from reflex.vars.base import VarData + + +def _sort_hooks(hooks: dict[str, VarData | None]): + """Sort the hooks by their position. + + Args: + hooks: The hooks to sort. + + Returns: + The sorted hooks. + """ + sorted_hooks = { + Hooks.HookPosition.INTERNAL: [], + Hooks.HookPosition.PRE_TRIGGER: [], + Hooks.HookPosition.POST_TRIGGER: [], + } + + for hook, data in hooks.items(): + if data and data.position and data.position == Hooks.HookPosition.INTERNAL: + sorted_hooks[Hooks.HookPosition.INTERNAL].append((hook, data)) + elif not data or ( + not data.position + or data.position == constants.Hooks.HookPosition.PRE_TRIGGER + ): + sorted_hooks[Hooks.HookPosition.PRE_TRIGGER].append((hook, data)) + elif ( + data + and data.position + and data.position == constants.Hooks.HookPosition.POST_TRIGGER + ): + sorted_hooks[Hooks.HookPosition.POST_TRIGGER].append((hook, data)) + + return sorted_hooks class ReflexJinjaEnvironment(Environment): @@ -45,7 +82,9 @@ class ReflexJinjaEnvironment(Environment): "on_load_internal": constants.CompileVars.ON_LOAD_INTERNAL, "update_vars_internal": constants.CompileVars.UPDATE_VARS_INTERNAL, "frontend_exception_state": constants.CompileVars.FRONTEND_EXCEPTION_STATE_FULL, + "hook_position": constants.Hooks.HookPosition, } + self.globals["sort_hooks"] = _sort_hooks def get_template(name: str) -> Template: @@ -102,6 +141,9 @@ STYLE = get_template("web/styles/styles.css.jinja2") # Code that generate the package json file PACKAGE_JSON = get_template("web/package.json.jinja2") +# Template containing some macros used in the web pages. +MACROS = get_template("web/pages/macros.js.jinja2") + # Code that generate the pyproject.toml file for custom components. CUSTOM_COMPONENTS_PYPROJECT_TOML = get_template( "custom_components/pyproject.toml.jinja2" diff --git a/reflex/compiler/utils.py b/reflex/compiler/utils.py index 29398da87..c0ba28f4b 100644 --- a/reflex/compiler/utils.py +++ b/reflex/compiler/utils.py @@ -115,7 +115,7 @@ def compile_imports(import_dict: ParsedImportDict) -> list[dict]: default, rest = compile_import_statement(fields) # prevent lib from being rendered on the page if all imports are non rendered kind - if not any({f.render for f in fields}): # type: ignore + if not any(f.render for f in fields): # type: ignore continue if not lib: @@ -123,8 +123,7 @@ def compile_imports(import_dict: ParsedImportDict) -> list[dict]: raise ValueError("No default field allowed for empty library.") if rest is None or len(rest) == 0: raise ValueError("No fields to import.") - for module in sorted(rest): - import_dicts.append(get_import_dict(module)) + import_dicts.extend(get_import_dict(module) for module in sorted(rest)) continue # remove the version before rendering the package imports @@ -291,7 +290,7 @@ def compile_custom_component( "name": component.tag, "props": props, "render": render.render(), - "hooks": {**render._get_all_hooks_internal(), **render._get_all_hooks()}, + "hooks": render._get_all_hooks(), "custom_code": render._get_all_custom_code(), }, imports, diff --git a/reflex/components/base/bare.py b/reflex/components/base/bare.py index c70b4c844..7cd225deb 100644 --- a/reflex/components/base/bare.py +++ b/reflex/components/base/bare.py @@ -9,6 +9,7 @@ from reflex.components.tags import Tag from reflex.components.tags.tagless import Tagless from reflex.utils.imports import ParsedImportDict from reflex.vars import BooleanVar, ObjectVar, Var +from reflex.vars.base import VarData class Bare(Component): @@ -32,7 +33,7 @@ class Bare(Component): contents = str(contents) if contents is not None else "" return cls(contents=contents) # type: ignore - def _get_all_hooks_internal(self) -> dict[str, None]: + def _get_all_hooks_internal(self) -> dict[str, VarData | None]: """Include the hooks for the component. Returns: @@ -43,7 +44,7 @@ class Bare(Component): hooks |= self.contents._var_value._get_all_hooks_internal() return hooks - def _get_all_hooks(self) -> dict[str, None]: + def _get_all_hooks(self) -> dict[str, VarData | None]: """Include the hooks for the component. Returns: @@ -103,8 +104,8 @@ class Bare(Component): def _render(self) -> Tag: if isinstance(self.contents, Var): if isinstance(self.contents, (BooleanVar, ObjectVar)): - return Tagless(contents=f"{{{str(self.contents.to_string())}}}") - return Tagless(contents=f"{{{str(self.contents)}}}") + return Tagless(contents=f"{{{self.contents.to_string()!s}}}") + return Tagless(contents=f"{{{self.contents!s}}}") return Tagless(contents=str(self.contents)) def _get_vars(self, include_children: bool = False) -> Iterator[Var]: diff --git a/reflex/components/component.py b/reflex/components/component.py index 18dedbf0e..46708e572 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -23,6 +23,8 @@ from typing import ( Union, ) +from typing_extensions import deprecated + import reflex.state from reflex.base import Base from reflex.compiler.templates import STATEFUL_COMPONENT @@ -43,17 +45,13 @@ from reflex.constants.state import FRONTEND_EVENT_STATE from reflex.event import ( EventCallback, EventChain, - EventChainVar, EventHandler, EventSpec, EventVar, - call_event_fn, - call_event_handler, - get_handler_args, no_args_event_spec, ) from reflex.style import Style, format_as_emotion -from reflex.utils import format, imports, types +from reflex.utils import console, format, imports, types from reflex.utils.imports import ( ImmutableParsedImportDict, ImportDict, @@ -104,7 +102,7 @@ class BaseComponent(Base, ABC): """ @abstractmethod - def _get_all_hooks_internal(self) -> dict[str, None]: + def _get_all_hooks_internal(self) -> dict[str, VarData | None]: """Get the reflex internal hooks for the component and its children. Returns: @@ -112,7 +110,7 @@ class BaseComponent(Base, ABC): """ @abstractmethod - def _get_all_hooks(self) -> dict[str, None]: + def _get_all_hooks(self) -> dict[str, VarData | None]: """Get the React hooks for this component. Returns: @@ -161,7 +159,7 @@ class ComponentNamespace(SimpleNamespace): Returns: The hash of the namespace. """ - return hash(self.__class__.__name__) + return hash(type(self).__name__) def evaluate_style_namespaces(style: ComponentStyle) -> dict: @@ -493,8 +491,7 @@ class Component(BaseComponent, ABC): ) # Check if the key is an event trigger. if key in component_specific_triggers: - # Temporarily disable full control for event triggers. - kwargs["event_triggers"][key] = self._create_event_chain( + kwargs["event_triggers"][key] = EventChain.create( value=value, # type: ignore args_spec=component_specific_triggers[key], key=key, @@ -548,6 +545,7 @@ class Component(BaseComponent, ABC): # Construct the component. super().__init__(*args, **kwargs) + @deprecated("Use rx.EventChain.create instead.") def _create_event_chain( self, args_spec: types.ArgsSpec | Sequence[types.ArgsSpec], @@ -569,82 +567,18 @@ class Component(BaseComponent, ABC): Returns: The event chain. - - Raises: - ValueError: If the value is not a valid event chain. """ - # If it's an event chain var, return it. - if isinstance(value, Var): - if isinstance(value, EventChainVar): - return value - elif isinstance(value, EventVar): - value = [value] - elif issubclass(value._var_type, (EventChain, EventSpec)): - return self._create_event_chain(args_spec, value.guess_type(), key=key) - else: - raise ValueError( - f"Invalid event chain: {str(value)} of type {value._var_type}" - ) - elif isinstance(value, EventChain): - # Trust that the caller knows what they're doing passing an EventChain directly - return value - - # If the input is a single event handler, wrap it in a list. - if isinstance(value, (EventHandler, EventSpec)): - value = [value] - - # If the input is a list of event handlers, create an event chain. - if isinstance(value, List): - events: List[Union[EventSpec, EventVar]] = [] - for v in value: - if isinstance(v, (EventHandler, EventSpec)): - # Call the event handler to get the event. - events.append(call_event_handler(v, args_spec, key=key)) - elif isinstance(v, Callable): - # Call the lambda to get the event chain. - result = call_event_fn(v, args_spec, key=key) - if isinstance(result, Var): - raise ValueError( - f"Invalid event chain: {v}. Cannot use a Var-returning " - "lambda inside an EventChain list." - ) - events.extend(result) - elif isinstance(v, EventVar): - events.append(v) - else: - raise ValueError(f"Invalid event: {v}") - - # If the input is a callable, create an event chain. - elif isinstance(value, Callable): - result = call_event_fn(value, args_spec, key=key) - if isinstance(result, Var): - # Recursively call this function if the lambda returned an EventChain Var. - return self._create_event_chain(args_spec, result, key=key) - events = [*result] - - # Otherwise, raise an error. - else: - raise ValueError(f"Invalid event chain: {value}") - - # Add args to the event specs if necessary. - events = [ - (e.with_args(get_handler_args(e)) if isinstance(e, EventSpec) else e) - for e in events - ] - - # Return the event chain. - if isinstance(args_spec, Var): - return EventChain( - events=events, - args_spec=None, - event_actions={}, - ) - else: - return EventChain( - events=events, - args_spec=args_spec, - event_actions={}, - ) + console.deprecate( + "Component._create_event_chain", + "Use rx.EventChain.create instead.", + deprecation_version="0.6.8", + removal_version="0.7.0", + ) + return EventChain.create( + value=value, # type: ignore + args_spec=args_spec, + key=key, + ) def get_event_triggers( self, @@ -653,7 +587,6 @@ class Component(BaseComponent, ABC): Returns: The event triggers. - """ default_triggers: Dict[str, types.ArgsSpec | Sequence[types.ArgsSpec]] = { EventTriggers.ON_FOCUS: no_args_event_spec, @@ -1111,7 +1044,7 @@ class Component(BaseComponent, ABC): vars.append(prop_var) # Style keeps track of its own VarData instance, so embed in a temp Var that is yielded. - if isinstance(self.style, dict) and self.style or isinstance(self.style, Var): + if (isinstance(self.style, dict) and self.style) or isinstance(self.style, Var): vars.append( Var( _js_expr="style", @@ -1209,7 +1142,7 @@ class Component(BaseComponent, ABC): Yields: The parent classes that define the method (differently than the base). """ - seen_methods = set([getattr(Component, method)]) + seen_methods = {getattr(Component, method)} for clz in cls.mro(): if clz is Component: break @@ -1339,7 +1272,7 @@ class Component(BaseComponent, ABC): """ _imports = {} - if self._get_ref_hook(): + if self._get_ref_hook() is not None: # Handle hooks needed for attaching react refs to DOM nodes. _imports.setdefault("react", set()).add(ImportVar(tag="useRef")) _imports.setdefault(f"$/{Dirs.STATE_PATH}", set()).add( @@ -1369,7 +1302,9 @@ class Component(BaseComponent, ABC): if user_hooks_data is not None: other_imports.append(user_hooks_data.imports) other_imports.extend( - hook_imports for hook_imports in self._get_added_hooks().values() + hook_vardata.imports + for hook_vardata in self._get_added_hooks().values() + if hook_vardata is not None ) return imports.merge_imports(_imports, *other_imports) @@ -1391,15 +1326,9 @@ class Component(BaseComponent, ABC): # Collect imports from Vars used directly by this component. var_datas = [var._get_all_var_data() for var in self._get_vars()] - var_imports: List[ImmutableParsedImportDict] = list( - map( - lambda var_data: var_data.imports, - filter( - None, - var_datas, - ), - ) - ) + var_imports: List[ImmutableParsedImportDict] = [ + var_data.imports for var_data in var_datas if var_data is not None + ] added_import_dicts: list[ParsedImportDict] = [] for clz in self._iter_parent_classes_with_method("add_imports"): @@ -1408,8 +1337,9 @@ class Component(BaseComponent, ABC): if not isinstance(list_of_import_dict, list): list_of_import_dict = [list_of_import_dict] - for import_dict in list_of_import_dict: - added_import_dicts.append(parse_imports(import_dict)) + added_import_dicts.extend( + [parse_imports(import_dict) for import_dict in list_of_import_dict] + ) return imports.merge_imports( *self._get_props_imports(), @@ -1458,7 +1388,7 @@ class Component(BaseComponent, ABC): }} }}, []);""" - def _get_ref_hook(self) -> str | None: + def _get_ref_hook(self) -> Var | None: """Generate the ref hook for the component. Returns: @@ -1466,9 +1396,12 @@ class Component(BaseComponent, ABC): """ ref = self.get_ref() if ref is not None: - return f"const {ref} = useRef(null); {str(Var(_js_expr=ref)._as_ref())} = {ref};" + return Var( + f"const {ref} = useRef(null); {Var(_js_expr=ref)._as_ref()!s} = {ref};", + _var_data=VarData(position=Hooks.HookPosition.INTERNAL), + ) - def _get_vars_hooks(self) -> dict[str, None]: + def _get_vars_hooks(self) -> dict[str, VarData | None]: """Get the hooks required by vars referenced in this component. Returns: @@ -1481,27 +1414,38 @@ class Component(BaseComponent, ABC): vars_hooks.update( var_data.hooks if isinstance(var_data.hooks, dict) - else {k: None for k in var_data.hooks} + else { + k: VarData(position=Hooks.HookPosition.INTERNAL) + for k in var_data.hooks + } ) return vars_hooks - def _get_events_hooks(self) -> dict[str, None]: + def _get_events_hooks(self) -> dict[str, VarData | None]: """Get the hooks required by events referenced in this component. Returns: The hooks for the events. """ - return {Hooks.EVENTS: None} if self.event_triggers else {} + return ( + {Hooks.EVENTS: VarData(position=Hooks.HookPosition.INTERNAL)} + if self.event_triggers + else {} + ) - def _get_special_hooks(self) -> dict[str, None]: + def _get_special_hooks(self) -> dict[str, VarData | None]: """Get the hooks required by special actions referenced in this component. Returns: The hooks for special actions. """ - return {Hooks.AUTOFOCUS: None} if self.autofocus else {} + return ( + {Hooks.AUTOFOCUS: VarData(position=Hooks.HookPosition.INTERNAL)} + if self.autofocus + else {} + ) - def _get_hooks_internal(self) -> dict[str, None]: + def _get_hooks_internal(self) -> dict[str, VarData | None]: """Get the React hooks for this component managed by the framework. Downstream components should NOT override this method to avoid breaking @@ -1512,7 +1456,7 @@ class Component(BaseComponent, ABC): """ return { **{ - hook: None + str(hook): VarData(position=Hooks.HookPosition.INTERNAL) for hook in [self._get_ref_hook(), self._get_mount_lifecycle_hook()] if hook is not None }, @@ -1521,7 +1465,7 @@ class Component(BaseComponent, ABC): **self._get_special_hooks(), } - def _get_added_hooks(self) -> dict[str, ImportDict]: + def _get_added_hooks(self) -> dict[str, VarData | None]: """Get the hooks added via `add_hooks` method. Returns: @@ -1530,17 +1474,15 @@ class Component(BaseComponent, ABC): code = {} def extract_var_hooks(hook: Var): - _imports = {} var_data = VarData.merge(hook._get_all_var_data()) if var_data is not None: for sub_hook in var_data.hooks: - code[sub_hook] = {} - if var_data.imports: - _imports = var_data.imports + code[sub_hook] = None + if str(hook) in code: - code[str(hook)] = imports.merge_imports(code[str(hook)], _imports) + code[str(hook)] = VarData.merge(var_data, code[str(hook)]) else: - code[str(hook)] = _imports + code[str(hook)] = var_data # Add the hook code from add_hooks for each parent class (this is reversed to preserve # the order of the hooks in the final output) @@ -1549,7 +1491,7 @@ class Component(BaseComponent, ABC): if isinstance(hook, Var): extract_var_hooks(hook) else: - code[hook] = {} + code[hook] = None return code @@ -1563,7 +1505,7 @@ class Component(BaseComponent, ABC): """ return - def _get_all_hooks_internal(self) -> dict[str, None]: + def _get_all_hooks_internal(self) -> dict[str, VarData | None]: """Get the reflex internal hooks for the component and its children. Returns: @@ -1578,7 +1520,7 @@ class Component(BaseComponent, ABC): return code - def _get_all_hooks(self) -> dict[str, None]: + def _get_all_hooks(self) -> dict[str, VarData | None]: """Get the React hooks for this component and its children. Returns: @@ -1586,13 +1528,15 @@ class Component(BaseComponent, ABC): """ code = {} + # Add the internal hooks for this component. + code.update(self._get_hooks_internal()) + # Add the hook code for this component. hooks = self._get_hooks() if hooks is not None: code[hooks] = None - for hook in self._get_added_hooks(): - code[hook] = None + code.update(self._get_added_hooks()) # Add the hook code for the children. for child in self.children: @@ -1742,7 +1686,7 @@ class CustomComponent(Component): # Handle event chains. if types._issubclass(type_, EventChain): - value = self._create_event_chain( + value = EventChain.create( value=value, args_spec=event_triggers_in_component_declaration.get( key, no_args_event_spec @@ -2194,6 +2138,31 @@ class StatefulComponent(BaseComponent): ] return [var_name] + @staticmethod + def _get_deps_from_event_trigger(event: EventChain | EventSpec | Var) -> set[str]: + """Get the dependencies accessed by event triggers. + + Args: + event: The event trigger to extract deps from. + + Returns: + The dependencies accessed by the event triggers. + """ + events: list = [event] + deps = set() + + if isinstance(event, EventChain): + events.extend(event.events) + + for ev in events: + if isinstance(ev, EventSpec): + for arg in ev.args: + for a in arg: + var_datas = VarData.merge(a._get_all_var_data()) + if var_datas and var_datas.deps is not None: + deps |= {str(dep) for dep in var_datas.deps} + return deps + @classmethod def _get_memoized_event_triggers( cls, @@ -2230,6 +2199,11 @@ class StatefulComponent(BaseComponent): # Calculate Var dependencies accessed by the handler for useCallback dep array. var_deps = ["addEvents", "Event"] + + # Get deps from event trigger var data. + var_deps.extend(cls._get_deps_from_event_trigger(event)) + + # Get deps from hooks. for arg in event_args: var_data = arg._get_all_var_data() if var_data is None: @@ -2252,7 +2226,7 @@ class StatefulComponent(BaseComponent): ) return trigger_memo - def _get_all_hooks_internal(self) -> dict[str, None]: + def _get_all_hooks_internal(self) -> dict[str, VarData | None]: """Get the reflex internal hooks for the component and its children. Returns: @@ -2260,7 +2234,7 @@ class StatefulComponent(BaseComponent): """ return {} - def _get_all_hooks(self) -> dict[str, None]: + def _get_all_hooks(self) -> dict[str, VarData | None]: """Get the React hooks for this component. Returns: @@ -2378,7 +2352,7 @@ class MemoizationLeaf(Component): The memoization leaf """ comp = super().create(*children, **props) - if comp._get_all_hooks() or comp._get_all_hooks_internal(): + if comp._get_all_hooks(): comp._memoization_mode = cls._memoization_mode.copy( update={"disposition": MemoizationDisposition.ALWAYS} ) @@ -2563,7 +2537,7 @@ class LiteralComponentVar(CachedVarOperation, LiteralVar, ComponentVar): Returns: The hash of the var. """ - return hash((self.__class__.__name__, self._js_expr)) + return hash((type(self).__name__, self._js_expr)) @classmethod def create( diff --git a/reflex/components/core/banner.py b/reflex/components/core/banner.py index f6abbab90..b7b6fae6c 100644 --- a/reflex/components/core/banner.py +++ b/reflex/components/core/banner.py @@ -109,7 +109,7 @@ class ConnectionToaster(Toaster): ) individual_hooks = [ - f"const toast_props = {str(LiteralVar.create(props))};", + f"const toast_props = {LiteralVar.create(props)!s};", "const [userDismissed, setUserDismissed] = useState(false);", FunctionStringVar( "useEffect", @@ -124,7 +124,7 @@ class ConnectionToaster(Toaster): Var( _js_expr=f""" () => {{ - if ({str(has_too_many_connection_errors)}) {{ + if ({has_too_many_connection_errors!s}) {{ if (!userDismissed) {{ toast.error( `Cannot connect to server: ${{{connection_error}}}.`, @@ -241,7 +241,7 @@ class WifiOffPulse(Icon): size=props.pop("size", 32), z_index=props.pop("z_index", 9999), position=props.pop("position", "fixed"), - bottom=props.pop("botton", "33px"), + bottom=props.pop("bottom", "33px"), right=props.pop("right", "33px"), animation=LiteralVar.create(f"{pulse_var} 1s infinite"), **props, diff --git a/reflex/components/core/banner.pyi b/reflex/components/core/banner.pyi index 3296b84ee..f44ee7992 100644 --- a/reflex/components/core/banner.pyi +++ b/reflex/components/core/banner.pyi @@ -321,7 +321,7 @@ class ConnectionPulser(Div): """Create a connection pulser component. Args: - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/core/breakpoints.py b/reflex/components/core/breakpoints.py index 4b2372a70..25396ecd9 100644 --- a/reflex/components/core/breakpoints.py +++ b/reflex/components/core/breakpoints.py @@ -58,7 +58,7 @@ class Breakpoints(Dict[K, V]): Args: custom: Custom mapping using CSS values or variables. - initial: Styling when in the inital width + initial: Styling when in the initial width xs: Styling when in the extra-small width sm: Styling when in the small width md: Styling when in the medium width diff --git a/reflex/components/core/client_side_routing.py b/reflex/components/core/client_side_routing.py index 342c69632..a10b90de8 100644 --- a/reflex/components/core/client_side_routing.py +++ b/reflex/components/core/client_side_routing.py @@ -24,7 +24,7 @@ class ClientSideRouting(Component): library = "$/utils/client_side_routing" tag = "useClientSideRouting" - def add_hooks(self) -> list[str]: + def add_hooks(self) -> list[str | Var]: """Get the hooks to render. Returns: @@ -66,4 +66,4 @@ class Default404Page(Component): tag = "Error" is_default = True - status_code: Var[int] = 404 # type: ignore + status_code: Var[int] = Var.create(404) diff --git a/reflex/components/core/client_side_routing.pyi b/reflex/components/core/client_side_routing.pyi index bb853e2c7..581b0e120 100644 --- a/reflex/components/core/client_side_routing.pyi +++ b/reflex/components/core/client_side_routing.pyi @@ -13,7 +13,7 @@ from reflex.vars.base import Var route_not_found: Var class ClientSideRouting(Component): - def add_hooks(self) -> list[str]: ... + def add_hooks(self) -> list[str | Var]: ... def render(self) -> str: ... @overload @classmethod diff --git a/reflex/components/core/clipboard.py b/reflex/components/core/clipboard.py index 6d6a38acc..644de80d0 100644 --- a/reflex/components/core/clipboard.py +++ b/reflex/components/core/clipboard.py @@ -6,11 +6,12 @@ from typing import Dict, List, Tuple, Union from reflex.components.base.fragment import Fragment from reflex.components.tags.tag import Tag +from reflex.constants.compiler import Hooks from reflex.event import EventChain, EventHandler, passthrough_event_spec from reflex.utils.format import format_prop, wrap from reflex.utils.imports import ImportVar from reflex.vars import get_unique_variable_name -from reflex.vars.base import Var +from reflex.vars.base import Var, VarData class Clipboard(Fragment): @@ -51,7 +52,7 @@ class Clipboard(Fragment): return super().create(*children, **props) def _exclude_props(self) -> list[str]: - return super()._exclude_props() + ["on_paste", "on_paste_event_actions"] + return [*super()._exclude_props(), "on_paste", "on_paste_event_actions"] def _render(self) -> Tag: tag = super()._render() @@ -72,7 +73,7 @@ class Clipboard(Fragment): ), } - def add_hooks(self) -> list[str]: + def add_hooks(self) -> list[str | Var[str]]: """Add hook to register paste event listener. Returns: @@ -83,13 +84,14 @@ class Clipboard(Fragment): return [] if isinstance(on_paste, EventChain): on_paste = wrap(str(format_prop(on_paste)).strip("{}"), "(") + hook_expr = f"usePasteHandler({self.targets!s}, {self.on_paste_event_actions!s}, {on_paste!s})" + return [ - "usePasteHandler(%s, %s, %s)" - % ( - str(self.targets), - str(self.on_paste_event_actions), - on_paste, - ) + Var( + hook_expr, + _var_type="str", + _var_data=VarData(position=Hooks.HookPosition.POST_TRIGGER), + ), ] diff --git a/reflex/components/core/clipboard.pyi b/reflex/components/core/clipboard.pyi index 69e0e866d..328554f2a 100644 --- a/reflex/components/core/clipboard.pyi +++ b/reflex/components/core/clipboard.pyi @@ -71,6 +71,6 @@ class Clipboard(Fragment): ... def add_imports(self) -> dict[str, ImportVar]: ... - def add_hooks(self) -> list[str]: ... + def add_hooks(self) -> list[str | Var[str]]: ... clipboard = Clipboard.create diff --git a/reflex/components/core/cond.py b/reflex/components/core/cond.py index 5b6ee2a7f..488990f54 100644 --- a/reflex/components/core/cond.py +++ b/reflex/components/core/cond.py @@ -49,9 +49,9 @@ class Cond(MemoizationLeaf): The conditional component. """ # Wrap everything in fragments. - if comp1.__class__.__name__ != "Fragment": + if type(comp1).__name__ != "Fragment": comp1 = Fragment.create(comp1) - if comp2 is None or comp2.__class__.__name__ != "Fragment": + if comp2 is None or type(comp2).__name__ != "Fragment": comp2 = Fragment.create(comp2) if comp2 else Fragment.create() return Fragment.create( cls( @@ -94,7 +94,7 @@ class Cond(MemoizationLeaf): ).set( props=tag.format_props(), ), - cond_state=f"isTrue({str(self.cond)})", + cond_state=f"isTrue({self.cond!s})", ) def add_imports(self) -> ImportDict: diff --git a/reflex/components/core/foreach.py b/reflex/components/core/foreach.py index a3f97d594..c9fbe5bc5 100644 --- a/reflex/components/core/foreach.py +++ b/reflex/components/core/foreach.py @@ -54,7 +54,7 @@ class Foreach(Component): iterable = LiteralVar.create(iterable) if iterable._var_type == Any: raise ForeachVarError( - f"Could not foreach over var `{str(iterable)}` of type Any. " + f"Could not foreach over var `{iterable!s}` of type Any. " "(If you are trying to foreach over a state var, add a type annotation to the var). " "See https://reflex.dev/docs/library/dynamic-rendering/foreach/" ) diff --git a/reflex/components/core/html.pyi b/reflex/components/core/html.pyi index ffa7f88bb..e65549d0f 100644 --- a/reflex/components/core/html.pyi +++ b/reflex/components/core/html.pyi @@ -71,7 +71,7 @@ class Html(Div): Args: *children: The children of the component. dangerouslySetInnerHTML: The HTML to render. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/core/upload.py b/reflex/components/core/upload.py index 87488d98a..14205cc6b 100644 --- a/reflex/components/core/upload.py +++ b/reflex/components/core/upload.py @@ -29,7 +29,7 @@ from reflex.event import ( from reflex.utils import format from reflex.utils.imports import ImportVar from reflex.vars import VarData -from reflex.vars.base import CallableVar, LiteralVar, Var, get_unique_variable_name +from reflex.vars.base import CallableVar, Var, get_unique_variable_name from reflex.vars.sequence import LiteralStringVar DEFAULT_UPLOAD_ID: str = "default" @@ -61,7 +61,7 @@ def upload_file(id_: str = DEFAULT_UPLOAD_ID) -> Var: id_var = LiteralStringVar.create(id_) var_name = f"""e => setFilesById(filesById => {{ const updatedFilesById = Object.assign({{}}, filesById); - updatedFilesById[{str(id_var)}] = e; + updatedFilesById[{id_var!s}] = e; return updatedFilesById; }}) """ @@ -87,7 +87,7 @@ def selected_files(id_: str = DEFAULT_UPLOAD_ID) -> Var: """ id_var = LiteralStringVar.create(id_) return Var( - _js_expr=f"(filesById[{str(id_var)}] ? filesById[{str(id_var)}].map((f) => (f.path || f.name)) : [])", + _js_expr=f"(filesById[{id_var!s}] ? filesById[{id_var!s}].map((f) => (f.path || f.name)) : [])", _var_type=List[str], _var_data=VarData.merge( upload_files_context_var_data, id_var._get_all_var_data() @@ -108,7 +108,8 @@ def clear_selected_files(id_: str = DEFAULT_UPLOAD_ID) -> EventSpec: # UploadFilesProvider assigns a special function to clear selected files # into the shared global refs object to make it accessible outside a React # component via `run_script` (otherwise backend could never clear files). - return run_script(f"refs['__clear_selected_files']({id_!r})") + func = Var("__clear_selected_files")._as_ref() + return run_script(f"{func}({id_!r})") def cancel_upload(upload_id: str) -> EventSpec: @@ -120,9 +121,8 @@ def cancel_upload(upload_id: str) -> EventSpec: Returns: An event spec that cancels the upload when triggered. """ - return run_script( - f"upload_controllers[{str(LiteralVar.create(upload_id))}]?.abort()" - ) + controller = Var(f"__upload_controllers_{upload_id}")._as_ref() + return run_script(f"{controller}?.abort()") def get_upload_dir() -> Path: @@ -301,7 +301,7 @@ class Upload(MemoizationLeaf): ) left_side = f"const {{getRootProps: {root_props_unique_name}, getInputProps: {input_props_unique_name}}} " - right_side = f"useDropzone({str(use_dropzone_arguments)})" + right_side = f"useDropzone({use_dropzone_arguments!s})" var_data = VarData.merge( VarData( diff --git a/reflex/components/datadisplay/code.py b/reflex/components/datadisplay/code.py index b514bc888..2d5dfc625 100644 --- a/reflex/components/datadisplay/code.py +++ b/reflex/components/datadisplay/code.py @@ -445,7 +445,7 @@ class CodeBlock(Component, MarkdownComponentMap): dark=Theme.one_dark, ) - # react-syntax-highlighter doesnt have an explicit "light" or "dark" theme so we use one-light and one-dark + # react-syntax-highlighter doesn't have an explicit "light" or "dark" theme so we use one-light and one-dark # themes respectively to ensure code compatibility. if "theme" in props and not isinstance(props["theme"], Var): props["theme"] = getattr(Theme, format.to_snake_case(props["theme"])) # type: ignore @@ -519,13 +519,13 @@ class CodeBlock(Component, MarkdownComponentMap): The hook to register the language. """ return f""" - if ({str(_LANGUAGE)}) {{ + if ({_LANGUAGE!s}) {{ (async () => {{ try {{ - const module = await import(`react-syntax-highlighter/dist/cjs/languages/prism/${{{str(_LANGUAGE)}}}`); - SyntaxHighlighter.registerLanguage({str(_LANGUAGE)}, module.default); + const module = await import(`react-syntax-highlighter/dist/cjs/languages/prism/${{{_LANGUAGE!s}}}`); + SyntaxHighlighter.registerLanguage({_LANGUAGE!s}, module.default); }} catch (error) {{ - console.error(`Error importing language module for ${{{str(_LANGUAGE)}}}:`, error); + console.error(`Error importing language module for ${{{_LANGUAGE!s}}}:`, error); }} }})(); }} @@ -547,7 +547,7 @@ class CodeBlock(Component, MarkdownComponentMap): The hooks for the component. """ return [ - f"const {str(_LANGUAGE)} = {str(self.language)}", + f"const {_LANGUAGE!s} = {self.language!s}", self._get_language_registration_hook(), ] diff --git a/reflex/components/datadisplay/dataeditor.py b/reflex/components/datadisplay/dataeditor.py index e3f0b7117..f71f97713 100644 --- a/reflex/components/datadisplay/dataeditor.py +++ b/reflex/components/datadisplay/dataeditor.py @@ -51,27 +51,6 @@ class GridColumnIcons(Enum): VideoUri = "video_uri" -# @serializer -# def serialize_gridcolumn_icon(icon: GridColumnIcons) -> str: -# """Serialize grid column icon. - -# Args: -# icon: the Icon to serialize. - -# Returns: -# The serialized value. -# """ -# return "prefix" + str(icon) - - -# class DataEditorColumn(Base): -# """Column.""" - -# title: str -# id: Optional[str] = None -# type_: str = "str" - - class DataEditorTheme(Base): """The theme for the DataEditor component.""" @@ -229,7 +208,7 @@ class DataEditor(NoSSRComponent): header_height: Var[int] # Additional header icons: - # header_icons: Var[Any] # (TODO: must be a map of name: svg) + # header_icons: Var[Any] # (TODO: must be a map of name: svg) #noqa: ERA001 # The maximum width a column can be automatically sized to. max_column_auto_width: Var[int] @@ -240,7 +219,7 @@ class DataEditor(NoSSRComponent): # The minimum width a column can be resized to. min_column_width: Var[int] - # Determins the height of each row. + # Determines the height of each row. row_height: Var[int] # Kind of row markers. @@ -360,8 +339,11 @@ class DataEditor(NoSSRComponent): editor_id = get_unique_variable_name() # Define the name of the getData callback associated with this component and assign to get_cell_content. - data_callback = f"getData_{editor_id}" - self.get_cell_content = Var(_js_expr=data_callback) # type: ignore + if self.get_cell_content is not None: + data_callback = self.get_cell_content._js_expr + else: + data_callback = f"getData_{editor_id}" + self.get_cell_content = Var(_js_expr=data_callback) # type: ignore code = [f"function {data_callback}([col, row])" "{"] @@ -406,10 +388,8 @@ class DataEditor(NoSSRComponent): props["rows"] = data.length() if isinstance(data, Var) else len(data) if not isinstance(columns, Var) and len(columns): - if ( - types.is_dataframe(type(data)) - or isinstance(data, Var) - and types.is_dataframe(data._var_type) + if types.is_dataframe(type(data)) or ( + isinstance(data, Var) and types.is_dataframe(data._var_type) ): raise ValueError( "Cannot pass in both a pandas dataframe and columns to the data_editor component." diff --git a/reflex/components/datadisplay/dataeditor.pyi b/reflex/components/datadisplay/dataeditor.pyi index aa4b3b2e8..d930fe256 100644 --- a/reflex/components/datadisplay/dataeditor.pyi +++ b/reflex/components/datadisplay/dataeditor.pyi @@ -288,10 +288,10 @@ class DataEditor(NoSSRComponent): freeze_columns: The number of columns which should remain in place when scrolling horizontally. Doesn't include rowMarkers. group_header_height: Controls the header of the group header row. header_height: Controls the height of the header row. - max_column_auto_width: Additional header icons: header_icons: Var[Any] # (TODO: must be a map of name: svg) The maximum width a column can be automatically sized to. + max_column_auto_width: The maximum width a column can be automatically sized to. max_column_width: The maximum width a column can be resized to. min_column_width: The minimum width a column can be resized to. - row_height: Determins the height of each row. + row_height: Determines the height of each row. row_markers: Kind of row markers. row_marker_start_index: Changes the starting index for row markers. row_marker_width: Sets the width of row markers in pixels, if unset row markers will automatically size. diff --git a/reflex/components/datadisplay/shiki_code_block.py b/reflex/components/datadisplay/shiki_code_block.py index 2b4e1f506..3b6bce8a1 100644 --- a/reflex/components/datadisplay/shiki_code_block.py +++ b/reflex/components/datadisplay/shiki_code_block.py @@ -490,17 +490,17 @@ class ShikiJsTransformer(ShikiBaseTransformers): }, # White Space # ".tab, .space": { - # "position": "relative", + # "position": "relative", # noqa: ERA001 # }, # ".tab::before": { - # "content": "'⇥'", - # "position": "absolute", - # "opacity": "0.3", + # "content": "'⇥'", # noqa: ERA001 + # "position": "absolute", # noqa: ERA001 + # "opacity": "0.3",# noqa: ERA001 # }, # ".space::before": { - # "content": "'·'", - # "position": "absolute", - # "opacity": "0.3", + # "content": "'·'", # noqa: ERA001 + # "position": "absolute", # noqa: ERA001 + # "opacity": "0.3", # noqa: ERA001 # }, } ) diff --git a/reflex/components/dynamic.py b/reflex/components/dynamic.py index ce59c3f30..fbfc55f97 100644 --- a/reflex/components/dynamic.py +++ b/reflex/components/dynamic.py @@ -173,7 +173,7 @@ def load_dynamic_serializer(): f"const [{unique_var_name}, set_{unique_var_name}] = useState(null);": None, "useEffect(() => {" "let isMounted = true;" - f"evalReactComponent({str(js_string)})" + f"evalReactComponent({js_string!s})" ".then((component) => {" "if (isMounted) {" f"set_{unique_var_name}(component);" @@ -183,7 +183,7 @@ def load_dynamic_serializer(): "isMounted = false;" "};" "}" - f", [{str(js_string)}]);": None, + f", [{js_string!s}]);": None, }, ), ), diff --git a/reflex/components/el/elements/__init__.py b/reflex/components/el/elements/__init__.py index 45a7e04b8..f0d4fd200 100644 --- a/reflex/components/el/elements/__init__.py +++ b/reflex/components/el/elements/__init__.py @@ -127,7 +127,7 @@ _MAPPING = { EXCLUDE = ["del_", "Del", "image"] -for _, v in _MAPPING.items(): +for v in _MAPPING.values(): v.extend([mod.capitalize() for mod in v if mod not in EXCLUDE]) _SUBMOD_ATTRS: dict[str, list[str]] = _MAPPING diff --git a/reflex/components/el/elements/__init__.pyi b/reflex/components/el/elements/__init__.pyi index c96a80987..defaa5848 100644 --- a/reflex/components/el/elements/__init__.pyi +++ b/reflex/components/el/elements/__init__.pyi @@ -339,5 +339,5 @@ _MAPPING = { ], } EXCLUDE = ["del_", "Del", "image"] -for _, v in _MAPPING.items(): +for v in _MAPPING.values(): v.extend([mod.capitalize() for mod in v if mod not in EXCLUDE]) diff --git a/reflex/components/el/elements/base.py b/reflex/components/el/elements/base.py index a9748ae25..f6e191f68 100644 --- a/reflex/components/el/elements/base.py +++ b/reflex/components/el/elements/base.py @@ -1,4 +1,4 @@ -"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py.""" +"""Base classes.""" from typing import Union @@ -9,7 +9,7 @@ from reflex.vars.base import Var class BaseHTML(Element): """Base class for common attributes.""" - # Provides a hint for generating a keyboard shortcut for the current element. + # Provides a hint for generating a keyboard shortcut for the current element. access_key: Var[Union[str, int, bool]] # Controls whether and how text input is automatically capitalized as it is entered/edited by the user. diff --git a/reflex/components/el/elements/base.pyi b/reflex/components/el/elements/base.pyi index 4d1d2c5c4..b60dabe87 100644 --- a/reflex/components/el/elements/base.pyi +++ b/reflex/components/el/elements/base.pyi @@ -67,7 +67,7 @@ class BaseHTML(Element): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/el/elements/forms.py b/reflex/components/el/elements/forms.py index 56dab5c7f..529a5e884 100644 --- a/reflex/components/el/elements/forms.py +++ b/reflex/components/el/elements/forms.py @@ -1,4 +1,4 @@ -"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py.""" +"""Forms classes.""" from __future__ import annotations @@ -18,6 +18,7 @@ from reflex.event import ( prevent_default, ) from reflex.utils.imports import ImportDict +from reflex.utils.types import is_optional from reflex.vars import VarData from reflex.vars.base import LiteralVar, Var @@ -84,7 +85,6 @@ class Datalist(BaseHTML): """Display the datalist element.""" tag = "datalist" - # No unique attributes, only common ones are inherited class Fieldset(Element): @@ -182,9 +182,7 @@ class Form(BaseHTML): props["handle_submit_unique_name"] = "" form = super().create(*children, **props) form.handle_submit_unique_name = md5( - str({**form._get_all_hooks_internal(), **form._get_all_hooks()}).encode( - "utf-8" - ) + str(form._get_all_hooks()).encode("utf-8") ).hexdigest() return form @@ -241,16 +239,15 @@ class Form(BaseHTML): if ref.startswith("refs_"): ref_var = Var(_js_expr=ref[:-3])._as_ref() form_refs[ref[len("refs_") : -3]] = Var( - _js_expr=f"getRefValues({str(ref_var)})", + _js_expr=f"getRefValues({ref_var!s})", _var_data=VarData.merge(ref_var._get_all_var_data()), ) else: ref_var = Var(_js_expr=ref)._as_ref() form_refs[ref[4:]] = Var( - _js_expr=f"getRefValue({str(ref_var)})", + _js_expr=f"getRefValue({ref_var!s})", _var_data=VarData.merge(ref_var._get_all_var_data()), ) - # print(repr(form_refs)) return form_refs def _get_vars(self, include_children: bool = True) -> Iterator[Var]: @@ -258,7 +255,8 @@ class Form(BaseHTML): yield from self._get_form_refs().values() def _exclude_props(self) -> list[str]: - return super()._exclude_props() + [ + return [ + *super()._exclude_props(), "reset_on_submit", "handle_submit_unique_name", ] @@ -383,6 +381,33 @@ class Input(BaseHTML): # Fired when a key is released on_key_up: EventHandler[key_event] + @classmethod + def create(cls, *children, **props): + """Create an Input component. + + Args: + *children: The children of the component. + **props: The properties of the component. + + Returns: + The component. + """ + from reflex.vars.number import ternary_operation + + value = props.get("value") + + # React expects an empty string(instead of null) for controlled inputs. + if value is not None and is_optional( + (value_var := Var.create(value))._var_type + ): + props["value"] = ternary_operation( + (value_var != Var.create(None)) # pyright: ignore [reportGeneralTypeIssues] + & (value_var != Var(_js_expr="undefined")), + value, + Var.create(""), + ) + return super().create(*children, **props) + class Label(BaseHTML): """Display the label element.""" @@ -400,7 +425,6 @@ class Legend(BaseHTML): """Display the legend element.""" tag = "legend" - # No unique attributes, only common ones are inherited class Meter(BaseHTML): @@ -652,19 +676,20 @@ class Textarea(BaseHTML): "Cannot combine `enter_key_submit` with `on_key_down`.", ) custom_attrs["on_key_down"] = Var( - _js_expr=f"(e) => enterKeySubmitOnKeyDown(e, {str(enter_key_submit)})", + _js_expr=f"(e) => enterKeySubmitOnKeyDown(e, {enter_key_submit!s})", _var_data=VarData.merge(enter_key_submit._get_all_var_data()), ) if auto_height is not None: auto_height = Var.create(auto_height) custom_attrs["on_input"] = Var( - _js_expr=f"(e) => autoHeightOnInput(e, {str(auto_height)})", + _js_expr=f"(e) => autoHeightOnInput(e, {auto_height!s})", _var_data=VarData.merge(auto_height._get_all_var_data()), ) return super().create(*children, **props) def _exclude_props(self) -> list[str]: - return super()._exclude_props() + [ + return [ + *super()._exclude_props(), "auto_height", "enter_key_submit", ] diff --git a/reflex/components/el/elements/forms.pyi b/reflex/components/el/elements/forms.pyi index e2d659338..dfab40b21 100644 --- a/reflex/components/el/elements/forms.pyi +++ b/reflex/components/el/elements/forms.pyi @@ -103,7 +103,7 @@ class Button(BaseHTML): name: Name of the button, used when sending form data type: Type of the button (submit, reset, or button) value: Value of the button, used when sending form data - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -189,7 +189,7 @@ class Datalist(BaseHTML): Args: *children: The children of the component. - access_key: No unique attributes, only common ones are inherited Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -367,7 +367,7 @@ class Form(BaseHTML): reset_on_submit: If true, the form will be cleared after submit. handle_submit_unique_name: The name used to make this form's submit handler function unique. on_submit: Fired when the form is submitted - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -512,7 +512,7 @@ class Input(BaseHTML): on_unmount: Optional[EventType[[], BASE_STATE]] = None, **props, ) -> "Input": - """Create the component. + """Create an Input component. Args: *children: The children of the component. @@ -554,7 +554,7 @@ class Input(BaseHTML): on_blur: Fired when the input loses focus on_key_down: Fired when a key is pressed down on_key_up: Fired when a key is released - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -576,7 +576,7 @@ class Input(BaseHTML): class_name: The class name for the component. autofocus: Whether the component should take the focus once the page is loaded custom_attrs: custom attribute - **props: The props of the component. + **props: The properties of the component. Returns: The component. @@ -644,7 +644,7 @@ class Label(BaseHTML): *children: The children of the component. html_for: ID of a form control with which the label is associated form: Associates the label with a form (by id) - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -730,7 +730,7 @@ class Legend(BaseHTML): Args: *children: The children of the component. - access_key: No unique attributes, only common ones are inherited Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -830,7 +830,7 @@ class Meter(BaseHTML): min: Minimum value of the range optimum: Optimum value in the range value: Current value of the meter - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -920,7 +920,7 @@ class Optgroup(BaseHTML): *children: The children of the component. disabled: Disables the optgroup label: Label for the optgroup - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1014,7 +1014,7 @@ class Option(BaseHTML): label: Label for the option, if the text is not the label selected: Indicates that the option is initially selected value: Value to be sent as form data - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1106,7 +1106,7 @@ class Output(BaseHTML): html_for: Associates the output with one or more elements (by their IDs) form: Associates the output with a form (by id) name: Name of the output element for form submission - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1198,7 +1198,7 @@ class Progress(BaseHTML): form: Associates the progress element with a form (by id) max: Maximum value of the progress indicator value: Current value of the progress indicator - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1306,7 +1306,7 @@ class Select(BaseHTML): required: Indicates that the select control must have a selected option size: Number of visible options in a drop-down list on_change: Fired when the select value changes - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1459,7 +1459,7 @@ class Textarea(BaseHTML): on_blur: Fired when the input loses focus on_key_down: Fired when a key is pressed down on_key_up: Fired when a key is released - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/el/elements/inline.py b/reflex/components/el/elements/inline.py index d1bdf6b87..270eca28e 100644 --- a/reflex/components/el/elements/inline.py +++ b/reflex/components/el/elements/inline.py @@ -1,4 +1,4 @@ -"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py.""" +"""Inline classes.""" from typing import Union diff --git a/reflex/components/el/elements/inline.pyi b/reflex/components/el/elements/inline.pyi index 1b4af4fc8..06aeeca76 100644 --- a/reflex/components/el/elements/inline.pyi +++ b/reflex/components/el/elements/inline.pyi @@ -88,7 +88,7 @@ class A(BaseHTML): rel: Specifies the relationship between the linked document and the current document shape: Specifies the shape of the area target: Specifies where to open the linked document - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -174,7 +174,7 @@ class Abbr(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -260,7 +260,7 @@ class B(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -346,7 +346,7 @@ class Bdi(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -432,7 +432,7 @@ class Bdo(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -518,7 +518,7 @@ class Br(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -604,7 +604,7 @@ class Cite(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -690,7 +690,7 @@ class Code(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -778,7 +778,7 @@ class Data(BaseHTML): Args: *children: The children of the component. value: Specifies the machine-readable translation of the data element. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -864,7 +864,7 @@ class Dfn(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -950,7 +950,7 @@ class Em(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1036,7 +1036,7 @@ class I(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1122,7 +1122,7 @@ class Kbd(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1208,7 +1208,7 @@ class Mark(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1296,7 +1296,7 @@ class Q(BaseHTML): Args: *children: The children of the component. cite: Specifies the source URL of the quote. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1382,7 +1382,7 @@ class Rp(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1468,7 +1468,7 @@ class Rt(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1554,7 +1554,7 @@ class Ruby(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1640,7 +1640,7 @@ class S(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1726,7 +1726,7 @@ class Samp(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1812,7 +1812,7 @@ class Small(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1898,7 +1898,7 @@ class Span(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1984,7 +1984,7 @@ class Strong(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -2070,7 +2070,7 @@ class Sub(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -2156,7 +2156,7 @@ class Sup(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -2244,7 +2244,7 @@ class Time(BaseHTML): Args: *children: The children of the component. date_time: Specifies the date and/or time of the element. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -2330,7 +2330,7 @@ class U(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -2416,7 +2416,7 @@ class Wbr(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/el/elements/media.py b/reflex/components/el/elements/media.py index 9935902ad..7d2f0e3e9 100644 --- a/reflex/components/el/elements/media.py +++ b/reflex/components/el/elements/media.py @@ -1,4 +1,4 @@ -"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py.""" +"""Media classes.""" from typing import Any, Union @@ -129,7 +129,6 @@ class Img(BaseHTML): Returns: The component. - """ return ( super().create(src=children[0], **props) @@ -274,14 +273,12 @@ class Picture(BaseHTML): """Display the picture element.""" tag = "picture" - # No unique attributes, only common ones are inherited class Portal(BaseHTML): """Display the portal element.""" tag = "portal" - # No unique attributes, only common ones are inherited class Source(BaseHTML): diff --git a/reflex/components/el/elements/media.pyi b/reflex/components/el/elements/media.pyi index edaf1228e..b172d0c07 100644 --- a/reflex/components/el/elements/media.pyi +++ b/reflex/components/el/elements/media.pyi @@ -94,7 +94,7 @@ class Area(BaseHTML): rel: Specifies the relationship of the target object to the link object shape: Defines the shape of the area (rectangle, circle, polygon) target: Specifies where to open the linked document - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -198,7 +198,7 @@ class Audio(BaseHTML): muted: Indicates whether the audio is muted by default preload: Specifies how the audio file should be preloaded src: URL of the audio to play - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -314,7 +314,7 @@ class Img(BaseHTML): src: URL of the image to display src_set: A set of source sizes and URLs for responsive images use_map: The name of the map to use with the image - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -340,7 +340,6 @@ class Img(BaseHTML): Returns: The component. - """ ... @@ -403,7 +402,7 @@ class Map(BaseHTML): Args: *children: The children of the component. name: Name of the map, referenced by the 'usemap' attribute in 'img' and 'object' elements - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -499,7 +498,7 @@ class Track(BaseHTML): label: Title of the text track, used by the browser when listing available text tracks src: URL of the track file src_lang: Language of the track text data - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -609,7 +608,7 @@ class Video(BaseHTML): poster: URL of an image to show while the video is downloading, or until the user hits the play button preload: Specifies how the video file should be preloaded src: URL of the video to play - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -699,7 +698,7 @@ class Embed(BaseHTML): *children: The children of the component. src: URL of the embedded content type: Media type of the embedded content - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -805,7 +804,7 @@ class Iframe(BaseHTML): sandbox: Security restrictions for the content in the iframe src: URL of the document to display in the iframe src_doc: HTML content to embed directly within the iframe - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -901,7 +900,7 @@ class Object(BaseHTML): name: Name of the object, used for scripting or as a target for forms and links type: Media type of the data specified in the data attribute use_map: Name of an image map to use with the object - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -987,7 +986,7 @@ class Picture(BaseHTML): Args: *children: The children of the component. - access_key: No unique attributes, only common ones are inherited Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1073,7 +1072,7 @@ class Portal(BaseHTML): Args: *children: The children of the component. - access_key: No unique attributes, only common ones are inherited Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1169,7 +1168,7 @@ class Source(BaseHTML): src: URL of the media file or an image for the element to use src_set: A set of source sizes and URLs for responsive images type: Media type of the source - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1261,7 +1260,7 @@ class Svg(BaseHTML): width: The width of the svg. height: The height of the svg. xmlns: The XML namespace declaration. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1361,7 +1360,7 @@ class Text(BaseHTML): rotate: Rotates orientation of each individual glyph. length_adjust: How the text is stretched or compressed to fit the width defined by the text_length attribute. text_length: A width that the text should be scaled to fit. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1457,7 +1456,7 @@ class Line(BaseHTML): y1: The y-axis coordinate of the line starting point. y2: The y-axis coordinate of the the line ending point. path_length: The total path length, in user units. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1551,7 +1550,7 @@ class Circle(BaseHTML): cy: The y-axis coordinate of the center of the circle. r: The radius of the circle. path_length: The total length for the circle's circumference, in user units. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1647,7 +1646,7 @@ class Ellipse(BaseHTML): rx: The radius of the ellipse on the x axis. ry: The radius of the ellipse on the y axis. path_length: The total length for the ellipse's circumference, in user units. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1747,7 +1746,7 @@ class Rect(BaseHTML): rx: The horizontal corner radius of the rect. Defaults to ry if it is specified. ry: The vertical corner radius of the rect. Defaults to rx if it is specified. path_length: The total length of the rectangle's perimeter, in user units. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1837,7 +1836,7 @@ class Polygon(BaseHTML): *children: The children of the component. points: defines the list of points (pairs of x,y absolute coordinates) required to draw the polygon. path_length: This prop lets specify the total length for the path, in user units. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1923,7 +1922,7 @@ class Defs(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -2023,7 +2022,7 @@ class LinearGradient(BaseHTML): x2: X coordinate of the ending point of the gradient. y1: Y coordinate of the starting point of the gradient. y2: Y coordinate of the ending point of the gradient. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -2127,7 +2126,7 @@ class RadialGradient(BaseHTML): gradient_transform: Transform applied to the gradient. r: The radius of the end circle of the radial gradient. spread_method: Method used to spread the gradient. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -2223,7 +2222,7 @@ class Stop(BaseHTML): offset: Offset of the gradient stop. stop_color: Color of the gradient stop. stop_opacity: Opacity of the gradient stop. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -2311,7 +2310,7 @@ class Path(BaseHTML): Args: *children: The children of the component. d: Defines the shape of the path. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -2413,7 +2412,7 @@ class SVG(ComponentNamespace): width: The width of the svg. height: The height of the svg. xmlns: The XML namespace declaration. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/el/elements/metadata.py b/reflex/components/el/elements/metadata.py index 983a8f3a0..8e0fbcd4d 100644 --- a/reflex/components/el/elements/metadata.py +++ b/reflex/components/el/elements/metadata.py @@ -1,4 +1,4 @@ -"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py.""" +"""Metadata classes.""" from typing import List, Union @@ -8,7 +8,7 @@ from reflex.vars.base import Var from .base import BaseHTML -class Base(BaseHTML): # noqa: E742 +class Base(BaseHTML): """Display the base element.""" tag = "base" @@ -18,13 +18,13 @@ class Base(BaseHTML): # noqa: E742 target: Var[Union[str, int, bool]] -class Head(BaseHTML): # noqa: E742 +class Head(BaseHTML): """Display the head element.""" tag = "head" -class Link(BaseHTML): # noqa: E742 +class Link(BaseHTML): """Display the link element.""" tag = "link" @@ -75,14 +75,14 @@ class Meta(BaseHTML): # Inherits common attributes from BaseHTML name: Var[Union[str, int, bool]] -class Title(Element): # noqa: E742 +class Title(Element): """Display the title element.""" tag = "title" -# Had to be named with an underscore so it doesnt conflict with reflex.style Style in pyi -class StyleEl(Element): # noqa: E742 +# Had to be named with an underscore so it doesn't conflict with reflex.style Style in pyi +class StyleEl(Element): """Display the style element.""" tag = "style" diff --git a/reflex/components/el/elements/metadata.pyi b/reflex/components/el/elements/metadata.pyi index 5af92e2b2..08cd2fd76 100644 --- a/reflex/components/el/elements/metadata.pyi +++ b/reflex/components/el/elements/metadata.pyi @@ -71,7 +71,7 @@ class Base(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -157,7 +157,7 @@ class Head(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -265,7 +265,7 @@ class Link(BaseHTML): rel: Specifies the relationship between the current document and the linked one sizes: Specifies the sizes of icons for visual media type: Specifies the MIME type of the linked document - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -359,7 +359,7 @@ class Meta(BaseHTML): content: Defines the content of the metadata http_equiv: Provides an HTTP header for the information/value of the content attribute name: Specifies a name for the metadata - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/el/elements/other.py b/reflex/components/el/elements/other.py index fa7c6cdec..4e7f0f227 100644 --- a/reflex/components/el/elements/other.py +++ b/reflex/components/el/elements/other.py @@ -1,4 +1,4 @@ -"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py.""" +"""Other classes.""" from typing import Union @@ -26,31 +26,39 @@ class Dialog(BaseHTML): class Summary(BaseHTML): - """Display the summary element.""" + """Display the summary element. + + Used as a summary or caption for a
element. + """ tag = "summary" - # No unique attributes, only common ones are inherited; used as a summary or caption for a
element class Slot(BaseHTML): - """Display the slot element.""" + """Display the slot element. + + Used as a placeholder inside a web component. + """ tag = "slot" - # No unique attributes, only common ones are inherited; used as a placeholder inside a web component class Template(BaseHTML): - """Display the template element.""" + """Display the template element. + + Used for declaring fragments of HTML that can be cloned and inserted in the document. + """ tag = "template" - # No unique attributes, only common ones are inherited; used for declaring fragments of HTML that can be cloned and inserted in the document class Math(BaseHTML): - """Display the math element.""" + """Display the math element. + + Represents a mathematical expression. + """ tag = "math" - # No unique attributes, only common ones are inherited; used for displaying mathematical expressions class Html(BaseHTML): diff --git a/reflex/components/el/elements/other.pyi b/reflex/components/el/elements/other.pyi index 3d65af647..57e4ab24b 100644 --- a/reflex/components/el/elements/other.pyi +++ b/reflex/components/el/elements/other.pyi @@ -70,7 +70,7 @@ class Details(BaseHTML): Args: *children: The children of the component. open: Indicates whether the details will be visible (expanded) to the user - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -158,7 +158,7 @@ class Dialog(BaseHTML): Args: *children: The children of the component. open: Indicates whether the dialog is active and can be interacted with - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -244,7 +244,7 @@ class Summary(BaseHTML): Args: *children: The children of the component. - access_key: No unique attributes, only common ones are inherited; used as a summary or caption for a
element Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -330,7 +330,7 @@ class Slot(BaseHTML): Args: *children: The children of the component. - access_key: No unique attributes, only common ones are inherited; used as a placeholder inside a web component Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -416,7 +416,7 @@ class Template(BaseHTML): Args: *children: The children of the component. - access_key: No unique attributes, only common ones are inherited; used for declaring fragments of HTML that can be cloned and inserted in the document Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -502,7 +502,7 @@ class Math(BaseHTML): Args: *children: The children of the component. - access_key: No unique attributes, only common ones are inherited; used for displaying mathematical expressions Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -590,7 +590,7 @@ class Html(BaseHTML): Args: *children: The children of the component. manifest: Specifies the URL of the document's cache manifest (obsolete in HTML5) - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/el/elements/scripts.py b/reflex/components/el/elements/scripts.py index b53306e02..c30931e99 100644 --- a/reflex/components/el/elements/scripts.py +++ b/reflex/components/el/elements/scripts.py @@ -1,4 +1,4 @@ -"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py.""" +"""Scripts classes.""" from typing import Union @@ -17,7 +17,6 @@ class Noscript(BaseHTML): """Display the noscript element.""" tag = "noscript" - # No unique attributes, only common ones are inherited class Script(BaseHTML): diff --git a/reflex/components/el/elements/scripts.pyi b/reflex/components/el/elements/scripts.pyi index 6f03c20cb..c66e150af 100644 --- a/reflex/components/el/elements/scripts.pyi +++ b/reflex/components/el/elements/scripts.pyi @@ -68,7 +68,7 @@ class Canvas(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -154,7 +154,7 @@ class Noscript(BaseHTML): Args: *children: The children of the component. - access_key: No unique attributes, only common ones are inherited Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -262,7 +262,7 @@ class Script(BaseHTML): referrer_policy: Specifies which referrer information to send when fetching the script src: URL of an external script type: Specifies the MIME type of the script - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/el/elements/sectioning.py b/reflex/components/el/elements/sectioning.py index 6aea8c1e3..cfe82b6d5 100644 --- a/reflex/components/el/elements/sectioning.py +++ b/reflex/components/el/elements/sectioning.py @@ -1,93 +1,93 @@ -"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py.""" +"""Sectioning classes.""" from .base import BaseHTML -class Body(BaseHTML): # noqa: E742 +class Body(BaseHTML): """Display the body element.""" tag = "body" -class Address(BaseHTML): # noqa: E742 +class Address(BaseHTML): """Display the address element.""" tag = "address" -class Article(BaseHTML): # noqa: E742 +class Article(BaseHTML): """Display the article element.""" tag = "article" -class Aside(BaseHTML): # noqa: E742 +class Aside(BaseHTML): """Display the aside element.""" tag = "aside" -class Footer(BaseHTML): # noqa: E742 +class Footer(BaseHTML): """Display the footer element.""" tag = "footer" -class Header(BaseHTML): # noqa: E742 +class Header(BaseHTML): """Display the header element.""" tag = "header" -class H1(BaseHTML): # noqa: E742 +class H1(BaseHTML): """Display the h1 element.""" tag = "h1" -class H2(BaseHTML): # noqa: E742 +class H2(BaseHTML): """Display the h1 element.""" tag = "h2" -class H3(BaseHTML): # noqa: E742 +class H3(BaseHTML): """Display the h1 element.""" tag = "h3" -class H4(BaseHTML): # noqa: E742 +class H4(BaseHTML): """Display the h1 element.""" tag = "h4" -class H5(BaseHTML): # noqa: E742 +class H5(BaseHTML): """Display the h1 element.""" tag = "h5" -class H6(BaseHTML): # noqa: E742 +class H6(BaseHTML): """Display the h1 element.""" tag = "h6" -class Main(BaseHTML): # noqa: E742 +class Main(BaseHTML): """Display the main element.""" tag = "main" -class Nav(BaseHTML): # noqa: E742 +class Nav(BaseHTML): """Display the nav element.""" tag = "nav" -class Section(BaseHTML): # noqa: E742 +class Section(BaseHTML): """Display the section element.""" tag = "section" diff --git a/reflex/components/el/elements/sectioning.pyi b/reflex/components/el/elements/sectioning.pyi index e34d53ee2..ecbabe516 100644 --- a/reflex/components/el/elements/sectioning.pyi +++ b/reflex/components/el/elements/sectioning.pyi @@ -68,7 +68,7 @@ class Body(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -154,7 +154,7 @@ class Address(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -240,7 +240,7 @@ class Article(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -326,7 +326,7 @@ class Aside(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -412,7 +412,7 @@ class Footer(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -498,7 +498,7 @@ class Header(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -584,7 +584,7 @@ class H1(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -670,7 +670,7 @@ class H2(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -756,7 +756,7 @@ class H3(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -842,7 +842,7 @@ class H4(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -928,7 +928,7 @@ class H5(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1014,7 +1014,7 @@ class H6(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1100,7 +1100,7 @@ class Main(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1186,7 +1186,7 @@ class Nav(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1272,7 +1272,7 @@ class Section(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/el/elements/tables.py b/reflex/components/el/elements/tables.py index 8f6cfcba4..a0c10d829 100644 --- a/reflex/components/el/elements/tables.py +++ b/reflex/components/el/elements/tables.py @@ -1,4 +1,4 @@ -"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py.""" +"""Tables classes.""" from typing import Union diff --git a/reflex/components/el/elements/tables.pyi b/reflex/components/el/elements/tables.pyi index b0495009d..420bad585 100644 --- a/reflex/components/el/elements/tables.pyi +++ b/reflex/components/el/elements/tables.pyi @@ -70,7 +70,7 @@ class Caption(BaseHTML): Args: *children: The children of the component. align: Alignment of the caption - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -160,7 +160,7 @@ class Col(BaseHTML): *children: The children of the component. align: Alignment of the content within the column span: Number of columns the col element spans - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -250,7 +250,7 @@ class Colgroup(BaseHTML): *children: The children of the component. align: Alignment of the content within the column group span: Number of columns the colgroup element spans - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -340,7 +340,7 @@ class Table(BaseHTML): *children: The children of the component. align: Alignment of the table summary: Provides a summary of the table's purpose and structure - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -428,7 +428,7 @@ class Tbody(BaseHTML): Args: *children: The children of the component. align: Alignment of the content within the table body - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -522,7 +522,7 @@ class Td(BaseHTML): col_span: Number of columns a cell should span headers: IDs of the headers associated with this cell row_span: Number of rows a cell should span - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -610,7 +610,7 @@ class Tfoot(BaseHTML): Args: *children: The children of the component. align: Alignment of the content within the table footer - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -706,7 +706,7 @@ class Th(BaseHTML): headers: IDs of the headers associated with this header cell row_span: Number of rows a header cell should span scope: Scope of the header cell (row, col, rowgroup, colgroup) - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -794,7 +794,7 @@ class Thead(BaseHTML): Args: *children: The children of the component. align: Alignment of the content within the table header - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -882,7 +882,7 @@ class Tr(BaseHTML): Args: *children: The children of the component. align: Alignment of the content within the table row - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/el/elements/typography.py b/reflex/components/el/elements/typography.py index 7c55ecce7..9fa5c3a02 100644 --- a/reflex/components/el/elements/typography.py +++ b/reflex/components/el/elements/typography.py @@ -1,4 +1,4 @@ -"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py.""" +"""Typography classes.""" from typing import Union diff --git a/reflex/components/el/elements/typography.pyi b/reflex/components/el/elements/typography.pyi index b28af1c40..8332b3306 100644 --- a/reflex/components/el/elements/typography.pyi +++ b/reflex/components/el/elements/typography.pyi @@ -70,7 +70,7 @@ class Blockquote(BaseHTML): Args: *children: The children of the component. cite: Define the title of a work. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -156,7 +156,7 @@ class Dd(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -242,7 +242,7 @@ class Div(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -328,7 +328,7 @@ class Dl(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -414,7 +414,7 @@ class Dt(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -500,7 +500,7 @@ class Figcaption(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -588,7 +588,7 @@ class Hr(BaseHTML): Args: *children: The children of the component. align: Used to specify the alignment of text content of The Element. this attribute is used in all elements. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -674,7 +674,7 @@ class Li(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -762,7 +762,7 @@ class Menu(BaseHTML): Args: *children: The children of the component. type: Specifies that the menu element is a context menu. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -854,7 +854,7 @@ class Ol(BaseHTML): reversed: Reverses the order of the list. start: Specifies the start value of the first list item in an ordered list. type: Specifies the kind of marker to use in the list (letters or numbers). - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -940,7 +940,7 @@ class P(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1026,7 +1026,7 @@ class Pre(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1112,7 +1112,7 @@ class Ul(BaseHTML): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1202,7 +1202,7 @@ class Ins(BaseHTML): *children: The children of the component. cite: Specifies the URL of the document that explains the reason why the text was inserted/changed. date_time: Specifies the date and time of when the text was inserted/changed. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1292,7 +1292,7 @@ class Del(BaseHTML): *children: The children of the component. cite: Specifies the URL of the document that explains the reason why the text was deleted. date_time: Specifies the date and time of when the text was deleted. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/lucide/icon.py b/reflex/components/lucide/icon.py index b32fb8de3..6b7692643 100644 --- a/reflex/components/lucide/icon.py +++ b/reflex/components/lucide/icon.py @@ -8,7 +8,7 @@ from reflex.vars.base import Var class LucideIconComponent(Component): """Lucide Icon Component.""" - library = "lucide-react@0.359.0" + library = "lucide-react@0.469.0" class Icon(LucideIconComponent): @@ -106,6 +106,7 @@ LUCIDE_ICON_LIST = [ "ambulance", "ampersand", "ampersands", + "amphora", "anchor", "angry", "annoyed", @@ -193,6 +194,7 @@ LUCIDE_ICON_LIST = [ "baggage_claim", "ban", "banana", + "bandage", "banknote", "bar_chart", "bar_chart_2", @@ -230,8 +232,10 @@ LUCIDE_ICON_LIST = [ "between_horizontal_start", "between_vertical_end", "between_vertical_start", + "biceps_flexed", "bike", "binary", + "binoculars", "biohazard", "bird", "bitcoin", @@ -278,6 +282,7 @@ LUCIDE_ICON_LIST = [ "boom_box", "bot", "bot_message_square", + "bot_off", "box", "box_select", "boxes", @@ -289,6 +294,7 @@ LUCIDE_ICON_LIST = [ "brick_wall", "briefcase", "briefcase_business", + "briefcase_conveyor_belt", "briefcase_medical", "bring_to_front", "brush", @@ -305,9 +311,13 @@ LUCIDE_ICON_LIST = [ "cake_slice", "calculator", "calendar", + "calendar_1", + "calendar_arrow_down", + "calendar_arrow_up", "calendar_check", "calendar_check_2", "calendar_clock", + "calendar_cog", "calendar_days", "calendar_fold", "calendar_heart", @@ -318,6 +328,7 @@ LUCIDE_ICON_LIST = [ "calendar_plus_2", "calendar_range", "calendar_search", + "calendar_sync", "calendar_x", "calendar_x_2", "camera", @@ -342,6 +353,29 @@ LUCIDE_ICON_LIST = [ "castle", "cat", "cctv", + "chart_area", + "chart_bar", + "chart_bar_big", + "chart_bar_decreasing", + "chart_bar_increasing", + "chart_bar_stacked", + "chart_candlestick", + "chart_column", + "chart_column_big", + "chart_column_decreasing", + "chart_column_increasing", + "chart_column_stacked", + "chart_gantt", + "chart_line", + "chart_network", + "chart_no_axes_column", + "chart_no_axes_column_decreasing", + "chart_no_axes_column_increasing", + "chart_no_axes_combined", + "chart_no_axes_gantt", + "chart_pie", + "chart_scatter", + "chart_spline", "check", "check_check", "chef_hat", @@ -356,6 +390,7 @@ LUCIDE_ICON_LIST = [ "chevrons_down_up", "chevrons_left", "chevrons_left_right", + "chevrons_left_right_ellipsis", "chevrons_right", "chevrons_right_left", "chevrons_up", @@ -374,8 +409,8 @@ LUCIDE_ICON_LIST = [ "circle_arrow_out_up_right", "circle_arrow_right", "circle_arrow_up", - "circle_check_big", "circle_check", + "circle_check_big", "circle_chevron_down", "circle_chevron_left", "circle_chevron_right", @@ -387,13 +422,14 @@ LUCIDE_ICON_LIST = [ "circle_dot_dashed", "circle_ellipsis", "circle_equal", + "circle_fading_arrow_up", "circle_fading_plus", "circle_gauge", "circle_help", "circle_minus", "circle_off", - "circle_parking_off", "circle_parking", + "circle_parking_off", "circle_pause", "circle_percent", "circle_play", @@ -432,7 +468,11 @@ LUCIDE_ICON_LIST = [ "clock_7", "clock_8", "clock_9", + "clock_alert", + "clock_arrow_down", + "clock_arrow_up", "cloud", + "cloud_alert", "cloud_cog", "cloud_download", "cloud_drizzle", @@ -503,6 +543,7 @@ LUCIDE_ICON_LIST = [ "cup_soda", "currency", "cylinder", + "dam", "database", "database_backup", "database_zap", @@ -510,7 +551,9 @@ LUCIDE_ICON_LIST = [ "dessert", "diameter", "diamond", + "diamond_minus", "diamond_percent", + "diamond_plus", "dice_1", "dice_2", "dice_3", @@ -539,6 +582,7 @@ LUCIDE_ICON_LIST = [ "dribbble", "drill", "droplet", + "droplet_off", "droplets", "drum", "drumstick", @@ -554,12 +598,15 @@ LUCIDE_ICON_LIST = [ "ellipsis", "ellipsis_vertical", "equal", + "equal_approximately", "equal_not", "eraser", + "ethernet_port", "euro", "expand", "external_link", "eye", + "eye_closed", "eye_off", "facebook", "factory", @@ -579,6 +626,10 @@ LUCIDE_ICON_LIST = [ "file_bar_chart", "file_bar_chart_2", "file_box", + "file_chart_column", + "file_chart_column_increasing", + "file_chart_line", + "file_chart_pie", "file_check", "file_check_2", "file_clock", @@ -620,6 +671,7 @@ LUCIDE_ICON_LIST = [ "file_type", "file_type_2", "file_up", + "file_user", "file_video", "file_video_2", "file_volume", @@ -661,6 +713,7 @@ LUCIDE_ICON_LIST = [ "folder_check", "folder_clock", "folder_closed", + "folder_code", "folder_cog", "folder_dot", "folder_down", @@ -733,7 +786,12 @@ LUCIDE_ICON_LIST = [ "graduation_cap", "grape", "grid_2x2", + "grid_2x_2", + "grid_2x_2_check", + "grid_2x_2_plus", + "grid_2x_2_x", "grid_3x3", + "grid_3x_3", "grip", "grip_horizontal", "grip_vertical", @@ -762,6 +820,7 @@ LUCIDE_ICON_LIST = [ "heading_4", "heading_5", "heading_6", + "headphone_off", "headphones", "headset", "heart", @@ -779,14 +838,20 @@ LUCIDE_ICON_LIST = [ "hospital", "hotel", "hourglass", + "house", + "house_plug", + "house_plus", "ice_cream_bowl", "ice_cream_cone", + "id_card", "image", "image_down", "image_minus", "image_off", + "image_play", "image_plus", "image_up", + "image_upscale", "images", "import", "inbox", @@ -808,6 +873,7 @@ LUCIDE_ICON_LIST = [ "key_square", "keyboard", "keyboard_music", + "keyboard_off", "lamp", "lamp_ceiling", "lamp_desk", @@ -817,8 +883,9 @@ LUCIDE_ICON_LIST = [ "land_plot", "landmark", "languages", - "laptop_minimal", "laptop", + "laptop_minimal", + "laptop_minimal_check", "lasso", "lasso_select", "laugh", @@ -833,6 +900,8 @@ LUCIDE_ICON_LIST = [ "layout_template", "leaf", "leafy_green", + "lectern", + "letter_text", "library", "library_big", "life_buoy", @@ -845,10 +914,12 @@ LUCIDE_ICON_LIST = [ "link_2_off", "linkedin", "list", + "list_check", "list_checks", "list_collapse", "list_end", "list_filter", + "list_filter_plus", "list_minus", "list_music", "list_ordered", @@ -861,15 +932,17 @@ LUCIDE_ICON_LIST = [ "list_x", "loader", "loader_circle", + "loader_pinwheel", "locate", "locate_fixed", "locate_off", "lock", - "lock_keyhole_open", "lock_keyhole", + "lock_keyhole_open", "lock_open", "log_in", "log_out", + "logs", "lollipop", "luggage", "magnet", @@ -886,7 +959,16 @@ LUCIDE_ICON_LIST = [ "mails", "map", "map_pin", + "map_pin_check", + "map_pin_check_inside", + "map_pin_house", + "map_pin_minus", + "map_pin_minus_inside", "map_pin_off", + "map_pin_plus", + "map_pin_plus_inside", + "map_pin_x", + "map_pin_x_inside", "map_pinned", "martini", "maximize", @@ -915,6 +997,7 @@ LUCIDE_ICON_LIST = [ "message_square_diff", "message_square_dot", "message_square_heart", + "message_square_lock", "message_square_more", "message_square_off", "message_square_plus", @@ -926,8 +1009,9 @@ LUCIDE_ICON_LIST = [ "message_square_x", "messages_square", "mic", - "mic_vocal", "mic_off", + "mic_vocal", + "microchip", "microscope", "microwave", "milestone", @@ -938,6 +1022,7 @@ LUCIDE_ICON_LIST = [ "minus", "monitor", "monitor_check", + "monitor_cog", "monitor_dot", "monitor_down", "monitor_off", @@ -953,8 +1038,10 @@ LUCIDE_ICON_LIST = [ "mountain", "mountain_snow", "mouse", + "mouse_off", "mouse_pointer", "mouse_pointer_2", + "mouse_pointer_ban", "mouse_pointer_click", "move", "move_3d", @@ -991,10 +1078,13 @@ LUCIDE_ICON_LIST = [ "nut_off", "octagon", "octagon_alert", + "octagon_minus", "octagon_pause", "octagon_x", + "omega", "option", "orbit", + "origami", "package", "package_2", "package_check", @@ -1007,6 +1097,7 @@ LUCIDE_ICON_LIST = [ "paint_roller", "paintbrush", "paintbrush_2", + "paintbrush_vertical", "palette", "panel_bottom", "panel_bottom_close", @@ -1036,13 +1127,16 @@ LUCIDE_ICON_LIST = [ "pc_case", "pen", "pen_line", + "pen_off", "pen_tool", "pencil", "pencil_line", + "pencil_off", "pencil_ruler", "pentagon", "percent", "person_standing", + "philippine_peso", "phone", "phone_call", "phone_forwarded", @@ -1058,7 +1152,10 @@ LUCIDE_ICON_LIST = [ "pie_chart", "piggy_bank", "pilcrow", + "pilcrow_left", + "pilcrow_right", "pill", + "pill_bottle", "pin", "pin_off", "pipette", @@ -1084,6 +1181,7 @@ LUCIDE_ICON_LIST = [ "power_off", "presentation", "printer", + "printer_check", "projector", "proportions", "puzzle", @@ -1158,6 +1256,7 @@ LUCIDE_ICON_LIST = [ "satellite_dish", "save", "save_all", + "save_off", "scale", "scale_3d", "scaling", @@ -1165,7 +1264,9 @@ LUCIDE_ICON_LIST = [ "scan_barcode", "scan_eye", "scan_face", + "scan_heart", "scan_line", + "scan_qr_code", "scan_search", "scan_text", "scatter_chart", @@ -1181,6 +1282,7 @@ LUCIDE_ICON_LIST = [ "search_code", "search_slash", "search_x", + "section", "send", "send_horizontal", "send_to_back", @@ -1225,6 +1327,7 @@ LUCIDE_ICON_LIST = [ "signal_low", "signal_medium", "signal_zero", + "signature", "signpost", "signpost_big", "siren", @@ -1234,8 +1337,8 @@ LUCIDE_ICON_LIST = [ "slack", "slash", "slice", - "sliders_vertical", "sliders_horizontal", + "sliders_vertical", "smartphone", "smartphone_charging", "smartphone_nfc", @@ -1259,29 +1362,31 @@ LUCIDE_ICON_LIST = [ "sprout", "square", "square_activity", + "square_arrow_down", "square_arrow_down_left", "square_arrow_down_right", - "square_arrow_down", "square_arrow_left", "square_arrow_out_down_left", "square_arrow_out_down_right", "square_arrow_out_up_left", "square_arrow_out_up_right", "square_arrow_right", + "square_arrow_up", "square_arrow_up_left", "square_arrow_up_right", - "square_arrow_up", "square_asterisk", "square_bottom_dashed_scissors", - "square_check_big", + "square_chart_gantt", "square_check", + "square_check_big", "square_chevron_down", "square_chevron_left", "square_chevron_right", "square_chevron_up", "square_code", - "square_dashed_bottom_code", + "square_dashed", "square_dashed_bottom", + "square_dashed_bottom_code", "square_dashed_kanban", "square_dashed_mouse_pointer", "square_divide", @@ -1295,8 +1400,8 @@ LUCIDE_ICON_LIST = [ "square_menu", "square_minus", "square_mouse_pointer", - "square_parking_off", "square_parking", + "square_parking_off", "square_pen", "square_percent", "square_pi", @@ -1310,10 +1415,11 @@ LUCIDE_ICON_LIST = [ "square_slash", "square_split_horizontal", "square_split_vertical", + "square_square", "square_stack", "square_terminal", - "square_user_round", "square_user", + "square_user_round", "square_x", "squircle", "squirrel", @@ -1350,6 +1456,7 @@ LUCIDE_ICON_LIST = [ "table_cells_merge", "table_cells_split", "table_columns_split", + "table_of_contents", "table_properties", "table_rows_split", "tablet", @@ -1365,11 +1472,11 @@ LUCIDE_ICON_LIST = [ "tangent", "target", "telescope", + "tent", "tent_tree", "terminal", - "test_tube_diagonal", "test_tube", - "tent", + "test_tube_diagonal", "test_tubes", "text", "text_cursor", @@ -1390,11 +1497,14 @@ LUCIDE_ICON_LIST = [ "ticket_plus", "ticket_slash", "ticket_x", + "tickets", + "tickets_plane", "timer", "timer_off", "timer_reset", "toggle_left", "toggle_right", + "toilet", "tornado", "torus", "touchpad", @@ -1416,17 +1526,21 @@ LUCIDE_ICON_LIST = [ "trello", "trending_down", "trending_up", + "trending_up_down", "triangle", - "triangle_right", "triangle_alert", + "triangle_right", "trophy", "truck", "turtle", "tv", "tv_2", + "tv_minimal", + "tv_minimal_play", "twitch", "twitter", "type", + "type_outline", "umbrella", "umbrella_off", "underline", @@ -1437,8 +1551,8 @@ LUCIDE_ICON_LIST = [ "unfold_vertical", "ungroup", "university", - "unlink_2", "unlink", + "unlink_2", "unplug", "upload", "usb", @@ -1446,11 +1560,13 @@ LUCIDE_ICON_LIST = [ "user_check", "user_cog", "user_minus", + "user_pen", "user_plus", "user_round", "user_round_check", "user_round_cog", "user_round_minus", + "user_round_pen", "user_round_plus", "user_round_search", "user_round_x", @@ -1472,14 +1588,16 @@ LUCIDE_ICON_LIST = [ "videotape", "view", "voicemail", + "volleyball", "volume", "volume_1", "volume_2", + "volume_off", "volume_x", "vote", "wallet", - "wallet_minimal", "wallet_cards", + "wallet_minimal", "wallpaper", "wand", "wand_sparkles", @@ -1487,17 +1605,22 @@ LUCIDE_ICON_LIST = [ "washing_machine", "watch", "waves", + "waves_ladder", "waypoints", "webcam", - "webhook_off", "webhook", + "webhook_off", "weight", "wheat", "wheat_off", "whole_word", "wifi", + "wifi_high", + "wifi_low", "wifi_off", + "wifi_zero", "wind", + "wind_arrow_down", "wine", "wine_off", "workflow", diff --git a/reflex/components/lucide/icon.pyi b/reflex/components/lucide/icon.pyi index 7f59edec5..61697aa2a 100644 --- a/reflex/components/lucide/icon.pyi +++ b/reflex/components/lucide/icon.pyi @@ -154,6 +154,7 @@ LUCIDE_ICON_LIST = [ "ambulance", "ampersand", "ampersands", + "amphora", "anchor", "angry", "annoyed", @@ -241,6 +242,7 @@ LUCIDE_ICON_LIST = [ "baggage_claim", "ban", "banana", + "bandage", "banknote", "bar_chart", "bar_chart_2", @@ -278,8 +280,10 @@ LUCIDE_ICON_LIST = [ "between_horizontal_start", "between_vertical_end", "between_vertical_start", + "biceps_flexed", "bike", "binary", + "binoculars", "biohazard", "bird", "bitcoin", @@ -326,6 +330,7 @@ LUCIDE_ICON_LIST = [ "boom_box", "bot", "bot_message_square", + "bot_off", "box", "box_select", "boxes", @@ -337,6 +342,7 @@ LUCIDE_ICON_LIST = [ "brick_wall", "briefcase", "briefcase_business", + "briefcase_conveyor_belt", "briefcase_medical", "bring_to_front", "brush", @@ -353,9 +359,13 @@ LUCIDE_ICON_LIST = [ "cake_slice", "calculator", "calendar", + "calendar_1", + "calendar_arrow_down", + "calendar_arrow_up", "calendar_check", "calendar_check_2", "calendar_clock", + "calendar_cog", "calendar_days", "calendar_fold", "calendar_heart", @@ -366,6 +376,7 @@ LUCIDE_ICON_LIST = [ "calendar_plus_2", "calendar_range", "calendar_search", + "calendar_sync", "calendar_x", "calendar_x_2", "camera", @@ -390,6 +401,29 @@ LUCIDE_ICON_LIST = [ "castle", "cat", "cctv", + "chart_area", + "chart_bar", + "chart_bar_big", + "chart_bar_decreasing", + "chart_bar_increasing", + "chart_bar_stacked", + "chart_candlestick", + "chart_column", + "chart_column_big", + "chart_column_decreasing", + "chart_column_increasing", + "chart_column_stacked", + "chart_gantt", + "chart_line", + "chart_network", + "chart_no_axes_column", + "chart_no_axes_column_decreasing", + "chart_no_axes_column_increasing", + "chart_no_axes_combined", + "chart_no_axes_gantt", + "chart_pie", + "chart_scatter", + "chart_spline", "check", "check_check", "chef_hat", @@ -404,6 +438,7 @@ LUCIDE_ICON_LIST = [ "chevrons_down_up", "chevrons_left", "chevrons_left_right", + "chevrons_left_right_ellipsis", "chevrons_right", "chevrons_right_left", "chevrons_up", @@ -422,8 +457,8 @@ LUCIDE_ICON_LIST = [ "circle_arrow_out_up_right", "circle_arrow_right", "circle_arrow_up", - "circle_check_big", "circle_check", + "circle_check_big", "circle_chevron_down", "circle_chevron_left", "circle_chevron_right", @@ -435,13 +470,14 @@ LUCIDE_ICON_LIST = [ "circle_dot_dashed", "circle_ellipsis", "circle_equal", + "circle_fading_arrow_up", "circle_fading_plus", "circle_gauge", "circle_help", "circle_minus", "circle_off", - "circle_parking_off", "circle_parking", + "circle_parking_off", "circle_pause", "circle_percent", "circle_play", @@ -480,7 +516,11 @@ LUCIDE_ICON_LIST = [ "clock_7", "clock_8", "clock_9", + "clock_alert", + "clock_arrow_down", + "clock_arrow_up", "cloud", + "cloud_alert", "cloud_cog", "cloud_download", "cloud_drizzle", @@ -551,6 +591,7 @@ LUCIDE_ICON_LIST = [ "cup_soda", "currency", "cylinder", + "dam", "database", "database_backup", "database_zap", @@ -558,7 +599,9 @@ LUCIDE_ICON_LIST = [ "dessert", "diameter", "diamond", + "diamond_minus", "diamond_percent", + "diamond_plus", "dice_1", "dice_2", "dice_3", @@ -587,6 +630,7 @@ LUCIDE_ICON_LIST = [ "dribbble", "drill", "droplet", + "droplet_off", "droplets", "drum", "drumstick", @@ -602,12 +646,15 @@ LUCIDE_ICON_LIST = [ "ellipsis", "ellipsis_vertical", "equal", + "equal_approximately", "equal_not", "eraser", + "ethernet_port", "euro", "expand", "external_link", "eye", + "eye_closed", "eye_off", "facebook", "factory", @@ -627,6 +674,10 @@ LUCIDE_ICON_LIST = [ "file_bar_chart", "file_bar_chart_2", "file_box", + "file_chart_column", + "file_chart_column_increasing", + "file_chart_line", + "file_chart_pie", "file_check", "file_check_2", "file_clock", @@ -668,6 +719,7 @@ LUCIDE_ICON_LIST = [ "file_type", "file_type_2", "file_up", + "file_user", "file_video", "file_video_2", "file_volume", @@ -709,6 +761,7 @@ LUCIDE_ICON_LIST = [ "folder_check", "folder_clock", "folder_closed", + "folder_code", "folder_cog", "folder_dot", "folder_down", @@ -781,7 +834,12 @@ LUCIDE_ICON_LIST = [ "graduation_cap", "grape", "grid_2x2", + "grid_2x_2", + "grid_2x_2_check", + "grid_2x_2_plus", + "grid_2x_2_x", "grid_3x3", + "grid_3x_3", "grip", "grip_horizontal", "grip_vertical", @@ -810,6 +868,7 @@ LUCIDE_ICON_LIST = [ "heading_4", "heading_5", "heading_6", + "headphone_off", "headphones", "headset", "heart", @@ -827,14 +886,20 @@ LUCIDE_ICON_LIST = [ "hospital", "hotel", "hourglass", + "house", + "house_plug", + "house_plus", "ice_cream_bowl", "ice_cream_cone", + "id_card", "image", "image_down", "image_minus", "image_off", + "image_play", "image_plus", "image_up", + "image_upscale", "images", "import", "inbox", @@ -856,6 +921,7 @@ LUCIDE_ICON_LIST = [ "key_square", "keyboard", "keyboard_music", + "keyboard_off", "lamp", "lamp_ceiling", "lamp_desk", @@ -865,8 +931,9 @@ LUCIDE_ICON_LIST = [ "land_plot", "landmark", "languages", - "laptop_minimal", "laptop", + "laptop_minimal", + "laptop_minimal_check", "lasso", "lasso_select", "laugh", @@ -881,6 +948,8 @@ LUCIDE_ICON_LIST = [ "layout_template", "leaf", "leafy_green", + "lectern", + "letter_text", "library", "library_big", "life_buoy", @@ -893,10 +962,12 @@ LUCIDE_ICON_LIST = [ "link_2_off", "linkedin", "list", + "list_check", "list_checks", "list_collapse", "list_end", "list_filter", + "list_filter_plus", "list_minus", "list_music", "list_ordered", @@ -909,15 +980,17 @@ LUCIDE_ICON_LIST = [ "list_x", "loader", "loader_circle", + "loader_pinwheel", "locate", "locate_fixed", "locate_off", "lock", - "lock_keyhole_open", "lock_keyhole", + "lock_keyhole_open", "lock_open", "log_in", "log_out", + "logs", "lollipop", "luggage", "magnet", @@ -934,7 +1007,16 @@ LUCIDE_ICON_LIST = [ "mails", "map", "map_pin", + "map_pin_check", + "map_pin_check_inside", + "map_pin_house", + "map_pin_minus", + "map_pin_minus_inside", "map_pin_off", + "map_pin_plus", + "map_pin_plus_inside", + "map_pin_x", + "map_pin_x_inside", "map_pinned", "martini", "maximize", @@ -963,6 +1045,7 @@ LUCIDE_ICON_LIST = [ "message_square_diff", "message_square_dot", "message_square_heart", + "message_square_lock", "message_square_more", "message_square_off", "message_square_plus", @@ -974,8 +1057,9 @@ LUCIDE_ICON_LIST = [ "message_square_x", "messages_square", "mic", - "mic_vocal", "mic_off", + "mic_vocal", + "microchip", "microscope", "microwave", "milestone", @@ -986,6 +1070,7 @@ LUCIDE_ICON_LIST = [ "minus", "monitor", "monitor_check", + "monitor_cog", "monitor_dot", "monitor_down", "monitor_off", @@ -1001,8 +1086,10 @@ LUCIDE_ICON_LIST = [ "mountain", "mountain_snow", "mouse", + "mouse_off", "mouse_pointer", "mouse_pointer_2", + "mouse_pointer_ban", "mouse_pointer_click", "move", "move_3d", @@ -1039,10 +1126,13 @@ LUCIDE_ICON_LIST = [ "nut_off", "octagon", "octagon_alert", + "octagon_minus", "octagon_pause", "octagon_x", + "omega", "option", "orbit", + "origami", "package", "package_2", "package_check", @@ -1055,6 +1145,7 @@ LUCIDE_ICON_LIST = [ "paint_roller", "paintbrush", "paintbrush_2", + "paintbrush_vertical", "palette", "panel_bottom", "panel_bottom_close", @@ -1084,13 +1175,16 @@ LUCIDE_ICON_LIST = [ "pc_case", "pen", "pen_line", + "pen_off", "pen_tool", "pencil", "pencil_line", + "pencil_off", "pencil_ruler", "pentagon", "percent", "person_standing", + "philippine_peso", "phone", "phone_call", "phone_forwarded", @@ -1106,7 +1200,10 @@ LUCIDE_ICON_LIST = [ "pie_chart", "piggy_bank", "pilcrow", + "pilcrow_left", + "pilcrow_right", "pill", + "pill_bottle", "pin", "pin_off", "pipette", @@ -1132,6 +1229,7 @@ LUCIDE_ICON_LIST = [ "power_off", "presentation", "printer", + "printer_check", "projector", "proportions", "puzzle", @@ -1206,6 +1304,7 @@ LUCIDE_ICON_LIST = [ "satellite_dish", "save", "save_all", + "save_off", "scale", "scale_3d", "scaling", @@ -1213,7 +1312,9 @@ LUCIDE_ICON_LIST = [ "scan_barcode", "scan_eye", "scan_face", + "scan_heart", "scan_line", + "scan_qr_code", "scan_search", "scan_text", "scatter_chart", @@ -1229,6 +1330,7 @@ LUCIDE_ICON_LIST = [ "search_code", "search_slash", "search_x", + "section", "send", "send_horizontal", "send_to_back", @@ -1273,6 +1375,7 @@ LUCIDE_ICON_LIST = [ "signal_low", "signal_medium", "signal_zero", + "signature", "signpost", "signpost_big", "siren", @@ -1282,8 +1385,8 @@ LUCIDE_ICON_LIST = [ "slack", "slash", "slice", - "sliders_vertical", "sliders_horizontal", + "sliders_vertical", "smartphone", "smartphone_charging", "smartphone_nfc", @@ -1307,29 +1410,31 @@ LUCIDE_ICON_LIST = [ "sprout", "square", "square_activity", + "square_arrow_down", "square_arrow_down_left", "square_arrow_down_right", - "square_arrow_down", "square_arrow_left", "square_arrow_out_down_left", "square_arrow_out_down_right", "square_arrow_out_up_left", "square_arrow_out_up_right", "square_arrow_right", + "square_arrow_up", "square_arrow_up_left", "square_arrow_up_right", - "square_arrow_up", "square_asterisk", "square_bottom_dashed_scissors", - "square_check_big", + "square_chart_gantt", "square_check", + "square_check_big", "square_chevron_down", "square_chevron_left", "square_chevron_right", "square_chevron_up", "square_code", - "square_dashed_bottom_code", + "square_dashed", "square_dashed_bottom", + "square_dashed_bottom_code", "square_dashed_kanban", "square_dashed_mouse_pointer", "square_divide", @@ -1343,8 +1448,8 @@ LUCIDE_ICON_LIST = [ "square_menu", "square_minus", "square_mouse_pointer", - "square_parking_off", "square_parking", + "square_parking_off", "square_pen", "square_percent", "square_pi", @@ -1358,10 +1463,11 @@ LUCIDE_ICON_LIST = [ "square_slash", "square_split_horizontal", "square_split_vertical", + "square_square", "square_stack", "square_terminal", - "square_user_round", "square_user", + "square_user_round", "square_x", "squircle", "squirrel", @@ -1398,6 +1504,7 @@ LUCIDE_ICON_LIST = [ "table_cells_merge", "table_cells_split", "table_columns_split", + "table_of_contents", "table_properties", "table_rows_split", "tablet", @@ -1413,11 +1520,11 @@ LUCIDE_ICON_LIST = [ "tangent", "target", "telescope", + "tent", "tent_tree", "terminal", - "test_tube_diagonal", "test_tube", - "tent", + "test_tube_diagonal", "test_tubes", "text", "text_cursor", @@ -1438,11 +1545,14 @@ LUCIDE_ICON_LIST = [ "ticket_plus", "ticket_slash", "ticket_x", + "tickets", + "tickets_plane", "timer", "timer_off", "timer_reset", "toggle_left", "toggle_right", + "toilet", "tornado", "torus", "touchpad", @@ -1464,17 +1574,21 @@ LUCIDE_ICON_LIST = [ "trello", "trending_down", "trending_up", + "trending_up_down", "triangle", - "triangle_right", "triangle_alert", + "triangle_right", "trophy", "truck", "turtle", "tv", "tv_2", + "tv_minimal", + "tv_minimal_play", "twitch", "twitter", "type", + "type_outline", "umbrella", "umbrella_off", "underline", @@ -1485,8 +1599,8 @@ LUCIDE_ICON_LIST = [ "unfold_vertical", "ungroup", "university", - "unlink_2", "unlink", + "unlink_2", "unplug", "upload", "usb", @@ -1494,11 +1608,13 @@ LUCIDE_ICON_LIST = [ "user_check", "user_cog", "user_minus", + "user_pen", "user_plus", "user_round", "user_round_check", "user_round_cog", "user_round_minus", + "user_round_pen", "user_round_plus", "user_round_search", "user_round_x", @@ -1520,14 +1636,16 @@ LUCIDE_ICON_LIST = [ "videotape", "view", "voicemail", + "volleyball", "volume", "volume_1", "volume_2", + "volume_off", "volume_x", "vote", "wallet", - "wallet_minimal", "wallet_cards", + "wallet_minimal", "wallpaper", "wand", "wand_sparkles", @@ -1535,17 +1653,22 @@ LUCIDE_ICON_LIST = [ "washing_machine", "watch", "waves", + "waves_ladder", "waypoints", "webcam", - "webhook_off", "webhook", + "webhook_off", "weight", "wheat", "wheat_off", "whole_word", "wifi", + "wifi_high", + "wifi_low", "wifi_off", + "wifi_zero", "wind", + "wind_arrow_down", "wine", "wine_off", "workflow", diff --git a/reflex/components/markdown/markdown.py b/reflex/components/markdown/markdown.py index 376cb8bd6..7c65c0d43 100644 --- a/reflex/components/markdown/markdown.py +++ b/reflex/components/markdown/markdown.py @@ -283,7 +283,7 @@ class Markdown(Component): # Format the code to handle inline and block code. formatted_code = f""" const match = (className || '').match(/language-(?.*)/); -const {str(_LANGUAGE)} = match ? match[1] : ''; +const {_LANGUAGE!s} = match ? match[1] : ''; {codeblock_custom_code}; return inline ? ( {self.format_component("code")} @@ -340,7 +340,7 @@ const {str(_LANGUAGE)} = match ? match[1] : ''; # If the children are set as a prop, don't pass them as children. children_prop = props.pop("children", None) if children_prop is not None: - special_props.append(Var(_js_expr=f"children={{{str(children_prop)}}}")) + special_props.append(Var(_js_expr=f"children={{{children_prop!s}}}")) children = [] # Get the component. component = self.component_map[tag](*children, **props).set( @@ -420,16 +420,17 @@ const {str(_LANGUAGE)} = match ? match[1] : ''; def _get_custom_code(self) -> str | None: hooks = {} + from reflex.compiler.templates import MACROS + for _component in self.component_map.values(): comp = _component(_MOCK_ARG) - hooks.update(comp._get_all_hooks_internal()) hooks.update(comp._get_all_hooks()) - formatted_hooks = "\n".join(hooks.keys()) + formatted_hooks = MACROS.module.renderHooks(hooks) # type: ignore return f""" function {self._get_component_map_name()} () {{ {formatted_hooks} return ( - {str(LiteralVar.create(self.format_component_map()))} + {LiteralVar.create(self.format_component_map())!s} ) }} """ diff --git a/reflex/components/next/image.py b/reflex/components/next/image.py index 237c308ce..2011505d8 100644 --- a/reflex/components/next/image.py +++ b/reflex/components/next/image.py @@ -47,7 +47,7 @@ class Image(NextComponent): placeholder: Var[str] # Allows passing CSS styles to the underlying image element. - # style: Var[Any] + # style: Var[Any] #noqa: ERA001 # The loading behavior of the image. Defaults to lazy. Can hurt performance, recommended to use `priority` instead. loading: Var[Literal["lazy", "eager"]] diff --git a/reflex/components/next/image.pyi b/reflex/components/next/image.pyi index 0c1bf01f2..dd9dd38c3 100644 --- a/reflex/components/next/image.pyi +++ b/reflex/components/next/image.pyi @@ -70,7 +70,7 @@ class Image(NextComponent): quality: The quality of the optimized image, an integer between 1 and 100, where 100 is the best quality and therefore largest file size. Defaults to 75. priority: When true, the image will be considered high priority and preload. Lazy loading is automatically disabled for images using priority. placeholder: A placeholder to use while the image is loading. Possible values are blur, empty, or data:image/.... Defaults to empty. - loading: Allows passing CSS styles to the underlying image element. style: Var[Any] The loading behavior of the image. Defaults to lazy. Can hurt performance, recommended to use `priority` instead. + loading: The loading behavior of the image. Defaults to lazy. Can hurt performance, recommended to use `priority` instead. blurDataURL: A Data URL to be used as a placeholder image before the src image successfully loads. Only takes effect when combined with placeholder="blur". on_load: Fires when the image has loaded. on_error: Fires when the image has an error. diff --git a/reflex/components/plotly/plotly.py b/reflex/components/plotly/plotly.py index 2c0dccd3e..3bdef7875 100644 --- a/reflex/components/plotly/plotly.py +++ b/reflex/components/plotly/plotly.py @@ -149,10 +149,10 @@ class Plotly(NoSSRComponent): # Fired when a plot element is hovered over. on_hover: EventHandler[_event_points_data_signature] - # Fired after the plot is layed out (zoom, pan, etc). + # Fired after the plot is laid out (zoom, pan, etc). on_relayout: EventHandler[no_args_event_spec] - # Fired while the plot is being layed out. + # Fired while the plot is being laid out. on_relayouting: EventHandler[no_args_event_spec] # Fired after the plot style is changed. @@ -167,7 +167,7 @@ class Plotly(NoSSRComponent): # Fired while dragging a selection. on_selecting: EventHandler[_event_points_data_signature] - # Fired while an animation is occuring. + # Fired while an animation is occurring. on_transitioning: EventHandler[no_args_event_spec] # Fired when a transition is stopped early. @@ -270,11 +270,11 @@ const extractPoints = (points) => { tag.special_props.append( # Merge all dictionaries and spread the result over props. Var( - _js_expr=f"{{...mergician({str(figure)}," + _js_expr=f"{{...mergician({figure!s}," f"{','.join(str(md) for md in merge_dicts)})}}", ), ) else: # Spread the figure dict over props, nothing to merge. - tag.special_props.append(Var(_js_expr=f"{{...{str(figure)}}}")) + tag.special_props.append(Var(_js_expr=f"{{...{figure!s}}}")) return tag diff --git a/reflex/components/plotly/plotly.pyi b/reflex/components/plotly/plotly.pyi index 2d606b8a2..ca1ddef39 100644 --- a/reflex/components/plotly/plotly.pyi +++ b/reflex/components/plotly/plotly.pyi @@ -130,13 +130,13 @@ class Plotly(NoSSRComponent): on_deselect: Fired when a selection is cleared (via double click). on_double_click: Fired when the plot is double clicked. on_hover: Fired when a plot element is hovered over. - on_relayout: Fired after the plot is layed out (zoom, pan, etc). - on_relayouting: Fired while the plot is being layed out. + on_relayout: Fired after the plot is laid out (zoom, pan, etc). + on_relayouting: Fired while the plot is being laid out. on_restyle: Fired after the plot style is changed. on_redraw: Fired after the plot is redrawn. on_selected: Fired after selecting plot elements. on_selecting: Fired while dragging a selection. - on_transitioning: Fired while an animation is occuring. + on_transitioning: Fired while an animation is occurring. on_transition_interrupted: Fired when a transition is stopped early. on_unhover: Fired when a hovered element is no longer hovered. style: The style of the component. diff --git a/reflex/components/radix/primitives/accordion.py b/reflex/components/radix/primitives/accordion.py index 608fee69d..0ba618e21 100644 --- a/reflex/components/radix/primitives/accordion.py +++ b/reflex/components/radix/primitives/accordion.py @@ -129,7 +129,8 @@ class AccordionRoot(AccordionComponent): on_value_change: EventHandler[on_value_change] def _exclude_props(self) -> list[str]: - return super()._exclude_props() + [ + return [ + *super()._exclude_props(), "radius", "duration", "easing", diff --git a/reflex/components/radix/primitives/form.pyi b/reflex/components/radix/primitives/form.pyi index 77c8be77c..83e65a54d 100644 --- a/reflex/components/radix/primitives/form.pyi +++ b/reflex/components/radix/primitives/form.pyi @@ -160,7 +160,7 @@ class FormRoot(FormComponent, HTMLForm): reset_on_submit: If true, the form will be cleared after submit. handle_submit_unique_name: The name used to make this form's submit handler function unique. on_submit: Fired when the form is submitted - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -636,7 +636,7 @@ class Form(FormRoot): reset_on_submit: If true, the form will be cleared after submit. handle_submit_unique_name: The name used to make this form's submit handler function unique. on_submit: Fired when the form is submitted - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -769,7 +769,7 @@ class FormNamespace(ComponentNamespace): reset_on_submit: If true, the form will be cleared after submit. handle_submit_unique_name: The name used to make this form's submit handler function unique. on_submit: Fired when the form is submitted - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/primitives/slider.py b/reflex/components/radix/primitives/slider.py index 10a0079a4..68f39e32c 100644 --- a/reflex/components/radix/primitives/slider.py +++ b/reflex/components/radix/primitives/slider.py @@ -34,7 +34,7 @@ def on_value_event_spec( class SliderRoot(SliderComponent): - """The Slider component comtaining all slider parts.""" + """The Slider component containing all slider parts.""" tag = "Root" alias = "RadixSliderRoot" @@ -188,7 +188,7 @@ class Slider(ComponentNamespace): else: children = [ track, - # Foreach.create(props.get("value"), lambda e: SliderThumb.create()), # foreach doesn't render Thumbs properly + # Foreach.create(props.get("value"), lambda e: SliderThumb.create()), # foreach doesn't render Thumbs properly # noqa: ERA001 ] return SliderRoot.create(*children, **props) diff --git a/reflex/components/radix/themes/base.py b/reflex/components/radix/themes/base.py index 65a9ae835..19e805f7a 100644 --- a/reflex/components/radix/themes/base.py +++ b/reflex/components/radix/themes/base.py @@ -53,7 +53,7 @@ LiteralAccentColor = Literal[ class CommonMarginProps(Component): """Many radix-themes elements accept shorthand margin props.""" - # Margin: "0" - "9" + # Margin: "0" - "9" # noqa: ERA001 m: Var[LiteralSpacing] # Margin horizontal: "0" - "9" @@ -78,7 +78,7 @@ class CommonMarginProps(Component): class CommonPaddingProps(Component): """Many radix-themes elements accept shorthand padding props.""" - # Padding: "0" - "9" + # Padding: "0" - "9" # noqa: ERA001 p: Var[Responsive[LiteralSpacing]] # Padding horizontal: "0" - "9" @@ -139,14 +139,7 @@ class RadixThemesComponent(Component): component = super().create(*children, **props) if component.library is None: component.library = RadixThemesComponent.__fields__["library"].default - component.alias = "RadixThemes" + ( - component.tag or component.__class__.__name__ - ) - # value = props.get("value") - # if value is not None and component.alias == "RadixThemesSelect.Root": - # lv = LiteralVar.create(value) - # print(repr(lv)) - # print(f"Warning: Value {value} is not used in {component.alias}.") + component.alias = "RadixThemes" + (component.tag or type(component).__name__) return component @staticmethod @@ -268,6 +261,7 @@ class Theme(RadixThemesComponent): _js_expr="{...theme.styles.global[':root'], ...theme.styles.global.body}" ), ) + tag.remove_props("appearance") return tag diff --git a/reflex/components/radix/themes/color_mode.pyi b/reflex/components/radix/themes/color_mode.pyi index eb3c4234a..3a9347017 100644 --- a/reflex/components/radix/themes/color_mode.pyi +++ b/reflex/components/radix/themes/color_mode.pyi @@ -257,7 +257,7 @@ class ColorModeIconButton(IconButton): name: Name of the button, used when sending form data type: Type of the button (submit, reset, or button) value: Value of the button, used when sending form data - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -427,7 +427,7 @@ class ColorModeSwitch(Switch): color_scheme: Override theme color for switch high_contrast: Whether to render the switch with higher contrast color against background radius: Override theme radius for switch: "none" | "small" | "full" - on_change: Props to rename Fired when the value of the switch changes + on_change: Fired when the value of the switch changes style: The style of the component. key: A unique key for the component. id: The id for the component. diff --git a/reflex/components/radix/themes/components/alert_dialog.pyi b/reflex/components/radix/themes/components/alert_dialog.pyi index ad243df34..6188fdd45 100644 --- a/reflex/components/radix/themes/components/alert_dialog.pyi +++ b/reflex/components/radix/themes/components/alert_dialog.pyi @@ -194,7 +194,7 @@ class AlertDialogContent(elements.Div, RadixThemesComponent): on_open_auto_focus: Fired when the dialog is opened. on_close_auto_focus: Fired when the dialog is closed. on_escape_key_down: Fired when the escape key is pressed. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/components/badge.pyi b/reflex/components/radix/themes/components/badge.pyi index 3e4f19f6e..38f20efeb 100644 --- a/reflex/components/radix/themes/components/badge.pyi +++ b/reflex/components/radix/themes/components/badge.pyi @@ -164,7 +164,7 @@ class Badge(elements.Span, RadixThemesComponent): color_scheme: Color theme of the badge high_contrast: Whether to render the badge with higher contrast color against background radius: Override theme radius for badge: "none" | "small" | "medium" | "large" | "full" - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/components/button.pyi b/reflex/components/radix/themes/components/button.pyi index ea2b63fbe..cee24abc4 100644 --- a/reflex/components/radix/themes/components/button.pyi +++ b/reflex/components/radix/themes/components/button.pyi @@ -196,7 +196,7 @@ class Button(elements.Button, RadixLoadingProp, RadixThemesComponent): name: Name of the button, used when sending form data type: Type of the button (submit, reset, or button) value: Value of the button, used when sending form data - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/components/callout.pyi b/reflex/components/radix/themes/components/callout.pyi index b2643b558..2c469956f 100644 --- a/reflex/components/radix/themes/components/callout.pyi +++ b/reflex/components/radix/themes/components/callout.pyi @@ -162,7 +162,7 @@ class CalloutRoot(elements.Div, RadixThemesComponent): variant: Variant of button: "soft" | "surface" | "outline" color_scheme: Override theme color for button high_contrast: Whether to render the button with higher contrast color against background - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -251,7 +251,7 @@ class CalloutIcon(elements.Div, RadixThemesComponent): Args: *children: Child components. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -340,7 +340,7 @@ class CalloutText(elements.P, RadixThemesComponent): Args: *children: Child components. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -516,7 +516,7 @@ class Callout(CalloutRoot): variant: Variant of button: "soft" | "surface" | "outline" color_scheme: Override theme color for button high_contrast: Whether to render the button with higher contrast color against background - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -694,7 +694,7 @@ class CalloutNamespace(ComponentNamespace): variant: Variant of button: "soft" | "surface" | "outline" color_scheme: Override theme color for button high_contrast: Whether to render the button with higher contrast color against background - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/components/card.pyi b/reflex/components/radix/themes/components/card.pyi index 74b91f8ab..d8ab6c06b 100644 --- a/reflex/components/radix/themes/components/card.pyi +++ b/reflex/components/radix/themes/components/card.pyi @@ -95,7 +95,7 @@ class Card(elements.Div, RadixThemesComponent): as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. size: Card size: "1" - "5" variant: Variant of Card: "solid" | "soft" | "outline" | "ghost" - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/components/checkbox.pyi b/reflex/components/radix/themes/components/checkbox.pyi index a8ac3a0b6..fb6b51434 100644 --- a/reflex/components/radix/themes/components/checkbox.pyi +++ b/reflex/components/radix/themes/components/checkbox.pyi @@ -153,7 +153,7 @@ class Checkbox(RadixThemesComponent): required: Whether the checkbox is required name: The name of the checkbox control when submitting the form. value: The value of the checkbox control when submitting the form. - on_change: Props to rename Fired when the checkbox is checked or unchecked. + on_change: Fired when the checkbox is checked or unchecked. style: The style of the component. key: A unique key for the component. id: The id for the component. @@ -302,7 +302,7 @@ class HighLevelCheckbox(RadixThemesComponent): required: Whether the checkbox is required name: The name of the checkbox control when submitting the form. value: The value of the checkbox control when submitting the form. - on_change: Props to rename Fired when the checkbox is checked or unchecked. + on_change: Fired when the checkbox is checked or unchecked. style: The style of the component. key: A unique key for the component. id: The id for the component. @@ -449,7 +449,7 @@ class CheckboxNamespace(ComponentNamespace): required: Whether the checkbox is required name: The name of the checkbox control when submitting the form. value: The value of the checkbox control when submitting the form. - on_change: Props to rename Fired when the checkbox is checked or unchecked. + on_change: Fired when the checkbox is checked or unchecked. style: The style of the component. key: A unique key for the component. id: The id for the component. diff --git a/reflex/components/radix/themes/components/context_menu.py b/reflex/components/radix/themes/components/context_menu.py index ea4902233..f8512a902 100644 --- a/reflex/components/radix/themes/components/context_menu.py +++ b/reflex/components/radix/themes/components/context_menu.py @@ -8,6 +8,7 @@ from reflex.event import EventHandler, no_args_event_spec, passthrough_event_spe from reflex.vars.base import Var from ..base import LiteralAccentColor, RadixThemesComponent +from .checkbox import Checkbox LiteralDirType = Literal["ltr", "rtl"] @@ -232,6 +233,15 @@ class ContextMenuSeparator(RadixThemesComponent): tag = "ContextMenu.Separator" +class ContextMenuCheckbox(Checkbox): + """The component that contains the checkbox.""" + + tag = "ContextMenu.CheckboxItem" + + # Text to render as shortcut. + shortcut: Var[str] + + class ContextMenu(ComponentNamespace): """Menu representing a set of actions, displayed at the origin of a pointer right-click or long-press.""" @@ -243,6 +253,7 @@ class ContextMenu(ComponentNamespace): sub_content = staticmethod(ContextMenuSubContent.create) item = staticmethod(ContextMenuItem.create) separator = staticmethod(ContextMenuSeparator.create) + checkbox = staticmethod(ContextMenuCheckbox.create) context_menu = ContextMenu() diff --git a/reflex/components/radix/themes/components/context_menu.pyi b/reflex/components/radix/themes/components/context_menu.pyi index c5ef757d1..2d3ffbebc 100644 --- a/reflex/components/radix/themes/components/context_menu.pyi +++ b/reflex/components/radix/themes/components/context_menu.pyi @@ -12,6 +12,7 @@ from reflex.style import Style from reflex.vars.base import Var from ..base import RadixThemesComponent +from .checkbox import Checkbox LiteralDirType = Literal["ltr", "rtl"] LiteralSizeType = Literal["1", "2"] @@ -672,6 +673,159 @@ class ContextMenuSeparator(RadixThemesComponent): """ ... +class ContextMenuCheckbox(Checkbox): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + shortcut: Optional[Union[Var[str], str]] = None, + as_child: Optional[Union[Var[bool], bool]] = None, + size: Optional[ + Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], + Var[ + Union[ + Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] + ] + ], + ] + ] = None, + variant: Optional[ + Union[ + Literal["classic", "soft", "surface"], + Var[Literal["classic", "soft", "surface"]], + ] + ] = None, + color_scheme: Optional[ + Union[ + Literal[ + "amber", + "blue", + "bronze", + "brown", + "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", + "pink", + "plum", + "purple", + "red", + "ruby", + "sky", + "teal", + "tomato", + "violet", + "yellow", + ], + Var[ + Literal[ + "amber", + "blue", + "bronze", + "brown", + "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", + "pink", + "plum", + "purple", + "red", + "ruby", + "sky", + "teal", + "tomato", + "violet", + "yellow", + ] + ], + ] + ] = None, + high_contrast: Optional[Union[Var[bool], bool]] = None, + default_checked: Optional[Union[Var[bool], bool]] = None, + checked: Optional[Union[Var[bool], bool]] = None, + disabled: Optional[Union[Var[bool], bool]] = None, + required: Optional[Union[Var[bool], bool]] = None, + name: Optional[Union[Var[str], str]] = None, + value: Optional[Union[Var[str], str]] = None, + style: Optional[Style] = None, + key: Optional[Any] = None, + id: Optional[Any] = None, + class_name: Optional[Any] = None, + autofocus: Optional[bool] = None, + custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, + on_blur: Optional[EventType[[], BASE_STATE]] = None, + on_change: Optional[ + Union[EventType[[], BASE_STATE], EventType[[bool], BASE_STATE]] + ] = None, + on_click: Optional[EventType[[], BASE_STATE]] = None, + on_context_menu: Optional[EventType[[], BASE_STATE]] = None, + on_double_click: Optional[EventType[[], BASE_STATE]] = None, + on_focus: Optional[EventType[[], BASE_STATE]] = None, + on_mount: Optional[EventType[[], BASE_STATE]] = None, + on_mouse_down: Optional[EventType[[], BASE_STATE]] = None, + on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None, + on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None, + on_mouse_move: Optional[EventType[[], BASE_STATE]] = None, + on_mouse_out: Optional[EventType[[], BASE_STATE]] = None, + on_mouse_over: Optional[EventType[[], BASE_STATE]] = None, + on_mouse_up: Optional[EventType[[], BASE_STATE]] = None, + on_scroll: Optional[EventType[[], BASE_STATE]] = None, + on_unmount: Optional[EventType[[], BASE_STATE]] = None, + **props, + ) -> "ContextMenuCheckbox": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + shortcut: Text to render as shortcut. + as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. + size: Checkbox size "1" - "3" + variant: Variant of checkbox: "classic" | "surface" | "soft" + color_scheme: Override theme color for checkbox + high_contrast: Whether to render the checkbox with higher contrast color against background + default_checked: Whether the checkbox is checked by default + checked: Whether the checkbox is checked + disabled: Whether the checkbox is disabled + required: Whether the checkbox is required + name: The name of the checkbox control when submitting the form. + value: The value of the checkbox control when submitting the form. + on_change: Fired when the checkbox is checked or unchecked. + style: The style of the component. + key: A unique key for the component. + id: The id for the component. + class_name: The class name for the component. + autofocus: Whether the component should take the focus once the page is loaded + custom_attrs: custom attribute + **props: Component properties. + + Returns: + A new component instance. + """ + ... + class ContextMenu(ComponentNamespace): root = staticmethod(ContextMenuRoot.create) trigger = staticmethod(ContextMenuTrigger.create) @@ -681,5 +835,6 @@ class ContextMenu(ComponentNamespace): sub_content = staticmethod(ContextMenuSubContent.create) item = staticmethod(ContextMenuItem.create) separator = staticmethod(ContextMenuSeparator.create) + checkbox = staticmethod(ContextMenuCheckbox.create) context_menu = ContextMenu() diff --git a/reflex/components/radix/themes/components/dialog.pyi b/reflex/components/radix/themes/components/dialog.pyi index 4c3045741..b1dfc1b54 100644 --- a/reflex/components/radix/themes/components/dialog.pyi +++ b/reflex/components/radix/themes/components/dialog.pyi @@ -243,7 +243,7 @@ class DialogContent(elements.Div, RadixThemesComponent): on_escape_key_down: Fired when the escape key is pressed. on_pointer_down_outside: Fired when the pointer is down outside the dialog. on_interact_outside: Fired when the pointer interacts outside the dialog. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/components/hover_card.pyi b/reflex/components/radix/themes/components/hover_card.pyi index 4b1de0d89..d43b583c2 100644 --- a/reflex/components/radix/themes/components/hover_card.pyi +++ b/reflex/components/radix/themes/components/hover_card.pyi @@ -228,7 +228,7 @@ class HoverCardContent(elements.Div, RadixThemesComponent): sticky: The sticky behavior on the align axis. "partial" will keep the content in the boundary as long as the trigger is at least partially in the boundary whilst "always" will keep the content in the boundary regardless hide_when_detached: Whether to hide the content when the trigger becomes fully occluded. size: Hovercard size "1" - "3" - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/components/icon_button.py b/reflex/components/radix/themes/components/icon_button.py index 2a32afe3a..68c67485a 100644 --- a/reflex/components/radix/themes/components/icon_button.py +++ b/reflex/components/radix/themes/components/icon_button.py @@ -79,7 +79,7 @@ class IconButton(elements.Button, RadixLoadingProp, RadixThemesComponent): else: size_map_var = Match.create( props["size"], - *[(size, px) for size, px in RADIX_TO_LUCIDE_SIZE.items()], + *list(RADIX_TO_LUCIDE_SIZE.items()), 12, ) if not isinstance(size_map_var, Var): diff --git a/reflex/components/radix/themes/components/icon_button.pyi b/reflex/components/radix/themes/components/icon_button.pyi index e600a9bee..abf77e07b 100644 --- a/reflex/components/radix/themes/components/icon_button.pyi +++ b/reflex/components/radix/themes/components/icon_button.pyi @@ -193,7 +193,7 @@ class IconButton(elements.Button, RadixLoadingProp, RadixThemesComponent): name: Name of the button, used when sending form data type: Type of the button (submit, reset, or button) value: Value of the button, used when sending form data - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/components/inset.pyi b/reflex/components/radix/themes/components/inset.pyi index c4f07320b..f03275ec0 100644 --- a/reflex/components/radix/themes/components/inset.pyi +++ b/reflex/components/radix/themes/components/inset.pyi @@ -166,7 +166,7 @@ class Inset(elements.Div, RadixThemesComponent): pr: Padding on the right pb: Padding on the bottom pl: Padding on the left - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/components/popover.pyi b/reflex/components/radix/themes/components/popover.pyi index d4b324817..51f114dd2 100644 --- a/reflex/components/radix/themes/components/popover.pyi +++ b/reflex/components/radix/themes/components/popover.pyi @@ -233,7 +233,7 @@ class PopoverContent(elements.Div, RadixThemesComponent): on_pointer_down_outside: Fired when the pointer is down outside the dialog. on_focus_outside: Fired when focus moves outside the dialog. on_interact_outside: Fired when the pointer interacts outside the dialog. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/components/radio_group.py b/reflex/components/radix/themes/components/radio_group.py index dc9c11f5a..80b3ee10c 100644 --- a/reflex/components/radix/themes/components/radio_group.py +++ b/reflex/components/radix/themes/components/radio_group.py @@ -140,10 +140,8 @@ class HighLevelRadioGroup(RadixThemesComponent): color_scheme = props.pop("color_scheme", None) default_value = props.pop("default_value", "") - if ( - not isinstance(items, (list, Var)) - or isinstance(items, Var) - and not types._issubclass(items._var_type, list) + if not isinstance(items, (list, Var)) or ( + isinstance(items, Var) and not types._issubclass(items._var_type, list) ): items_type = type(items) if not isinstance(items, Var) else items._var_type raise TypeError( diff --git a/reflex/components/radix/themes/components/radio_group.pyi b/reflex/components/radix/themes/components/radio_group.pyi index f251f541f..e8e4e4254 100644 --- a/reflex/components/radix/themes/components/radio_group.pyi +++ b/reflex/components/radix/themes/components/radio_group.pyi @@ -148,7 +148,7 @@ class RadioGroupRoot(RadixThemesComponent): disabled: Whether the radio group is disabled name: The name of the group. Submitted with its owning form as part of a name/value pair. required: Whether the radio group is required - on_change: Props to rename Fired when the value of the radio group changes. + on_change: Fired when the value of the radio group changes. style: The style of the component. key: A unique key for the component. id: The id for the component. diff --git a/reflex/components/radix/themes/components/select.pyi b/reflex/components/radix/themes/components/select.pyi index 39caeef9c..a6c1ff144 100644 --- a/reflex/components/radix/themes/components/select.pyi +++ b/reflex/components/radix/themes/components/select.pyi @@ -81,7 +81,7 @@ class SelectRoot(RadixThemesComponent): name: The name of the select control when submitting the form. disabled: When True, prevents the user from interacting with select. required: When True, indicates that the user must select a value before the owning form can be submitted. - on_change: Props to rename Fired when the value of the select changes. + on_change: Fired when the value of the select changes. on_open_change: Fired when the select is opened or closed. style: The style of the component. key: A unique key for the component. @@ -732,7 +732,7 @@ class HighLevelSelect(SelectRoot): name: The name of the select control when submitting the form. disabled: When True, prevents the user from interacting with select. required: When True, indicates that the user must select a value before the owning form can be submitted. - on_change: Props to rename Fired when the value of the select changes. + on_change: Fired when the value of the select changes. on_open_change: Fired when the select is opened or closed. style: The style of the component. key: A unique key for the component. @@ -912,7 +912,7 @@ class Select(ComponentNamespace): name: The name of the select control when submitting the form. disabled: When True, prevents the user from interacting with select. required: When True, indicates that the user must select a value before the owning form can be submitted. - on_change: Props to rename Fired when the value of the select changes. + on_change: Fired when the value of the select changes. on_open_change: Fired when the select is opened or closed. style: The style of the component. key: A unique key for the component. diff --git a/reflex/components/radix/themes/components/slider.pyi b/reflex/components/radix/themes/components/slider.pyi index 972385e52..f2552fbc6 100644 --- a/reflex/components/radix/themes/components/slider.pyi +++ b/reflex/components/radix/themes/components/slider.pyi @@ -195,7 +195,7 @@ class Slider(RadixThemesComponent): step: The step value of the slider. disabled: Whether the slider is disabled orientation: The orientation of the slider. - on_change: Props to rename Fired when the value of the slider changes. + on_change: Fired when the value of the slider changes. on_value_commit: Fired when a thumb is released after being dragged. style: The style of the component. key: A unique key for the component. diff --git a/reflex/components/radix/themes/components/switch.pyi b/reflex/components/radix/themes/components/switch.pyi index 8a858040a..4aabd7da2 100644 --- a/reflex/components/radix/themes/components/switch.pyi +++ b/reflex/components/radix/themes/components/switch.pyi @@ -157,7 +157,7 @@ class Switch(RadixThemesComponent): color_scheme: Override theme color for switch high_contrast: Whether to render the switch with higher contrast color against background radius: Override theme radius for switch: "none" | "small" | "full" - on_change: Props to rename Fired when the value of the switch changes + on_change: Fired when the value of the switch changes style: The style of the component. key: A unique key for the component. id: The id for the component. diff --git a/reflex/components/radix/themes/components/table.pyi b/reflex/components/radix/themes/components/table.pyi index 9bc7bf730..99a0ba96d 100644 --- a/reflex/components/radix/themes/components/table.pyi +++ b/reflex/components/radix/themes/components/table.pyi @@ -94,7 +94,7 @@ class TableRoot(elements.Table, RadixThemesComponent): variant: The variant of the table align: Alignment of the table summary: Provides a summary of the table's purpose and structure - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -185,7 +185,7 @@ class TableHeader(elements.Thead, RadixThemesComponent): Args: *children: Child components. align: Alignment of the content within the table header - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -281,7 +281,7 @@ class TableRow(elements.Tr, RadixThemesComponent): Args: *children: Child components. align: Alignment of the content within the table row - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -395,7 +395,7 @@ class TableColumnHeaderCell(elements.Th, RadixThemesComponent): headers: IDs of the headers associated with this header cell row_span: Number of rows a header cell should span scope: Scope of the header cell (row, col, rowgroup, colgroup) - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -486,7 +486,7 @@ class TableBody(elements.Tbody, RadixThemesComponent): Args: *children: Child components. align: Alignment of the content within the table body - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -717,7 +717,7 @@ class TableCell(elements.Td, CommonPaddingProps, RadixThemesComponent): col_span: Number of columns a cell should span headers: IDs of the headers associated with this cell row_span: Number of rows a cell should span - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -957,7 +957,7 @@ class TableRowHeaderCell(elements.Th, CommonPaddingProps, RadixThemesComponent): headers: IDs of the headers associated with this header cell row_span: Number of rows a header cell should span scope: Scope of the header cell (row, col, rowgroup, colgroup) - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/components/tabs.pyi b/reflex/components/radix/themes/components/tabs.pyi index b5e7de5f4..8830c8e21 100644 --- a/reflex/components/radix/themes/components/tabs.pyi +++ b/reflex/components/radix/themes/components/tabs.pyi @@ -72,7 +72,7 @@ class TabsRoot(RadixThemesComponent): orientation: The orientation of the tabs. dir: Reading direction of the tabs. activation_mode: The mode of activation for the tabs. "automatic" will activate the tab when focused. "manual" will activate the tab when clicked. - on_change: Props to rename Fired when the value of the tabs changes. + on_change: Fired when the value of the tabs changes. style: The style of the component. key: A unique key for the component. id: The id for the component. @@ -374,7 +374,7 @@ class Tabs(ComponentNamespace): orientation: The orientation of the tabs. dir: Reading direction of the tabs. activation_mode: The mode of activation for the tabs. "automatic" will activate the tab when focused. "manual" will activate the tab when clicked. - on_change: Props to rename Fired when the value of the tabs changes. + on_change: Fired when the value of the tabs changes. style: The style of the component. key: A unique key for the component. id: The id for the component. diff --git a/reflex/components/radix/themes/components/text_area.pyi b/reflex/components/radix/themes/components/text_area.pyi index 63d474842..f0903ba98 100644 --- a/reflex/components/radix/themes/components/text_area.pyi +++ b/reflex/components/radix/themes/components/text_area.pyi @@ -239,7 +239,7 @@ class TextArea(RadixThemesComponent, elements.Textarea): on_blur: Fired when the input loses focus on_key_down: Fired when a key is pressed down on_key_up: Fired when a key is released - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/components/text_field.py b/reflex/components/radix/themes/components/text_field.py index 3dabe0936..c8bdab443 100644 --- a/reflex/components/radix/themes/components/text_field.py +++ b/reflex/components/radix/themes/components/text_field.py @@ -9,7 +9,9 @@ from reflex.components.core.breakpoints import Responsive from reflex.components.core.debounce import DebounceInput from reflex.components.el import elements from reflex.event import EventHandler, input_event, key_event +from reflex.utils.types import is_optional from reflex.vars.base import Var +from reflex.vars.number import ternary_operation from ..base import LiteralAccentColor, LiteralRadius, RadixThemesComponent @@ -17,7 +19,7 @@ LiteralTextFieldSize = Literal["1", "2", "3"] LiteralTextFieldVariant = Literal["classic", "surface", "soft"] -class TextFieldRoot(elements.Div, RadixThemesComponent): +class TextFieldRoot(elements.Input, RadixThemesComponent): """Captures user input with an optional slot for buttons and icons.""" tag = "TextField.Root" @@ -96,6 +98,19 @@ class TextFieldRoot(elements.Div, RadixThemesComponent): Returns: The component. """ + value = props.get("value") + + # React expects an empty string(instead of null) for controlled inputs. + if value is not None and is_optional( + (value_var := Var.create(value))._var_type + ): + props["value"] = ternary_operation( + (value_var != Var.create(None)) # pyright: ignore [reportGeneralTypeIssues] + & (value_var != Var(_js_expr="undefined")), + value, + Var.create(""), + ) + component = super().create(*children, **props) if props.get("value") is not None and props.get("on_change") is not None: # create a debounced input if the user requests full control to avoid typing jank diff --git a/reflex/components/radix/themes/components/text_field.pyi b/reflex/components/radix/themes/components/text_field.pyi index edce803eb..81c991899 100644 --- a/reflex/components/radix/themes/components/text_field.pyi +++ b/reflex/components/radix/themes/components/text_field.pyi @@ -17,7 +17,7 @@ from ..base import RadixThemesComponent LiteralTextFieldSize = Literal["1", "2", "3"] LiteralTextFieldVariant = Literal["classic", "surface", "soft"] -class TextFieldRoot(elements.Div, RadixThemesComponent): +class TextFieldRoot(elements.Input, RadixThemesComponent): @overload @classmethod def create( # type: ignore @@ -120,6 +120,30 @@ class TextFieldRoot(elements.Div, RadixThemesComponent): type: Optional[Union[Var[str], str]] = None, value: Optional[Union[Var[Union[float, int, str]], float, int, str]] = None, list: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + accept: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + alt: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + auto_focus: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + capture: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + checked: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + default_checked: Optional[Union[Var[bool], bool]] = None, + dirname: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + form: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + form_action: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + form_enc_type: Optional[ + Union[Var[Union[bool, int, str]], bool, int, str] + ] = None, + form_method: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + form_no_validate: Optional[ + Union[Var[Union[bool, int, str]], bool, int, str] + ] = None, + form_target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + max: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + min: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + multiple: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + pattern: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + src: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + step: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + use_map: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ Union[Var[Union[bool, int, str]], bool, int, str] @@ -192,12 +216,12 @@ class TextFieldRoot(elements.Div, RadixThemesComponent): Args: *children: The children of the component. - size: Text field size "1" - "3" + size: Specifies the visible width of a text control variant: Variant of text field: "classic" | "surface" | "soft" color_scheme: Override theme color for text field radius: Override theme radius for text field: "none" | "small" | "medium" | "large" | "full" auto_complete: Whether the input should have autocomplete enabled - default_value: The value of the input when initially rendered. + default_value: The initial value for a text field disabled: Disables the input max_length: Specifies the maximum number of characters allowed in the input min_length: Specifies the minimum number of characters required in the input @@ -208,12 +232,32 @@ class TextFieldRoot(elements.Div, RadixThemesComponent): type: Specifies the type of input value: Value of the input list: References a datalist for suggested options - on_change: Fired when the value of the textarea changes. - on_focus: Fired when the textarea is focused. - on_blur: Fired when the textarea is blurred. - on_key_down: Fired when a key is pressed down. - on_key_up: Fired when a key is released. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + on_change: Fired when the input value changes + on_focus: Fired when the input gains focus + on_blur: Fired when the input loses focus + on_key_down: Fired when a key is pressed down + on_key_up: Fired when a key is released + accept: Accepted types of files when the input is file type + alt: Alternate text for input type="image" + auto_focus: Automatically focuses the input when the page loads + capture: Captures media from the user (camera or microphone) + checked: Indicates whether the input is checked (for checkboxes and radio buttons) + default_checked: The initial value (for checkboxes and radio buttons) + dirname: Name part of the input to submit in 'dir' and 'name' pair when form is submitted + form: Associates the input with a form (by id) + form_action: URL to send the form data to (for type="submit" buttons) + form_enc_type: How the form data should be encoded when submitting to the server (for type="submit" buttons) + form_method: HTTP method to use for sending form data (for type="submit" buttons) + form_no_validate: Bypasses form validation when submitting (for type="submit" buttons) + form_target: Specifies where to display the response after submitting the form (for type="submit" buttons) + max: Specifies the maximum value for the input + min: Specifies the minimum value for the input + multiple: Indicates whether multiple values can be entered in an input of the type email or file + pattern: Regex pattern the input's value must match to be valid + src: URL for image inputs + step: Specifies the legal number intervals for an input + use_map: Name of the image map used with the input + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -457,6 +501,30 @@ class TextField(ComponentNamespace): type: Optional[Union[Var[str], str]] = None, value: Optional[Union[Var[Union[float, int, str]], float, int, str]] = None, list: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + accept: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + alt: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + auto_focus: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + capture: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + checked: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + default_checked: Optional[Union[Var[bool], bool]] = None, + dirname: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + form: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + form_action: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + form_enc_type: Optional[ + Union[Var[Union[bool, int, str]], bool, int, str] + ] = None, + form_method: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + form_no_validate: Optional[ + Union[Var[Union[bool, int, str]], bool, int, str] + ] = None, + form_target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + max: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + min: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + multiple: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + pattern: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + src: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + step: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + use_map: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ Union[Var[Union[bool, int, str]], bool, int, str] @@ -529,12 +597,12 @@ class TextField(ComponentNamespace): Args: *children: The children of the component. - size: Text field size "1" - "3" + size: Specifies the visible width of a text control variant: Variant of text field: "classic" | "surface" | "soft" color_scheme: Override theme color for text field radius: Override theme radius for text field: "none" | "small" | "medium" | "large" | "full" auto_complete: Whether the input should have autocomplete enabled - default_value: The value of the input when initially rendered. + default_value: The initial value for a text field disabled: Disables the input max_length: Specifies the maximum number of characters allowed in the input min_length: Specifies the minimum number of characters required in the input @@ -545,12 +613,32 @@ class TextField(ComponentNamespace): type: Specifies the type of input value: Value of the input list: References a datalist for suggested options - on_change: Fired when the value of the textarea changes. - on_focus: Fired when the textarea is focused. - on_blur: Fired when the textarea is blurred. - on_key_down: Fired when a key is pressed down. - on_key_up: Fired when a key is released. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + on_change: Fired when the input value changes + on_focus: Fired when the input gains focus + on_blur: Fired when the input loses focus + on_key_down: Fired when a key is pressed down + on_key_up: Fired when a key is released + accept: Accepted types of files when the input is file type + alt: Alternate text for input type="image" + auto_focus: Automatically focuses the input when the page loads + capture: Captures media from the user (camera or microphone) + checked: Indicates whether the input is checked (for checkboxes and radio buttons) + default_checked: The initial value (for checkboxes and radio buttons) + dirname: Name part of the input to submit in 'dir' and 'name' pair when form is submitted + form: Associates the input with a form (by id) + form_action: URL to send the form data to (for type="submit" buttons) + form_enc_type: How the form data should be encoded when submitting to the server (for type="submit" buttons) + form_method: HTTP method to use for sending form data (for type="submit" buttons) + form_no_validate: Bypasses form validation when submitting (for type="submit" buttons) + form_target: Specifies where to display the response after submitting the form (for type="submit" buttons) + max: Specifies the maximum value for the input + min: Specifies the minimum value for the input + multiple: Indicates whether multiple values can be entered in an input of the type email or file + pattern: Regex pattern the input's value must match to be valid + src: URL for image inputs + step: Specifies the legal number intervals for an input + use_map: Name of the image map used with the input + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/layout/box.pyi b/reflex/components/radix/themes/layout/box.pyi index 648995b01..416e45f3a 100644 --- a/reflex/components/radix/themes/layout/box.pyi +++ b/reflex/components/radix/themes/layout/box.pyi @@ -72,7 +72,7 @@ class Box(elements.Div, RadixThemesComponent): Args: *children: Child components. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/layout/center.pyi b/reflex/components/radix/themes/layout/center.pyi index e932be6c8..59062b293 100644 --- a/reflex/components/radix/themes/layout/center.pyi +++ b/reflex/components/radix/themes/layout/center.pyi @@ -150,12 +150,12 @@ class Center(Flex): Args: *children: Child components. as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. - direction: How child items are layed out: "row" | "column" | "row-reverse" | "column-reverse" + direction: How child items are laid out: "row" | "column" | "row-reverse" | "column-reverse" align: Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch" justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between" wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse" spacing: Gap between children: "0" - "9" - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/layout/flex.py b/reflex/components/radix/themes/layout/flex.py index 4403a9542..39982e4f4 100644 --- a/reflex/components/radix/themes/layout/flex.py +++ b/reflex/components/radix/themes/layout/flex.py @@ -22,7 +22,7 @@ class Flex(elements.Div, RadixThemesComponent): # Change the default rendered element for the one passed as a child, merging their props and behavior. as_child: Var[bool] - # How child items are layed out: "row" | "column" | "row-reverse" | "column-reverse" + # How child items are laid out: "row" | "column" | "row-reverse" | "column-reverse" direction: Var[Responsive[LiteralFlexDirection]] # Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch" diff --git a/reflex/components/radix/themes/layout/flex.pyi b/reflex/components/radix/themes/layout/flex.pyi index 8462720d0..dafa91c6c 100644 --- a/reflex/components/radix/themes/layout/flex.pyi +++ b/reflex/components/radix/themes/layout/flex.pyi @@ -153,12 +153,12 @@ class Flex(elements.Div, RadixThemesComponent): Args: *children: Child components. as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. - direction: How child items are layed out: "row" | "column" | "row-reverse" | "column-reverse" + direction: How child items are laid out: "row" | "column" | "row-reverse" | "column-reverse" align: Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch" justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between" wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse" spacing: Gap between children: "0" - "9" - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/layout/grid.py b/reflex/components/radix/themes/layout/grid.py index 3601e213a..133e19d10 100644 --- a/reflex/components/radix/themes/layout/grid.py +++ b/reflex/components/radix/themes/layout/grid.py @@ -27,7 +27,7 @@ class Grid(elements.Div, RadixThemesComponent): # Number of rows rows: Var[Responsive[str]] - # How the grid items are layed out: "row" | "column" | "dense" | "row-dense" | "column-dense" + # How the grid items are laid out: "row" | "column" | "dense" | "row-dense" | "column-dense" flow: Var[Responsive[LiteralGridFlow]] # Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch" diff --git a/reflex/components/radix/themes/layout/grid.pyi b/reflex/components/radix/themes/layout/grid.pyi index 0f4be760f..55153fca3 100644 --- a/reflex/components/radix/themes/layout/grid.pyi +++ b/reflex/components/radix/themes/layout/grid.pyi @@ -184,13 +184,13 @@ class Grid(elements.Div, RadixThemesComponent): as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. columns: Number of columns rows: Number of rows - flow: How the grid items are layed out: "row" | "column" | "dense" | "row-dense" | "column-dense" + flow: How the grid items are laid out: "row" | "column" | "dense" | "row-dense" | "column-dense" align: Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch" justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between" spacing: Gap between children: "0" - "9" spacing_x: Gap between children horizontal: "0" - "9" spacing_y: Gap between children vertical: "0" - "9" - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/layout/list.py b/reflex/components/radix/themes/layout/list.py index 96fa169a0..a306e19a4 100644 --- a/reflex/components/radix/themes/layout/list.py +++ b/reflex/components/radix/themes/layout/list.py @@ -64,7 +64,6 @@ class BaseList(Component, MarkdownComponentMap): Returns: The list component. - """ items = props.pop("items", None) list_style_type = props.pop("list_style_type", "none") @@ -114,7 +113,6 @@ class UnorderedList(BaseList, Ul): Returns: The list component. - """ items = props.pop("items", None) list_style_type = props.pop("list_style_type", "disc") @@ -144,7 +142,6 @@ class OrderedList(BaseList, Ol): Returns: The list component. - """ items = props.pop("items", None) list_style_type = props.pop("list_style_type", "decimal") @@ -168,7 +165,6 @@ class ListItem(Li, MarkdownComponentMap): Returns: The list item component. - """ for child in children: if isinstance(child, Text): diff --git a/reflex/components/radix/themes/layout/list.pyi b/reflex/components/radix/themes/layout/list.pyi index b42f689b9..8517a6897 100644 --- a/reflex/components/radix/themes/layout/list.pyi +++ b/reflex/components/radix/themes/layout/list.pyi @@ -118,7 +118,6 @@ class BaseList(Component, MarkdownComponentMap): Returns: The list component. - """ ... @@ -226,7 +225,7 @@ class UnorderedList(BaseList, Ul): *children: The children of the component. list_style_type: The style of the list. Default to "none". items: A list of items to add to the list. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -252,7 +251,6 @@ class UnorderedList(BaseList, Ul): Returns: The list component. - """ ... @@ -364,7 +362,7 @@ class OrderedList(BaseList, Ol): reversed: Reverses the order of the list. start: Specifies the start value of the first list item in an ordered list. type: Specifies the kind of marker to use in the list (letters or numbers). - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -390,7 +388,6 @@ class OrderedList(BaseList, Ol): Returns: The list component. - """ ... @@ -451,7 +448,7 @@ class ListItem(Li, MarkdownComponentMap): Args: *children: The children of the component. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -477,7 +474,6 @@ class ListItem(Li, MarkdownComponentMap): Returns: The list item component. - """ ... @@ -571,7 +567,6 @@ class List(ComponentNamespace): Returns: The list component. - """ ... diff --git a/reflex/components/radix/themes/layout/section.pyi b/reflex/components/radix/themes/layout/section.pyi index 7e909bf64..c005f273f 100644 --- a/reflex/components/radix/themes/layout/section.pyi +++ b/reflex/components/radix/themes/layout/section.pyi @@ -87,7 +87,7 @@ class Section(elements.Section, RadixThemesComponent): Args: *children: Child components. size: The size of the section: "1" - "3" (default "2") - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/layout/spacer.pyi b/reflex/components/radix/themes/layout/spacer.pyi index bd98ac656..9854aa1ba 100644 --- a/reflex/components/radix/themes/layout/spacer.pyi +++ b/reflex/components/radix/themes/layout/spacer.pyi @@ -150,12 +150,12 @@ class Spacer(Flex): Args: *children: Child components. as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. - direction: How child items are layed out: "row" | "column" | "row-reverse" | "column-reverse" + direction: How child items are laid out: "row" | "column" | "row-reverse" | "column-reverse" align: Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch" justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between" wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse" spacing: Gap between children: "0" - "9" - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/layout/stack.pyi b/reflex/components/radix/themes/layout/stack.pyi index 712e050a8..d96c72504 100644 --- a/reflex/components/radix/themes/layout/stack.pyi +++ b/reflex/components/radix/themes/layout/stack.pyi @@ -126,10 +126,10 @@ class Stack(Flex): spacing: Gap between children: "0" - "9" align: Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch" as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. - direction: How child items are layed out: "row" | "column" | "row-reverse" | "column-reverse" + direction: How child items are laid out: "row" | "column" | "row-reverse" | "column-reverse" justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between" wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse" - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -258,13 +258,13 @@ class VStack(Stack): Args: *children: The children of the stack. - direction: How child items are layed out: "row" | "column" | "row-reverse" | "column-reverse" + direction: How child items are laid out: "row" | "column" | "row-reverse" | "column-reverse" spacing: Gap between children: "0" - "9" align: Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch" as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between" wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse" - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -393,13 +393,13 @@ class HStack(Stack): Args: *children: The children of the stack. - direction: How child items are layed out: "row" | "column" | "row-reverse" | "column-reverse" + direction: How child items are laid out: "row" | "column" | "row-reverse" | "column-reverse" spacing: Gap between children: "0" - "9" align: Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch" as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between" wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse" - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/typography/blockquote.pyi b/reflex/components/radix/themes/typography/blockquote.pyi index efb18a5b2..747724763 100644 --- a/reflex/components/radix/themes/typography/blockquote.pyi +++ b/reflex/components/radix/themes/typography/blockquote.pyi @@ -168,7 +168,7 @@ class Blockquote(elements.Blockquote, RadixThemesComponent): color_scheme: Overrides the accent color inherited from the Theme. high_contrast: Whether to render the text with higher contrast color cite: Define the title of a work. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/typography/code.pyi b/reflex/components/radix/themes/typography/code.pyi index 0276eb982..847df267c 100644 --- a/reflex/components/radix/themes/typography/code.pyi +++ b/reflex/components/radix/themes/typography/code.pyi @@ -174,7 +174,7 @@ class Code(elements.Code, RadixThemesComponent, MarkdownComponentMap): weight: Thickness of text: "light" | "regular" | "medium" | "bold" color_scheme: Overrides the accent color inherited from the Theme. high_contrast: Whether to render the text with higher contrast color - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/typography/heading.pyi b/reflex/components/radix/themes/typography/heading.pyi index b5cb5c9d3..4a1e30dbf 100644 --- a/reflex/components/radix/themes/typography/heading.pyi +++ b/reflex/components/radix/themes/typography/heading.pyi @@ -197,7 +197,7 @@ class Heading(elements.H1, RadixThemesComponent, MarkdownComponentMap): trim: Removes the leading trim space: "normal" | "start" | "end" | "both" color_scheme: Overrides the accent color inherited from the Theme. high_contrast: Whether to render the text with higher contrast color - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/typography/link.py b/reflex/components/radix/themes/typography/link.py index 1cc673536..c93102408 100644 --- a/reflex/components/radix/themes/typography/link.py +++ b/reflex/components/radix/themes/typography/link.py @@ -76,14 +76,15 @@ class Link(RadixThemesComponent, A, MemoizationLeaf, MarkdownComponentMap): Returns: Component: The link component """ - props.setdefault(":hover", {"color": color("accent", 8)}) + props.setdefault("_hover", {"color": color("accent", 8)}) + href = props.get("href") is_external = props.pop("is_external", None) if is_external is not None: props["target"] = cond(is_external, "_blank", "") - if props.get("href") is not None: + if href is not None: if not len(children): raise ValueError("Link without a child will not display") @@ -101,6 +102,9 @@ class Link(RadixThemesComponent, A, MemoizationLeaf, MarkdownComponentMap): as_child=True, **props, ) + else: + props["href"] = "#" + return super().create(*children, **props) diff --git a/reflex/components/radix/themes/typography/link.pyi b/reflex/components/radix/themes/typography/link.pyi index db963c6df..807f8dda0 100644 --- a/reflex/components/radix/themes/typography/link.pyi +++ b/reflex/components/radix/themes/typography/link.pyi @@ -215,7 +215,7 @@ class Link(RadixThemesComponent, A, MemoizationLeaf, MarkdownComponentMap): rel: Specifies the relationship between the linked document and the current document shape: Specifies the shape of the area target: Specifies where to open the linked document - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/radix/themes/typography/text.pyi b/reflex/components/radix/themes/typography/text.pyi index 824348b42..d96b5799b 100644 --- a/reflex/components/radix/themes/typography/text.pyi +++ b/reflex/components/radix/themes/typography/text.pyi @@ -264,7 +264,7 @@ class Text(elements.Span, RadixThemesComponent, MarkdownComponentMap): trim: Removes the leading trim space: "normal" | "start" | "end" | "both" color_scheme: Overrides the accent color inherited from the Theme. high_contrast: Whether to render the text with higher contrast color - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -521,7 +521,7 @@ class Span(Text): trim: Removes the leading trim space: "normal" | "start" | "end" | "both" color_scheme: Overrides the accent color inherited from the Theme. high_contrast: Whether to render the text with higher contrast color - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -610,7 +610,7 @@ class Em(elements.Em, RadixThemesComponent): Args: *children: Child components. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -706,7 +706,7 @@ class Kbd(elements.Kbd, RadixThemesComponent): Args: *children: Child components. size: Text size: "1" - "9" - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -797,7 +797,7 @@ class Quote(elements.Q, RadixThemesComponent): Args: *children: Child components. cite: Specifies the source URL of the quote. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -886,7 +886,7 @@ class Strong(elements.Strong, RadixThemesComponent): Args: *children: Child components. - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. @@ -1147,7 +1147,7 @@ class TextNamespace(ComponentNamespace): trim: Removes the leading trim space: "normal" | "start" | "end" | "both" color_scheme: Overrides the accent color inherited from the Theme. high_contrast: Whether to render the text with higher contrast color - access_key: Provides a hint for generating a keyboard shortcut for the current element. + access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 028bcb4e4..9f6bf672b 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -42,7 +42,7 @@ class Axis(Recharts): # The width of axis which is usually calculated internally. width: Var[Union[str, int]] - # The height of axis, which can be setted by user. + # The height of axis, which can be set by user. height: Var[Union[str, int]] # The type of axis 'number' | 'category' @@ -60,7 +60,7 @@ class Axis(Recharts): # Allow the axis has duplicated categorys or not when the type of axis is "category". Default: True allow_duplicated_category: Var[bool] - # The range of the axis. Work best in conjuction with allow_data_overflow. Default: [0, "auto"] + # The range of the axis. Work best in conjunction with allow_data_overflow. Default: [0, "auto"] domain: Var[List] # If set false, no axis line will be drawn. Default: True @@ -416,7 +416,7 @@ class Bar(Cartesian): radius: Var[Union[int, List[int]]] # The active bar is shown when a user enters a bar chart and this chart has tooltip. If set to false, no active bar will be drawn. If set to true, active bar will be drawn with the props calculated internally. If passed an object, active bar will be drawn, and the internally calculated props will be merged with the key value pairs of the passed object. - # active_bar: Var[Union[bool, Dict[str, Any]]] + # active_bar: Var[Union[bool, Dict[str, Any]]] #noqa: ERA001 # Valid children components _valid_children: List[str] = ["Cell", "LabelList", "ErrorBar"] diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 84f16661d..64921ec55 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -144,13 +144,13 @@ class Axis(Recharts): data_key: The key of data displayed in the axis. hide: If set true, the axis do not display in the chart. Default: False width: The width of axis which is usually calculated internally. - height: The height of axis, which can be setted by user. + height: The height of axis, which can be set by user. type_: The type of axis 'number' | 'category' interval: If set 0, all the ticks will be shown. If set preserveStart", "preserveEnd" or "preserveStartEnd", the ticks which is to be shown or hidden will be calculated automatically. Default: "preserveEnd" allow_decimals: Allow the ticks of Axis to be decimals or not. Default: True allow_data_overflow: When domain of the axis is specified and the type of the axis is 'number', if allowDataOverflow is set to be false, the domain will be adjusted when the minimum value of data is smaller than domain[0] or the maximum value of data is greater than domain[1] so that the axis displays all data values. If set to true, graphic elements (line, area, bars) will be clipped to conform to the specified domain. Default: False allow_duplicated_category: Allow the axis has duplicated categorys or not when the type of axis is "category". Default: True - domain: The range of the axis. Work best in conjuction with allow_data_overflow. Default: [0, "auto"] + domain: The range of the axis. Work best in conjunction with allow_data_overflow. Default: [0, "auto"] axis_line: If set false, no axis line will be drawn. Default: True mirror: If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. Default: False reversed: Reverse the ticks or not. Default: False @@ -330,13 +330,13 @@ class XAxis(Axis): data_key: The key of data displayed in the axis. hide: If set true, the axis do not display in the chart. Default: False width: The width of axis which is usually calculated internally. - height: The height of axis, which can be setted by user. + height: The height of axis, which can be set by user. type_: The type of axis 'number' | 'category' interval: If set 0, all the ticks will be shown. If set preserveStart", "preserveEnd" or "preserveStartEnd", the ticks which is to be shown or hidden will be calculated automatically. Default: "preserveEnd" allow_decimals: Allow the ticks of Axis to be decimals or not. Default: True allow_data_overflow: When domain of the axis is specified and the type of the axis is 'number', if allowDataOverflow is set to be false, the domain will be adjusted when the minimum value of data is smaller than domain[0] or the maximum value of data is greater than domain[1] so that the axis displays all data values. If set to true, graphic elements (line, area, bars) will be clipped to conform to the specified domain. Default: False allow_duplicated_category: Allow the axis has duplicated categorys or not when the type of axis is "category". Default: True - domain: The range of the axis. Work best in conjuction with allow_data_overflow. Default: [0, "auto"] + domain: The range of the axis. Work best in conjunction with allow_data_overflow. Default: [0, "auto"] axis_line: If set false, no axis line will be drawn. Default: True mirror: If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. Default: False reversed: Reverse the ticks or not. Default: False @@ -512,13 +512,13 @@ class YAxis(Axis): data_key: The key of data displayed in the axis. hide: If set true, the axis do not display in the chart. Default: False width: The width of axis which is usually calculated internally. - height: The height of axis, which can be setted by user. + height: The height of axis, which can be set by user. type_: The type of axis 'number' | 'category' interval: If set 0, all the ticks will be shown. If set preserveStart", "preserveEnd" or "preserveStartEnd", the ticks which is to be shown or hidden will be calculated automatically. Default: "preserveEnd" allow_decimals: Allow the ticks of Axis to be decimals or not. Default: True allow_data_overflow: When domain of the axis is specified and the type of the axis is 'number', if allowDataOverflow is set to be false, the domain will be adjusted when the minimum value of data is smaller than domain[0] or the maximum value of data is greater than domain[1] so that the axis displays all data values. If set to true, graphic elements (line, area, bars) will be clipped to conform to the specified domain. Default: False allow_duplicated_category: Allow the axis has duplicated categorys or not when the type of axis is "category". Default: True - domain: The range of the axis. Work best in conjuction with allow_data_overflow. Default: [0, "auto"] + domain: The range of the axis. Work best in conjunction with allow_data_overflow. Default: [0, "auto"] axis_line: If set false, no axis line will be drawn. Default: True mirror: If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. Default: False reversed: Reverse the ticks or not. Default: False diff --git a/reflex/components/recharts/charts.py b/reflex/components/recharts/charts.py index 13f125213..bbe733244 100644 --- a/reflex/components/recharts/charts.py +++ b/reflex/components/recharts/charts.py @@ -84,10 +84,10 @@ class ChartBase(RechartsCharts): cls._ensure_valid_dimension("width", width) cls._ensure_valid_dimension("height", height) - dim_props = dict( - width=width or "100%", - height=height or "100%", - ) + dim_props = { + "width": width if width is not None else "100%", + "height": height if height is not None else "100%", + } # Provide min dimensions so the graph always appears, even if the outer container is zero-size. if width is None: dim_props["min_width"] = 200 diff --git a/reflex/components/recharts/polar.py b/reflex/components/recharts/polar.py index 0aedf4893..1f4974d4c 100644 --- a/reflex/components/recharts/polar.py +++ b/reflex/components/recharts/polar.py @@ -124,7 +124,7 @@ class Radar(Recharts): # The key of a group of data which should be unique in a radar chart. data_key: Var[Union[str, int]] - # The coordinates of all the vertexes of the radar shape, like [{ x, y }]. + # The coordinates of all the vertices of the radar shape, like [{ x, y }]. points: Var[List[Dict[str, Any]]] # If false set, dots will not be drawn. Default: True @@ -136,7 +136,7 @@ class Radar(Recharts): # Fill color. Default: rx.color("accent", 3) fill: Var[str] = LiteralVar.create(Color("accent", 3)) - # opacity. Default: 0.6 + # The opacity to fill the chart. Default: 0.6 fill_opacity: Var[float] = LiteralVar.create(0.6) # The type of icon in legend. If set to 'none', no legend item will be rendered. Default: "rect" @@ -373,7 +373,7 @@ class PolarRadiusAxis(Recharts): # The count of axis ticks. Not used if 'type' is 'category'. Default: 5 tick_count: Var[int] - # If 'auto' set, the scale funtion is linear scale. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold'. Default: "auto" + # If 'auto' set, the scale function is linear scale. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold'. Default: "auto" scale: Var[LiteralScale] # Valid children components diff --git a/reflex/components/recharts/polar.pyi b/reflex/components/recharts/polar.pyi index 5ca96acb6..5388fbcf2 100644 --- a/reflex/components/recharts/polar.pyi +++ b/reflex/components/recharts/polar.pyi @@ -200,11 +200,11 @@ class Radar(Recharts): Args: *children: The children of the component. data_key: The key of a group of data which should be unique in a radar chart. - points: The coordinates of all the vertexes of the radar shape, like [{ x, y }]. + points: The coordinates of all the vertices of the radar shape, like [{ x, y }]. dot: If false set, dots will not be drawn. Default: True stroke: Stoke color. Default: rx.color("accent", 9) fill: Fill color. Default: rx.color("accent", 3) - fill_opacity: opacity. Default: 0.6 + fill_opacity: The opacity to fill the chart. Default: 0.6 legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. Default: "rect" label: If false set, labels will not be drawn. Default: True is_animation_active: If set false, animation of polygon will be disabled. Default: True in CSR, and False in SSR @@ -574,7 +574,7 @@ class PolarRadiusAxis(Recharts): axis_line: If false set, axis line will not be drawn. If true set, axis line will be drawn which have the props calculated internally. If object set, axis line will be drawn which have the props mergered by the internal calculated props and the option. Default: True tick: If false set, ticks will not be drawn. If true set, ticks will be drawn which have the props calculated internally. If object set, ticks will be drawn which have the props mergered by the internal calculated props and the option. Default: True tick_count: The count of axis ticks. Not used if 'type' is 'category'. Default: 5 - scale: If 'auto' set, the scale funtion is linear scale. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold'. Default: "auto" + scale: If 'auto' set, the scale function is linear scale. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold'. Default: "auto" domain: The domain of the polar radius axis, specifying the minimum and maximum values. Default: [0, "auto"] stroke: The stroke color of axis. Default: rx.color("gray", 10) style: The style of the component. diff --git a/reflex/components/sonner/toast.py b/reflex/components/sonner/toast.py index 8f5362dba..b978409ab 100644 --- a/reflex/components/sonner/toast.py +++ b/reflex/components/sonner/toast.py @@ -64,7 +64,7 @@ def _toast_callback_signature(toast: Var) -> list[Var]: """ return [ Var( - _js_expr=f"(() => {{let {{action, cancel, onDismiss, onAutoClose, ...rest}} = {str(toast)}; return rest}})()" + _js_expr=f"(() => {{let {{action, cancel, onDismiss, onAutoClose, ...rest}} = {toast!s}; return rest}})()" ) ] @@ -98,7 +98,7 @@ class ToastProps(PropsBase, NoExtrasAllowedProps): # TODO: fix serialization of icons for toast? (might not be possible yet) # Icon displayed in front of toast's text, aligned vertically. - # icon: Optional[Icon] = None + # icon: Optional[Icon] = None # noqa: ERA001 # TODO: fix implementation for action / cancel buttons # Renders a primary button, clicking it will close the toast. @@ -167,7 +167,7 @@ class ToastProps(PropsBase, NoExtrasAllowedProps): class Toaster(Component): """A Toaster Component for displaying toast notifications.""" - library: str = "sonner@1.5.0" + library: str = "sonner@1.7.1" tag = "Toaster" @@ -338,7 +338,7 @@ class Toaster(Component): dismiss_var_data = None if isinstance(id, Var): - dismiss = f"{toast_ref}.dismiss({str(id)})" + dismiss = f"{toast_ref}.dismiss({id!s})" dismiss_var_data = id._get_all_var_data() elif isinstance(id, str): dismiss = f"{toast_ref}.dismiss('{id}')" @@ -364,9 +364,7 @@ class Toaster(Component): return super().create(*children, **props) -# TODO: figure out why loading toast stay open forever -# def toast_loading(message: str, **kwargs): -# return _toast(message, level="loading", **kwargs) +# TODO: figure out why loading toast stay open forever when using level="loading" in toast() class ToastNamespace(ComponentNamespace): @@ -379,7 +377,6 @@ class ToastNamespace(ComponentNamespace): error = staticmethod(Toaster.toast_error) success = staticmethod(Toaster.toast_success) dismiss = staticmethod(Toaster.toast_dismiss) - # loading = staticmethod(toast_loading) __call__ = staticmethod(Toaster.send_toast) diff --git a/reflex/components/suneditor/editor.py b/reflex/components/suneditor/editor.py index 16d5689e2..d40f0e9ad 100644 --- a/reflex/components/suneditor/editor.py +++ b/reflex/components/suneditor/editor.py @@ -116,7 +116,7 @@ class Editor(NoSSRComponent): # Please refer to the library docs for this. # options: "en" | "da" | "de" | "es" | "fr" | "ja" | "ko" | "pt_br" | # "ru" | "zh_cn" | "ro" | "pl" | "ckb" | "lv" | "se" | "ua" | "he" | "it" - # default : "en" + # default: "en". lang: Var[ Union[ Literal[ @@ -172,7 +172,7 @@ class Editor(NoSSRComponent): set_options: Var[Dict] # Whether all SunEditor plugins should be loaded. - # default: True + # default: True. set_all_plugins: Var[bool] # Set the content of the editor. @@ -191,19 +191,19 @@ class Editor(NoSSRComponent): set_default_style: Var[str] # Disable the editor - # default: False + # default: False. disable: Var[bool] # Hide the editor - # default: False + # default: False. hide: Var[bool] # Hide the editor toolbar - # default: False + # default: False. hide_toolbar: Var[bool] # Disable the editor toolbar - # default: False + # default: False. disable_toolbar: Var[bool] # Fired when the editor content changes. diff --git a/reflex/components/suneditor/editor.pyi b/reflex/components/suneditor/editor.pyi index 66ab4863e..b52fd43da 100644 --- a/reflex/components/suneditor/editor.pyi +++ b/reflex/components/suneditor/editor.pyi @@ -172,7 +172,7 @@ class Editor(NoSSRComponent): Args: set_options(Optional[EditorOptions]): Configuration object to further configure the instance. - lang: Language of the editor. Alternatively to a string, a dict of your language can be passed to this prop. Please refer to the library docs for this. options: "en" | "da" | "de" | "es" | "fr" | "ja" | "ko" | "pt_br" | "ru" | "zh_cn" | "ro" | "pl" | "ckb" | "lv" | "se" | "ua" | "he" | "it" default : "en" + lang: Language of the editor. Alternatively to a string, a dict of your language can be passed to this prop. Please refer to the library docs for this. options: "en" | "da" | "de" | "es" | "fr" | "ja" | "ko" | "pt_br" | "ru" | "zh_cn" | "ro" | "pl" | "ckb" | "lv" | "se" | "ua" | "he" | "it" default: "en". name: This is used to set the HTML form name of the editor. This means on HTML form submission, it will be submitted together with contents of the editor by the name provided. default_value: Sets the default value of the editor. This is useful if you don't want the on_change method to be called on render. If you want the on_change method to be called on render please use the set_contents prop width: Sets the width of the editor. px and percentage values are accepted, eg width="100%" or width="500px" default: 100% @@ -180,14 +180,14 @@ class Editor(NoSSRComponent): placeholder: Sets the placeholder of the editor. auto_focus: Should the editor receive focus when initialized? set_options: Pass an EditorOptions instance to modify the behaviour of Editor even more. - set_all_plugins: Whether all SunEditor plugins should be loaded. default: True + set_all_plugins: Whether all SunEditor plugins should be loaded. default: True. set_contents: Set the content of the editor. Note: To set the initial contents of the editor without calling the on_change event, please use the default_value prop. set_contents is used to set the contents of the editor programmatically. You must be aware that, when the set_contents's prop changes, the on_change event is triggered. append_contents: Append editor content set_default_style: Sets the default style of the editor's edit area - disable: Disable the editor default: False - hide: Hide the editor default: False - hide_toolbar: Hide the editor toolbar default: False - disable_toolbar: Disable the editor toolbar default: False + disable: Disable the editor default: False. + hide: Hide the editor default: False. + hide_toolbar: Hide the editor toolbar default: False. + disable_toolbar: Disable the editor toolbar default: False. on_change: Fired when the editor content changes. on_input: Fired when the something is inputted in the editor. on_blur: Fired when the editor loses focus. diff --git a/reflex/config.py b/reflex/config.py index 88230cefe..87d9ce665 100644 --- a/reflex/config.py +++ b/reflex/config.py @@ -26,6 +26,7 @@ from typing import ( from typing_extensions import Annotated, get_type_hints +from reflex.utils.console import set_log_level from reflex.utils.exceptions import ConfigError, EnvironmentVarValueError from reflex.utils.types import GenericType, is_union, value_inside_optional @@ -82,7 +83,7 @@ class DBConfig(Base): ) @classmethod - def postgresql_psycopg2( + def postgresql_psycopg( cls, database: str, username: str, @@ -90,7 +91,7 @@ class DBConfig(Base): host: str | None = None, port: int | None = 5432, ) -> DBConfig: - """Create an instance with postgresql+psycopg2 engine. + """Create an instance with postgresql+psycopg engine. Args: database: Database name. @@ -103,7 +104,7 @@ class DBConfig(Base): DBConfig instance. """ return cls( - engine="postgresql+psycopg2", + engine="postgresql+psycopg", username=username, password=password, host=host, @@ -512,6 +513,9 @@ class EnvironmentVariables: # Whether to print the SQL queries if the log level is INFO or lower. SQLALCHEMY_ECHO: EnvVar[bool] = env_var(False) + # Whether to check db connections before using them. + SQLALCHEMY_POOL_PRE_PING: EnvVar[bool] = env_var(True) + # Whether to ignore the redis config error. Some redis servers only allow out-of-band configuration. REFLEX_IGNORE_REDIS_CONFIG_ERROR: EnvVar[bool] = env_var(False) @@ -568,6 +572,10 @@ class EnvironmentVariables: environment = EnvironmentVariables() +# These vars are not logged because they may contain sensitive information. +_sensitive_env_vars = {"DB_URL", "ASYNC_DB_URL", "REDIS_URL"} + + class Config(Base): """The config defines runtime settings for the app. @@ -592,6 +600,7 @@ class Config(Base): class Config: """Pydantic config for the config.""" + use_enum_values = False validate_assignment = True # The name of the app (should match the name of the app directory). @@ -621,6 +630,9 @@ class Config(Base): # The database url used by rx.Model. db_url: Optional[str] = "sqlite:///reflex.db" + # The async database url used by rx.Model. + async_db_url: Optional[str] = None + # The redis url redis_url: Optional[str] = None @@ -652,9 +664,9 @@ class Config(Base): frontend_packages: List[str] = [] # The hosting service backend URL. - cp_backend_url: str = Hosting.CP_BACKEND_URL + cp_backend_url: str = Hosting.HOSTING_SERVICE # The hosting service frontend URL. - cp_web_url: str = Hosting.CP_WEB_URL + cp_web_url: str = Hosting.HOSTING_SERVICE_UI # The worker class used in production mode gunicorn_worker_class: str = "uvicorn.workers.UvicornH11Worker" @@ -674,6 +686,9 @@ class Config(Base): # Maximum expiration lock time for redis state manager redis_lock_expiration: int = constants.Expiration.LOCK + # Maximum lock time before warning for redis state manager. + redis_lock_warning_threshold: int = constants.Expiration.LOCK_WARNING_THRESHOLD + # Token expiration time for redis state manager redis_token_expiration: int = constants.Expiration.TOKEN @@ -705,6 +720,9 @@ class Config(Base): self._non_default_attributes.update(kwargs) self._replace_defaults(**kwargs) + # Set the log level for this process + set_log_level(self.loglevel) + if ( self.state_manager_mode == constants.StateManagerMode.REDIS and not self.redis_url @@ -748,18 +766,20 @@ class Config(Base): # If the env var is set, override the config value. if env_var is not None: - if key.upper() != "DB_URL": - console.info( - f"Overriding config value {key} with env var {key.upper()}={env_var}", - dedupe=True, - ) - # Interpret the value. value = interpret_env_var_value(env_var, field.outer_type_, field.name) # Set the value. updated_values[key] = value + if key.upper() in _sensitive_env_vars: + env_var = "***" + + console.info( + f"Overriding config value {key} with env var {key.upper()}={env_var}", + dedupe=True, + ) + return updated_values def get_event_namespace(self) -> str: @@ -858,7 +878,7 @@ def get_config(reload: bool = False) -> Config: with _config_lock: sys_path = sys.path.copy() sys.path.clear() - sys.path.append(os.getcwd()) + sys.path.append(str(Path.cwd())) try: # Try to import the module with only the current directory in the path. return _get_config() diff --git a/reflex/constants/base.py b/reflex/constants/base.py index 512c52ade..c1eca8ce6 100644 --- a/reflex/constants/base.py +++ b/reflex/constants/base.py @@ -27,7 +27,7 @@ class Dirs(SimpleNamespace): UPLOADED_FILES = "uploaded_files" # The name of the assets directory. APP_ASSETS = "assets" - # The name of the assets directory for external ressource (a subfolder of APP_ASSETS). + # The name of the assets directory for external resources (a subfolder of APP_ASSETS). EXTERNAL_APP_ASSETS = "external" # The name of the utils file. UTILS = "utils" diff --git a/reflex/constants/compiler.py b/reflex/constants/compiler.py index b7ffef161..d98c04d76 100644 --- a/reflex/constants/compiler.py +++ b/reflex/constants/compiler.py @@ -132,6 +132,13 @@ class Hooks(SimpleNamespace): } })""" + class HookPosition(enum.Enum): + """The position of the hook in the component.""" + + INTERNAL = "internal" + PRE_TRIGGER = "pre_trigger" + POST_TRIGGER = "post_trigger" + class MemoizationDisposition(enum.Enum): """The conditions under which a component should be memoized.""" diff --git a/reflex/constants/config.py b/reflex/constants/config.py index 970e67844..7425fd864 100644 --- a/reflex/constants/config.py +++ b/reflex/constants/config.py @@ -29,6 +29,8 @@ class Expiration(SimpleNamespace): LOCK = 10000 # The PING timeout PING = 120 + # The maximum time in milliseconds to hold a lock before throwing a warning. + LOCK_WARNING_THRESHOLD = 1000 class GitIgnore(SimpleNamespace): diff --git a/reflex/constants/custom_components.py b/reflex/constants/custom_components.py index d879a01f2..a499327b1 100644 --- a/reflex/constants/custom_components.py +++ b/reflex/constants/custom_components.py @@ -10,7 +10,7 @@ class CustomComponents(SimpleNamespace): """Constants for the custom components.""" # The name of the custom components source directory. - SRC_DIR = "custom_components" + SRC_DIR = Path("custom_components") # The name of the custom components pyproject.toml file. PYPROJECT_TOML = Path("pyproject.toml") # The name of the custom components package README file. diff --git a/reflex/constants/route.py b/reflex/constants/route.py index 2af2f33c6..ab00fab15 100644 --- a/reflex/constants/route.py +++ b/reflex/constants/route.py @@ -31,7 +31,7 @@ class RouteVar(SimpleNamespace): # This subset of router_data is included in chained on_load events. -ROUTER_DATA_INCLUDE = set((RouteVar.PATH, RouteVar.ORIGIN, RouteVar.QUERY)) +ROUTER_DATA_INCLUDE = {RouteVar.PATH, RouteVar.ORIGIN, RouteVar.QUERY} class RouteRegex(SimpleNamespace): diff --git a/reflex/custom_components/custom_components.py b/reflex/custom_components/custom_components.py index 6be64ae2d..4a169802f 100644 --- a/reflex/custom_components/custom_components.py +++ b/reflex/custom_components/custom_components.py @@ -150,27 +150,27 @@ def _populate_demo_app(name_variants: NameVariants): from reflex.compiler import templates from reflex.reflex import _init - demo_app_dir = name_variants.demo_app_dir + demo_app_dir = Path(name_variants.demo_app_dir) demo_app_name = name_variants.demo_app_name - console.info(f"Creating app for testing: {demo_app_dir}") + console.info(f"Creating app for testing: {demo_app_dir!s}") - os.makedirs(demo_app_dir) + demo_app_dir.mkdir(exist_ok=True) with set_directory(demo_app_dir): # We start with the blank template as basis. _init(name=demo_app_name, template=constants.Templates.DEFAULT) # Then overwrite the app source file with the one we want for testing custom components. # This source file is rendered using jinja template file. - with open(f"{demo_app_name}/{demo_app_name}.py", "w") as f: - f.write( - templates.CUSTOM_COMPONENTS_DEMO_APP.render( - custom_component_module_dir=name_variants.custom_component_module_dir, - module_name=name_variants.module_name, - ) + demo_file = Path(f"{demo_app_name}/{demo_app_name}.py") + demo_file.write_text( + templates.CUSTOM_COMPONENTS_DEMO_APP.render( + custom_component_module_dir=name_variants.custom_component_module_dir, + module_name=name_variants.module_name, ) + ) # Append the custom component package to the requirements.txt file. - with open(f"{constants.RequirementsTxt.FILE}", "a") as f: + with Path(f"{constants.RequirementsTxt.FILE}").open(mode="a") as f: f.write(f"{name_variants.package_name}\n") @@ -296,13 +296,14 @@ def _populate_custom_component_project(name_variants: NameVariants): ) console.info( - f"Initializing the component directory: {CustomComponents.SRC_DIR}/{name_variants.custom_component_module_dir}" + f"Initializing the component directory: {CustomComponents.SRC_DIR / name_variants.custom_component_module_dir}" ) - os.makedirs(CustomComponents.SRC_DIR) + CustomComponents.SRC_DIR.mkdir(exist_ok=True) with set_directory(CustomComponents.SRC_DIR): - os.makedirs(name_variants.custom_component_module_dir) + module_dir = Path(name_variants.custom_component_module_dir) + module_dir.mkdir(exist_ok=True, parents=True) _write_source_and_init_py( - custom_component_src_dir=name_variants.custom_component_module_dir, + custom_component_src_dir=module_dir, component_class_name=name_variants.component_class_name, module_name=name_variants.module_name, ) @@ -814,7 +815,7 @@ def _validate_project_info(): ) pyproject_toml["project"] = project try: - with open(CustomComponents.PYPROJECT_TOML, "w") as f: + with CustomComponents.PYPROJECT_TOML.open("w") as f: tomlkit.dump(pyproject_toml, f) except (OSError, TOMLKitError) as ex: console.error(f"Unable to write to pyproject.toml due to {ex}") @@ -827,11 +828,11 @@ def _collect_details_for_gallery(): Raises: Exit: If pyproject.toml file is ill-formed or the request to the backend services fails. """ - from reflex.reflex import _login + from reflex_cli.utils import hosting console.rule("[bold]Authentication with Reflex Services") console.print("First let's log in to Reflex backend services.") - access_token = _login() + access_token, _ = hosting.authenticated_token() console.rule("[bold]Custom Component Information") params = {} @@ -922,16 +923,15 @@ def _validate_url_with_protocol_prefix(url: str | None) -> bool: def _get_file_from_prompt_in_loop() -> Tuple[bytes, str] | None: image_file = file_extension = None while image_file is None: - image_filepath = console.ask( - "Upload a preview image of your demo app (enter to skip)" + image_filepath = Path( + console.ask("Upload a preview image of your demo app (enter to skip)") ) if not image_filepath: break - file_extension = image_filepath.split(".")[-1] + file_extension = image_filepath.suffix try: - with open(image_filepath, "rb") as f: - image_file = f.read() - return image_file, file_extension + image_file = image_filepath.read_bytes() + return image_file, file_extension except OSError as ose: console.error(f"Unable to read the {file_extension} file due to {ose}") raise typer.Exit(code=1) from ose diff --git a/reflex/event.py b/reflex/event.py index 624bc1728..8b25c578b 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -25,6 +25,7 @@ from typing import ( overload, ) +import typing_extensions from typing_extensions import ( Concatenate, ParamSpec, @@ -296,7 +297,7 @@ class EventSpec(EventActionsMixin): handler: EventHandler, event_actions: Dict[str, Union[bool, int]] | None = None, client_handler_name: str = "", - args: Tuple[Tuple[Var, Var], ...] = tuple(), + args: Tuple[Tuple[Var, Var], ...] = (), ): """Initialize an EventSpec. @@ -311,7 +312,7 @@ class EventSpec(EventActionsMixin): object.__setattr__(self, "event_actions", event_actions) object.__setattr__(self, "handler", handler) object.__setattr__(self, "client_handler_name", client_handler_name) - object.__setattr__(self, "args", args or tuple()) + object.__setattr__(self, "args", args or ()) def with_args(self, args: Tuple[Tuple[Var, Var], ...]) -> EventSpec: """Copy the event spec, with updated args. @@ -349,13 +350,14 @@ class EventSpec(EventActionsMixin): # Construct the payload. values = [] - for arg in args: - try: - values.append(LiteralVar.create(arg)) - except TypeError as e: - raise EventHandlerTypeError( - f"Arguments to event handlers must be Vars or JSON-serializable. Got {arg} of type {type(arg)}." - ) from e + arg = None + try: + for arg in args: + values.append(LiteralVar.create(value=arg)) # noqa: PERF401 + except TypeError as e: + raise EventHandlerTypeError( + f"Arguments to event handlers must be Vars or JSON-serializable. Got {arg} of type {type(arg)}." + ) from e new_payload = tuple(zip(fn_args, values)) return self.with_args(self.args + new_payload) @@ -429,6 +431,96 @@ class EventChain(EventActionsMixin): invocation: Optional[Var] = dataclasses.field(default=None) + @classmethod + def create( + cls, + value: EventType, + args_spec: ArgsSpec | Sequence[ArgsSpec], + key: Optional[str] = None, + ) -> Union[EventChain, Var]: + """Create an event chain from a variety of input types. + + Args: + value: The value to create the event chain from. + args_spec: The args_spec of the event trigger being bound. + key: The key of the event trigger being bound. + + Returns: + The event chain. + + Raises: + ValueError: If the value is not a valid event chain. + """ + # If it's an event chain var, return it. + if isinstance(value, Var): + if isinstance(value, EventChainVar): + return value + elif isinstance(value, EventVar): + value = [value] + elif issubclass(value._var_type, (EventChain, EventSpec)): + return cls.create( + value=value.guess_type(), + args_spec=args_spec, + key=key, + ) + else: + raise ValueError( + f"Invalid event chain: {value!s} of type {value._var_type}" + ) + elif isinstance(value, EventChain): + # Trust that the caller knows what they're doing passing an EventChain directly + return value + + # If the input is a single event handler, wrap it in a list. + if isinstance(value, (EventHandler, EventSpec)): + value = [value] + + # If the input is a list of event handlers, create an event chain. + if isinstance(value, List): + events: List[Union[EventSpec, EventVar]] = [] + for v in value: + if isinstance(v, (EventHandler, EventSpec)): + # Call the event handler to get the event. + events.append(call_event_handler(v, args_spec, key=key)) + elif isinstance(v, Callable): + # Call the lambda to get the event chain. + result = call_event_fn(v, args_spec, key=key) + if isinstance(result, Var): + raise ValueError( + f"Invalid event chain: {v}. Cannot use a Var-returning " + "lambda inside an EventChain list." + ) + events.extend(result) + elif isinstance(v, EventVar): + events.append(v) + else: + raise ValueError(f"Invalid event: {v}") + + # If the input is a callable, create an event chain. + elif isinstance(value, Callable): + result = call_event_fn(value, args_spec, key=key) + if isinstance(result, Var): + # Recursively call this function if the lambda returned an EventChain Var. + return cls.create(value=result, args_spec=args_spec, key=key) + events = [*result] + + # Otherwise, raise an error. + else: + raise ValueError(f"Invalid event chain: {value}") + + # Add args to the event specs if necessary. + events = [ + (e.with_args(get_handler_args(e)) if isinstance(e, EventSpec) else e) + for e in events + ] + + # Return the event chain. + return cls( + events=events, + args_spec=args_spec, + event_actions={}, + ) + @dataclasses.dataclass( init=True, @@ -447,7 +539,7 @@ class JavascriptHTMLInputElement: class JavascriptInputEvent: """Interface for a Javascript InputEvent https://developer.mozilla.org/en-US/docs/Web/API/InputEvent.""" - target: JavascriptHTMLInputElement = JavascriptHTMLInputElement() + target: JavascriptHTMLInputElement = JavascriptHTMLInputElement() # noqa: RUF009 @dataclasses.dataclass( @@ -513,7 +605,7 @@ def no_args_event_spec() -> Tuple[()]: Returns: An empty tuple. """ - return tuple() # type: ignore + return () # type: ignore # These chains can be used for their side effects when no other events are desired. @@ -714,26 +806,61 @@ def server_side(name: str, sig: inspect.Signature, **kwargs) -> EventSpec: ) +@overload def redirect( path: str | Var[str], - external: Optional[bool] = False, - replace: Optional[bool] = False, + is_external: Optional[bool] = None, + replace: bool = False, +) -> EventSpec: ... + + +@overload +@typing_extensions.deprecated("`external` is deprecated use `is_external` instead") +def redirect( + path: str | Var[str], + is_external: Optional[bool] = None, + replace: bool = False, + external: Optional[bool] = None, +) -> EventSpec: ... + + +def redirect( + path: str | Var[str], + is_external: Optional[bool] = None, + replace: bool = False, + external: Optional[bool] = None, ) -> EventSpec: """Redirect to a new path. Args: path: The path to redirect to. - external: Whether to open in new tab or not. + is_external: Whether to open in new tab or not. replace: If True, the current page will not create a new history entry. + external(Deprecated): Whether to open in new tab or not. Returns: An event to redirect to the path. """ + if external is not None: + console.deprecate( + "The `external` prop in `rx.redirect`", + "use `is_external` instead.", + "0.6.6", + "0.7.0", + ) + + # is_external should take precedence over external. + is_external = ( + (False if external is None else external) + if is_external is None + else is_external + ) + return server_side( "_redirect", get_fn_signature(redirect), path=path, - external=external, + external=is_external, replace=replace, ) @@ -1063,7 +1190,7 @@ def call_function( Returns: EventSpec: An event that will execute the client side javascript. """ - callback_kwargs = {} + callback_kwargs = {"callback": None} if callback is not None: callback_kwargs = { "callback": format.format_queue_events( @@ -1101,9 +1228,7 @@ def run_script( Var(javascript_code) if isinstance(javascript_code, str) else javascript_code ) - return call_function( - ArgsFunctionOperation.create(tuple(), javascript_code), callback - ) + return call_function(ArgsFunctionOperation.create((), javascript_code), callback) def get_event(state, event): @@ -1222,7 +1347,7 @@ def call_event_handler( except TypeError: # TODO: In 0.7.0, remove this block and raise the exception # raise TypeError( - # f"Could not compare types {args_types_without_vars[i]} and {type_hints_of_provided_callback[arg]} for argument {arg} of {event_handler.fn.__qualname__} provided for {key}." + # f"Could not compare types {args_types_without_vars[i]} and {type_hints_of_provided_callback[arg]} for argument {arg} of {event_handler.fn.__qualname__} provided for {key}." # noqa: ERA001 # ) from e console.warn( f"Could not compare types {args_types_without_vars[i]} and {type_hints_of_provided_callback[arg]} for argument {arg} of {event_callback.fn.__qualname__} provided for {key}." @@ -1455,7 +1580,7 @@ def get_handler_args( """ args = inspect.getfullargspec(event_spec.handler.fn).args - return event_spec.args if len(args) > 1 else tuple() + return event_spec.args if len(args) > 1 else () def fix_events( @@ -1556,7 +1681,7 @@ class LiteralEventVar(VarOperationCall, LiteralVar, EventVar): Returns: The hash of the var. """ - return hash((self.__class__.__name__, self._js_expr)) + return hash((type(self).__name__, self._js_expr)) @classmethod def create( @@ -1620,7 +1745,7 @@ class LiteralEventChainVar(ArgsFunctionOperationBuilder, LiteralVar, EventChainV Returns: The hash of the var. """ - return hash((self.__class__.__name__, self._js_expr)) + return hash((type(self).__name__, self._js_expr)) @classmethod def create( diff --git a/reflex/experimental/client_state.py b/reflex/experimental/client_state.py index a1abce3ea..e37ceb14c 100644 --- a/reflex/experimental/client_state.py +++ b/reflex/experimental/client_state.py @@ -105,8 +105,8 @@ class ClientStateVar(Var): else: default_var = default setter_name = f"set{var_name.capitalize()}" - hooks = { - f"const [{var_name}, {setter_name}] = useState({str(default_var)})": None, + hooks: dict[str, VarData | None] = { + f"const [{var_name}, {setter_name}] = useState({default_var!s})": None, } imports = { "react": [ImportVar(tag="useState")], @@ -242,4 +242,5 @@ class ClientStateVar(Var): """ if not self._global_ref: raise ValueError("ClientStateVar must be global to push the value.") + value = Var.create(value) return run_script(f"{_client_state_ref(self._setter_name)}({value})") diff --git a/reflex/experimental/layout.py b/reflex/experimental/layout.py index d203ce714..e5a1bab04 100644 --- a/reflex/experimental/layout.py +++ b/reflex/experimental/layout.py @@ -33,12 +33,6 @@ class Sidebar(Box, MemoizationLeaf): Returns: The sidebar component. """ - # props.setdefault("border_right", f"1px solid {color('accent', 12)}") - # props.setdefault("background_color", color("accent", 1)) - # props.setdefault("width", "20vw") - # props.setdefault("height", "100vh") - # props.setdefault("position", "fixed") - return super().create( Box.create(*children, **props), # sidebar for content Box.create(width=props.get("width")), # spacer for layout diff --git a/reflex/istate/data.py b/reflex/istate/data.py index 9f6e3b3f4..987921889 100644 --- a/reflex/istate/data.py +++ b/reflex/istate/data.py @@ -26,7 +26,7 @@ class HeaderData: accept_language: str = "" def __init__(self, router_data: Optional[dict] = None): - """Initalize the HeaderData object based on router_data. + """Initialize the HeaderData object based on router_data. Args: router_data: the router_data dict. @@ -51,7 +51,7 @@ class PageData: params: dict = dataclasses.field(default_factory=dict) def __init__(self, router_data: Optional[dict] = None): - """Initalize the PageData object based on router_data. + """Initialize the PageData object based on router_data. Args: router_data: the router_data dict. @@ -91,7 +91,7 @@ class SessionData: session_id: str = "" def __init__(self, router_data: Optional[dict] = None): - """Initalize the SessionData object based on router_data. + """Initialize the SessionData object based on router_data. Args: router_data: the router_data dict. diff --git a/reflex/model.py b/reflex/model.py index 4b070ec67..295159de0 100644 --- a/reflex/model.py +++ b/reflex/model.py @@ -2,7 +2,9 @@ from __future__ import annotations +import re from collections import defaultdict +from contextlib import suppress from typing import Any, ClassVar, Optional, Type, Union import alembic.autogenerate @@ -14,6 +16,7 @@ import alembic.script import alembic.util import sqlalchemy import sqlalchemy.exc +import sqlalchemy.ext.asyncio import sqlalchemy.orm from reflex.base import Base @@ -21,6 +24,48 @@ from reflex.config import environment, get_config from reflex.utils import console from reflex.utils.compat import sqlmodel, sqlmodel_field_has_primary_key +_ENGINE: dict[str, sqlalchemy.engine.Engine] = {} +_ASYNC_ENGINE: dict[str, sqlalchemy.ext.asyncio.AsyncEngine] = {} +_AsyncSessionLocal: dict[str | None, sqlalchemy.ext.asyncio.async_sessionmaker] = {} + +# Import AsyncSession _after_ reflex.utils.compat +from sqlmodel.ext.asyncio.session import AsyncSession # noqa: E402 + + +def _safe_db_url_for_logging(url: str) -> str: + """Remove username and password from the database URL for logging. + + Args: + url: The database URL. + + Returns: + The database URL with the username and password removed. + """ + return re.sub(r"://[^@]+@", "://:@", url) + + +def get_engine_args(url: str | None = None) -> dict[str, Any]: + """Get the database engine arguments. + + Args: + url: The database url. + + Returns: + The database engine arguments as a dict. + """ + kwargs: dict[str, Any] = { + # Print the SQL queries if the log level is INFO or lower. + "echo": environment.SQLALCHEMY_ECHO.get(), + # Check connections before returning them. + "pool_pre_ping": environment.SQLALCHEMY_POOL_PRE_PING.get(), + } + conf = get_config() + url = url or conf.db_url + if url is not None and url.startswith("sqlite"): + # Needed for the admin dash on sqlite. + kwargs["connect_args"] = {"check_same_thread": False} + return kwargs + def get_engine(url: str | None = None) -> sqlalchemy.engine.Engine: """Get the database engine. @@ -38,26 +83,71 @@ def get_engine(url: str | None = None) -> sqlalchemy.engine.Engine: url = url or conf.db_url if url is None: raise ValueError("No database url configured") + + global _ENGINE + if url in _ENGINE: + return _ENGINE[url] + if not environment.ALEMBIC_CONFIG.get().exists(): console.warn( "Database is not initialized, run [bold]reflex db init[/bold] first." ) - # Print the SQL queries if the log level is INFO or lower. - echo_db_query = environment.SQLALCHEMY_ECHO.get() - # Needed for the admin dash on sqlite. - connect_args = {"check_same_thread": False} if url.startswith("sqlite") else {} - return sqlmodel.create_engine(url, echo=echo_db_query, connect_args=connect_args) + _ENGINE[url] = sqlmodel.create_engine( + url, + **get_engine_args(url), + ) + return _ENGINE[url] -async def get_db_status() -> bool: +def get_async_engine(url: str | None) -> sqlalchemy.ext.asyncio.AsyncEngine: + """Get the async database engine. + + Args: + url: The database url. + + Returns: + The async database engine. + + Raises: + ValueError: If the async database url is None. + """ + if url is None: + conf = get_config() + url = conf.async_db_url + if url is not None and conf.db_url is not None: + async_db_url_tail = url.partition("://")[2] + db_url_tail = conf.db_url.partition("://")[2] + if async_db_url_tail != db_url_tail: + console.warn( + f"async_db_url `{_safe_db_url_for_logging(url)}` " + "should reference the same database as " + f"db_url `{_safe_db_url_for_logging(conf.db_url)}`." + ) + if url is None: + raise ValueError("No async database url configured") + + global _ASYNC_ENGINE + if url in _ASYNC_ENGINE: + return _ASYNC_ENGINE[url] + + if not environment.ALEMBIC_CONFIG.get().exists(): + console.warn( + "Database is not initialized, run [bold]reflex db init[/bold] first." + ) + _ASYNC_ENGINE[url] = sqlalchemy.ext.asyncio.create_async_engine( + url, + **get_engine_args(url), + ) + return _ASYNC_ENGINE[url] + + +async def get_db_status() -> dict[str, bool]: """Checks the status of the database connection. Attempts to connect to the database and execute a simple query to verify connectivity. Returns: - bool: The status of the database connection: - - True: The database is accessible. - - False: The database is not accessible. + The status of the database connection. """ status = True try: @@ -67,7 +157,7 @@ async def get_db_status() -> bool: except sqlalchemy.exc.OperationalError: status = False - return status + return {"db": status} SQLModelOrSqlAlchemy = Union[ @@ -199,11 +289,10 @@ class Model(Base, sqlmodel.SQLModel): # pyright: ignore [reportGeneralTypeIssue relationships = {} # SQLModel relationships do not appear in __fields__, but should be included if present. for name in self.__sqlmodel_relationships__: - try: + with suppress( + sqlalchemy.orm.exc.DetachedInstanceError # This happens when the relationship was never loaded and the session is closed. + ): relationships[name] = self._dict_recursive(getattr(self, name)) - except sqlalchemy.orm.exc.DetachedInstanceError: - # This happens when the relationship was never loaded and the session is closed. - continue return { **base_fields, **relationships, @@ -425,6 +514,32 @@ def session(url: str | None = None) -> sqlmodel.Session: return sqlmodel.Session(get_engine(url)) +def asession(url: str | None = None) -> AsyncSession: + """Get an async sqlmodel session to interact with the database. + + async with rx.asession() as asession: + ... + + Most operations against the `asession` must be awaited. + + Args: + url: The database url. + + Returns: + An async database session. + """ + global _AsyncSessionLocal + if url not in _AsyncSessionLocal: + _AsyncSessionLocal[url] = sqlalchemy.ext.asyncio.async_sessionmaker( + bind=get_async_engine(url), + class_=AsyncSession, + expire_on_commit=False, + autocommit=False, + autoflush=False, + ) + return _AsyncSessionLocal[url]() + + def sqla_session(url: str | None = None) -> sqlalchemy.orm.Session: """Get a bare sqlalchemy session to interact with the database. diff --git a/reflex/page.py b/reflex/page.py index 8cc031757..44ca6ab31 100644 --- a/reflex/page.py +++ b/reflex/page.py @@ -70,7 +70,7 @@ def get_decorated_pages(omit_implicit_routes=True) -> list[dict[str, Any]]: """Get the decorated pages. Args: - omit_implicit_routes: Whether to omit pages where the route will be implicitely guessed later. + omit_implicit_routes: Whether to omit pages where the route will be implicitly guessed later. Returns: The decorated pages. diff --git a/reflex/proxy.py b/reflex/proxy.py new file mode 100644 index 000000000..47f36c8bd --- /dev/null +++ b/reflex/proxy.py @@ -0,0 +1,119 @@ +"""Handle proxying frontend requests from the backend server.""" + +from __future__ import annotations + +import asyncio +from contextlib import asynccontextmanager +from typing import Any, AsyncGenerator +from urllib.parse import urlparse + +from fastapi import FastAPI +from starlette.types import ASGIApp, Receive, Scope, Send + +from .config import get_config +from .utils import console + +try: + import aiohttp + from asgiproxy.config import BaseURLProxyConfigMixin, ProxyConfig + from asgiproxy.context import ProxyContext + from asgiproxy.proxies.http import proxy_http + from asgiproxy.simple_proxy import make_simple_proxy_app +except ImportError: + + @asynccontextmanager + async def proxy_middleware(*args, **kwargs) -> AsyncGenerator[None, None]: + """A no-op proxy middleware for when asgiproxy is not installed. + + Args: + *args: The positional arguments. + **kwargs: The keyword arguments. + + Yields: + None + """ + yield +else: + MAX_PROXY_RETRY = 25 + + async def proxy_http_with_retry( + *, + context: ProxyContext, + scope: Scope, + receive: Receive, + send: Send, + ) -> Any: + """Proxy an HTTP request with retries. + + Args: + context: The proxy context. + scope: The request scope. + receive: The receive channel. + send: The send channel. + + Returns: + The response from `proxy_http`. + """ + for _attempt in range(MAX_PROXY_RETRY): + try: + return await proxy_http( + context=context, + scope=scope, + receive=receive, + send=send, + ) + except aiohttp.ClientError as err: # noqa: PERF203 + console.debug( + f"Retrying request {scope['path']} due to client error {err!r}." + ) + await asyncio.sleep(0.3) + except Exception as ex: + console.debug( + f"Retrying request {scope['path']} due to unhandled exception {ex!r}." + ) + await asyncio.sleep(0.3) + + def _get_proxy_app_with_context(frontend_host: str) -> tuple[ProxyContext, ASGIApp]: + """Get the proxy app with the given frontend host. + + Args: + frontend_host: The frontend host to proxy requests to. + + Returns: + The proxy context and app. + """ + + class LocalProxyConfig(BaseURLProxyConfigMixin, ProxyConfig): + upstream_base_url = frontend_host + rewrite_host_header = urlparse(upstream_base_url).netloc + + proxy_context = ProxyContext(LocalProxyConfig()) + proxy_app = make_simple_proxy_app( + proxy_context, proxy_http_handler=proxy_http_with_retry + ) + return proxy_context, proxy_app + + @asynccontextmanager + async def proxy_middleware( # pyright: ignore[reportGeneralTypeIssues] + app: FastAPI, + ) -> AsyncGenerator[None, None]: + """A middleware to proxy requests to the separate frontend server. + + The proxy is installed on the / endpoint of the FastAPI instance. + + Args: + app: The FastAPI instance. + + Yields: + None + """ + config = get_config() + backend_port = config.backend_port + frontend_host = f"http://localhost:{config.frontend_port}" + proxy_context, proxy_app = _get_proxy_app_with_context(frontend_host) + app.mount("/", proxy_app) + console.debug( + f"Proxying '/' requests on port {backend_port} to {frontend_host}" + ) + async with proxy_context: + yield diff --git a/reflex/reflex.py b/reflex/reflex.py index f71fc5f86..22fcb9fb8 100644 --- a/reflex/reflex.py +++ b/reflex/reflex.py @@ -3,14 +3,11 @@ from __future__ import annotations import atexit -import os from pathlib import Path from typing import List, Optional import typer import typer.core -from reflex_cli.deployments import deployments_cli -from reflex_cli.utils import dependency from reflex_cli.v2.deployments import check_version, hosting_cli from reflex import constants @@ -300,7 +297,7 @@ def export( True, "--frontend-only", help="Export only frontend.", show_default=False ), zip_dest_dir: str = typer.Option( - os.getcwd(), + str(Path.cwd()), help="The directory to export the zip files to.", show_default=False, ), @@ -330,47 +327,17 @@ def export( ) -def _login() -> str: - """Helper function to authenticate with Reflex hosting service.""" - from reflex_cli.utils import hosting - - access_token, invitation_code = hosting.authenticated_token() - if access_token: - console.print("You already logged in.") - return access_token - - # If not already logged in, open a browser window/tab to the login page. - access_token = hosting.authenticate_on_browser(invitation_code) - - if not access_token: - console.error("Unable to authenticate. Please try again or contact support.") - raise typer.Exit(1) - - console.print("Successfully logged in.") - return access_token - - @cli.command() -def login( - loglevel: constants.LogLevel = typer.Option( - config.loglevel, help="The log level to use." - ), -): - """Authenticate with Reflex hosting service.""" - # Set the log level. - console.set_log_level(loglevel) - - _login() - - -@cli.command() -def loginv2(loglevel: constants.LogLevel = typer.Option(config.loglevel)): - """Authenicate with experimental Reflex hosting service.""" +def login(loglevel: constants.LogLevel = typer.Option(config.loglevel)): + """Authenticate with experimental Reflex hosting service.""" from reflex_cli.v2 import cli as hosting_cli check_version() - hosting_cli.login() + validated_info = hosting_cli.login() + if validated_info is not None: + _skip_compile() # Allow running outside of an app dir + telemetry.send("login", user_uuid=validated_info.get("user_id")) @cli.command() @@ -380,31 +347,11 @@ def logout( ), ): """Log out of access to Reflex hosting service.""" - from reflex_cli.utils import hosting - - console.set_log_level(loglevel) - - hosting.log_out_on_browser() - console.debug("Deleting access token from config locally") - hosting.delete_token_from_config(include_invitation_code=True) - - -@cli.command() -def logoutv2( - loglevel: constants.LogLevel = typer.Option( - config.loglevel, help="The log level to use." - ), -): - """Log out of access to Reflex hosting service.""" - from reflex_cli.v2.utils import hosting + from reflex_cli.v2.cli import logout check_version() - console.set_log_level(loglevel) - - hosting.log_out_on_browser() - console.debug("Deleting access token from config locally") - hosting.delete_token_from_config() + logout(loglevel) # type: ignore db_cli = typer.Typer() @@ -489,12 +436,6 @@ def makemigrations( @cli.command() def deploy( - key: Optional[str] = typer.Option( - None, - "-k", - "--deployment-key", - help="The name of the deployment. Domain name safe characters only.", - ), app_name: str = typer.Option( config.app_name, "--app-name", @@ -502,134 +443,20 @@ def deploy( hidden=True, ), regions: List[str] = typer.Option( - list(), + [], "-r", "--region", - help="The regions to deploy to.", + help="The regions to deploy to. `reflex cloud regions` For multiple envs, repeat this option, e.g. --region sjc --region iad", ), envs: List[str] = typer.Option( - list(), - "--env", - help="The environment variables to set: =. For multiple envs, repeat this option, e.g. --env k1=v2 --env k2=v2.", - ), - cpus: Optional[int] = typer.Option( - None, help="The number of CPUs to allocate.", hidden=True - ), - memory_mb: Optional[int] = typer.Option( - None, help="The amount of memory to allocate.", hidden=True - ), - auto_start: Optional[bool] = typer.Option( - None, - help="Whether to auto start the instance.", - hidden=True, - ), - auto_stop: Optional[bool] = typer.Option( - None, - help="Whether to auto stop the instance.", - hidden=True, - ), - frontend_hostname: Optional[str] = typer.Option( - None, - "--frontend-hostname", - help="The hostname of the frontend.", - hidden=True, - ), - interactive: bool = typer.Option( - True, - help="Whether to list configuration options and ask for confirmation.", - ), - with_metrics: Optional[str] = typer.Option( - None, - help="Setting for metrics scraping for the deployment. Setup required in user code.", - hidden=True, - ), - with_tracing: Optional[str] = typer.Option( - None, - help="Setting to export tracing for the deployment. Setup required in user code.", - hidden=True, - ), - upload_db_file: bool = typer.Option( - False, - help="Whether to include local sqlite db files when uploading to hosting service.", - hidden=True, - ), - loglevel: constants.LogLevel = typer.Option( - config.loglevel, help="The log level to use." - ), -): - """Deploy the app to the Reflex hosting service.""" - from reflex_cli import cli as hosting_cli - - from reflex.utils import export as export_utils - from reflex.utils import prerequisites - - # Set the log level. - console.set_log_level(loglevel) - - # Only check requirements if interactive. There is user interaction for requirements update. - if interactive: - dependency.check_requirements() - - # Check if we are set up. - if prerequisites.needs_reinit(frontend=True): - _init(name=config.app_name, loglevel=loglevel) - prerequisites.check_latest_package_version(constants.ReflexHostingCLI.MODULE_NAME) - - hosting_cli.deploy( - app_name=app_name, - export_fn=lambda zip_dest_dir, - api_url, - deploy_url, - frontend, - backend, - zipping: export_utils.export( - zip_dest_dir=zip_dest_dir, - api_url=api_url, - deploy_url=deploy_url, - frontend=frontend, - backend=backend, - zipping=zipping, - loglevel=loglevel.subprocess_level(), - upload_db_file=upload_db_file, - ), - key=key, - regions=regions, - envs=envs, - cpus=cpus, - memory_mb=memory_mb, - auto_start=auto_start, - auto_stop=auto_stop, - frontend_hostname=frontend_hostname, - interactive=interactive, - with_metrics=with_metrics, - with_tracing=with_tracing, - loglevel=loglevel.subprocess_level(), - ) - - -@cli.command() -def deployv2( - app_name: str = typer.Option( - config.app_name, - "--app-name", - help="The name of the App to deploy under.", - hidden=True, - ), - regions: List[str] = typer.Option( - list(), - "-r", - "--region", - help="The regions to deploy to. `reflex apps regions` For multiple envs, repeat this option, e.g. --region sjc --region iad", - ), - envs: List[str] = typer.Option( - list(), + [], "--env", help="The environment variables to set: =. For multiple envs, repeat this option, e.g. --env k1=v2 --env k2=v2.", ), vmtype: Optional[str] = typer.Option( None, "--vmtype", - help="Vm type id. Run `reflex apps vmtypes` to get options.", + help="Vm type id. Run `reflex cloud vmtypes` to get options.", ), hostname: Optional[str] = typer.Option( None, @@ -658,10 +485,15 @@ def deployv2( "--token", help="token to use for auth", ), + config_path: Optional[str] = typer.Option( + None, + "--config", + help="path to the config file", + ), ): """Deploy the app to the Reflex hosting service.""" + from reflex_cli.utils import dependency from reflex_cli.v2 import cli as hosting_cli - from reflex_cli.v2.utils import dependency from reflex.utils import export as export_utils from reflex.utils import prerequisites @@ -671,6 +503,13 @@ def deployv2( # Set the log level. console.set_log_level(loglevel) + if not token: + # make sure user is logged in. + if interactive: + hosting_cli.login() + else: + raise SystemExit("Token is required for non-interactive mode.") + # Only check requirements if interactive. # There is user interaction for requirements update. if interactive: @@ -703,23 +542,19 @@ def deployv2( envfile=envfile, hostname=hostname, interactive=interactive, - loglevel=loglevel.subprocess_level(), + loglevel=type(loglevel).INFO, # type: ignore token=token, project=project, + config_path=config_path, ) cli.add_typer(db_cli, name="db", help="Subcommands for managing the database schema.") cli.add_typer(script_cli, name="script", help="Subcommands running helper scripts.") -cli.add_typer( - deployments_cli, - name="deployments", - help="Subcommands for managing the Deployments.", -) cli.add_typer( hosting_cli, - name="apps", - help="Subcommands for managing the Deployments.", + name="cloud", + help="Subcommands for managing the reflex cloud.", ) cli.add_typer( custom_components_cli, diff --git a/reflex/state.py b/reflex/state.py index 55f29cf45..a31aae032 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -11,6 +11,7 @@ import inspect import json import pickle import sys +import time import typing import uuid from abc import ABC, abstractmethod @@ -39,6 +40,7 @@ from typing import ( get_type_hints, ) +from redis.asyncio.client import PubSub from sqlalchemy.orm import DeclarativeBase from typing_extensions import Self @@ -69,6 +71,11 @@ try: except ModuleNotFoundError: BaseModelV1 = BaseModelV2 +try: + from pydantic.v1 import validator +except ModuleNotFoundError: + from pydantic import validator + import wrapt from redis.asyncio import Redis from redis.exceptions import ResponseError @@ -92,18 +99,22 @@ from reflex.utils.exceptions import ( DynamicRouteArgShadowsStateVar, EventHandlerShadowsBuiltInStateMethod, ImmutableStateError, + InvalidLockWarningThresholdError, InvalidStateManagerMode, LockExpiredError, ReflexRuntimeError, SetUndefinedStateVarError, StateSchemaMismatchError, + StateSerializationError, StateTooLargeError, + UnretrievableVarValueError, ) from reflex.utils.exec import is_testing_env from reflex.utils.serializers import serializer from reflex.utils.types import ( _isinstance, get_origin, + is_optional, is_union, override, value_inside_optional, @@ -133,6 +144,9 @@ HANDLED_PICKLE_ERRORS = ( ValueError, ) +# For BaseState.get_var_value +VAR_TYPE = TypeVar("VAR_TYPE") + def _no_chain_background_task( state_cls: Type["BaseState"], name: str, fn: Callable @@ -278,6 +292,22 @@ if TYPE_CHECKING: from pydantic.v1.fields import ModelField +def _unwrap_field_type(type_: Type) -> Type: + """Unwrap rx.Field type annotations. + + Args: + type_: The type to unwrap. + + Returns: + The unwrapped type. + """ + from reflex.vars import Field + + if get_origin(type_) is Field: + return get_args(type_)[0] + return type_ + + def get_var_for_field(cls: Type[BaseState], f: ModelField): """Get a Var instance for a Pydantic field. @@ -288,16 +318,12 @@ def get_var_for_field(cls: Type[BaseState], f: ModelField): Returns: The Var instance. """ - from reflex.vars import Field - field_name = format.format_state_name(cls.get_full_name()) + "." + f.name return dispatch( field_name=field_name, var_data=VarData.from_state(cls, f.name), - result_var_type=f.outer_type_ - if get_origin(f.outer_type_) is not Field - else get_args(f.outer_type_)[0], + result_var_type=_unwrap_field_type(f.outer_type_), ) @@ -415,9 +441,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): ) # Create a fresh copy of the backend variables for this instance - self._backend_vars = copy.deepcopy( - {name: item for name, item in self.backend_vars.items()} - ) + self._backend_vars = copy.deepcopy(self.backend_vars) def __repr__(self) -> str: """Get the string representation of the state. @@ -425,7 +449,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): Returns: The string representation of the state. """ - return f"{self.__class__.__name__}({self.dict()})" + return f"{type(self).__name__}({self.dict()})" @classmethod def _get_computed_vars(cls) -> list[ComputedVar]: @@ -436,7 +460,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): """ return [ v - for mixin in cls._mixins() + [cls] + for mixin in [*cls._mixins(), cls] for name, v in mixin.__dict__.items() if is_computed_var(v) and name not in cls.inherited_vars ] @@ -501,9 +525,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): cls.inherited_backend_vars = parent_state.backend_vars # Check if another substate class with the same name has already been defined. - if cls.get_name() in set( - c.get_name() for c in parent_state.class_subclasses - ): + if cls.get_name() in {c.get_name() for c in parent_state.class_subclasses}: # This should not happen, since we have added module prefix to state names in #3214 raise StateValueError( f"The substate class '{cls.get_name()}' has been defined multiple times. " @@ -766,11 +788,11 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): ) # ComputedVar with cache=False always need to be recomputed - cls._always_dirty_computed_vars = set( + cls._always_dirty_computed_vars = { cvar_name for cvar_name, cvar in cls.computed_vars.items() if not cvar._cache - ) + } # Any substate containing a ComputedVar with cache=False always needs to be recomputed if cls._always_dirty_computed_vars: @@ -1081,6 +1103,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): if ( not field.required and field.default is None + and field.default_factory is None and not types.is_optional(prop._var_type) ): # Ensure frontend uses null coalescing when accessing. @@ -1174,6 +1197,8 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): continue dynamic_vars[param] = DynamicRouteVar( fget=func, + auto_deps=False, + deps=["router"], cache=True, _js_expr=param, _var_data=VarData.from_state(cls), @@ -1221,13 +1246,16 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): if not super().__getattribute__("__dict__"): return super().__getattribute__(name) - inherited_vars = { - **super().__getattribute__("inherited_vars"), - **super().__getattribute__("inherited_backend_vars"), - } + # Fast path for dunder + if name.startswith("__"): + return super().__getattribute__(name) # For now, handle router_data updates as a special case. - if name in inherited_vars or name == constants.ROUTER_DATA: + if ( + name == constants.ROUTER_DATA + or name in super().__getattribute__("inherited_vars") + or name in super().__getattribute__("inherited_backend_vars") + ): parent_state = super().__getattribute__("parent_state") if parent_state is not None: return getattr(parent_state, name) @@ -1282,8 +1310,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): value = value.__wrapped__ # Set the var on the parent state. - inherited_vars = {**self.inherited_vars, **self.inherited_backend_vars} - if name in inherited_vars: + if name in self.inherited_vars or name in self.inherited_backend_vars: setattr(self.parent_state, name, value) return @@ -1310,8 +1337,8 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): if name in fields: field = fields[name] - field_type = field.outer_type_ - if field.allow_none: + field_type = _unwrap_field_type(field.outer_type_) + if field.allow_none and not is_optional(field_type): field_type = Union[field_type, None] if not _isinstance(value, field_type): console.deprecate( @@ -1577,6 +1604,42 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): # Slow case - fetch missing parent states from redis. return await self._get_state_from_redis(state_cls) + async def get_var_value(self, var: Var[VAR_TYPE]) -> VAR_TYPE: + """Get the value of an rx.Var from another state. + + Args: + var: The var to get the value for. + + Returns: + The value of the var. + + Raises: + UnretrievableVarValueError: If the var does not have a literal value + or associated state. + """ + # Oopsie case: you didn't give me a Var... so get what you give. + if not isinstance(var, Var): + return var # type: ignore + + # Fast case: this is a literal var and the value is known. + if hasattr(var, "_var_value"): + return var._var_value + + var_data = var._get_all_var_data() + if var_data is None or not var_data.state: + raise UnretrievableVarValueError( + f"Unable to retrieve value for {var._js_expr}: not associated with any state." + ) + # Fastish case: this var belongs to this state + if var_data.state == self.get_full_name(): + return getattr(self, var_data.field_name) + + # Slow case: this var belongs to another state + other_state = await self.get_state( + self._get_root_state().get_class_substate(var_data.state) + ) + return getattr(other_state, var_data.field_name) + def _get_event_handler( self, event: Event ) -> tuple[BaseState | StateProxy, EventHandler]: @@ -1836,11 +1899,11 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): Returns: Set of computed vars to include in the delta. """ - return set( + return { cvar for cvar in self.computed_vars if self.computed_vars[cvar].needs_update(instance=self) - ) + } def _dirty_computed_vars( self, from_vars: set[str] | None = None, include_backend: bool = True @@ -1854,12 +1917,12 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): Returns: Set of computed vars to include in the delta. """ - return set( + return { cvar for dirty_var in from_vars or self.dirty_vars for cvar in self._computed_var_dependencies[dirty_var] if include_backend or not self.computed_vars[cvar]._backend - ) + } @classmethod def _potentially_dirty_substates(cls) -> set[Type[BaseState]]: @@ -1869,16 +1932,16 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): Set of State classes that may need to be fetched to recalc computed vars. """ # _always_dirty_substates need to be fetched to recalc computed vars. - fetch_substates = set( + fetch_substates = { cls.get_class_substate((cls.get_name(), *substate_name.split("."))) for substate_name in cls._always_dirty_substates - ) + } for dependent_substates in cls._substate_var_dependencies.values(): fetch_substates.update( - set( + { cls.get_class_substate((cls.get_name(), *substate_name.split("."))) for substate_name in dependent_substates - ) + } ) return fetch_substates @@ -2105,14 +2168,26 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): state["__dict__"].pop("router", None) state["__dict__"].pop("router_data", None) # Never serialize parent_state or substates. - state["__dict__"]["parent_state"] = None - state["__dict__"]["substates"] = {} + state["__dict__"].pop("parent_state", None) + state["__dict__"].pop("substates", None) state["__dict__"].pop("_was_touched", None) # Remove all inherited vars. for inherited_var_name in self.inherited_vars: state["__dict__"].pop(inherited_var_name, None) return state + def __setstate__(self, state: dict[str, Any]): + """Set the state from redis deserialization. + + This method is called by pickle to deserialize the object. + + Args: + state: The state dict for deserialization. + """ + state["__dict__"]["parent_state"] = None + state["__dict__"]["substates"] = {} + super().__setstate__(state) + def _check_state_size( self, pickle_state_size: int, @@ -2168,7 +2243,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): return md5( pickle.dumps( - list(sorted(_field_tuple(field_name) for field_name in cls.base_vars)) + sorted(_field_tuple(field_name) for field_name in cls.base_vars) ) ).hexdigest() @@ -2177,8 +2252,12 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): Returns: The serialized state. + + Raises: + StateSerializationError: If the state cannot be serialized. """ payload = b"" + error = "" try: payload = pickle.dumps((self._to_schema(), self)) except HANDLED_PICKLE_ERRORS as og_pickle_error: @@ -2198,8 +2277,13 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): except HANDLED_PICKLE_ERRORS as ex: error += f"Dill was also unable to pickle the state: {ex}" console.warn(error) + if environment.REFLEX_PERF_MODE.get() != PerformanceMode.OFF: self._check_state_size(len(payload)) + + if not payload: + raise StateSerializationError(error) + return payload @classmethod @@ -2793,6 +2877,7 @@ class StateManager(Base, ABC): redis=redis, token_expiration=config.redis_token_expiration, lock_expiration=config.redis_lock_expiration, + lock_warning_threshold=config.redis_lock_warning_threshold, ) raise InvalidStateManagerMode( f"Expected one of: DISK, MEMORY, REDIS, got {config.state_manager_mode}" @@ -3162,6 +3247,15 @@ def _default_lock_expiration() -> int: return get_config().redis_lock_expiration +def _default_lock_warning_threshold() -> int: + """Get the default lock warning threshold. + + Returns: + The default lock warning threshold. + """ + return get_config().redis_lock_warning_threshold + + class StateManagerRedis(StateManager): """A state manager that stores states in redis.""" @@ -3174,6 +3268,11 @@ class StateManagerRedis(StateManager): # The maximum time to hold a lock (ms). lock_expiration: int = pydantic.Field(default_factory=_default_lock_expiration) + # The maximum time to hold a lock (ms) before warning. + lock_warning_threshold: int = pydantic.Field( + default_factory=_default_lock_warning_threshold + ) + # The keyspace subscription string when redis is waiting for lock to be released _redis_notify_keyspace_events: str = ( "K" # Enable keyspace notifications (target a particular key) @@ -3292,7 +3391,7 @@ class StateManagerRedis(StateManager): state_cls = self.state.get_class_substate(state_path) else: raise RuntimeError( - "StateManagerRedis requires token to be specified in the form of {token}_{state_full_name}" + f"StateManagerRedis requires token to be specified in the form of {{token}}_{{state_full_name}}, but got {token}" ) # The deserialized or newly created (sub)state instance. @@ -3361,6 +3460,17 @@ class StateManagerRedis(StateManager): f"`app.state_manager.lock_expiration` (currently {self.lock_expiration}) " "or use `@rx.event(background=True)` decorator for long-running tasks." ) + elif lock_id is not None: + time_taken = self.lock_expiration / 1000 - ( + await self.redis.ttl(self._lock_key(token)) + ) + if time_taken > self.lock_warning_threshold / 1000: + console.warn( + f"Lock for token {token} was held too long {time_taken=}s, " + f"use `@rx.event(background=True)` decorator for long-running tasks.", + dedupe=True, + ) + client_token, substate_name = _split_substate_key(token) # If the substate name on the token doesn't match the instance name, it cannot have a parent. if state.parent_state is not None and state.get_full_name() != substate_name: @@ -3369,17 +3479,16 @@ class StateManagerRedis(StateManager): ) # Recursively set_state on all known substates. - tasks = [] - for substate in state.substates.values(): - tasks.append( - asyncio.create_task( - self.set_state( - token=_substate_key(client_token, substate), - state=substate, - lock_id=lock_id, - ) + tasks = [ + asyncio.create_task( + self.set_state( + _substate_key(client_token, substate), + substate, + lock_id, ) ) + for substate in state.substates.values() + ] # Persist only the given state (parents or substates are excluded by BaseState.__getstate__). if state._get_was_touched(): pickle_state = state._serialize() @@ -3410,6 +3519,27 @@ class StateManagerRedis(StateManager): yield state await self.set_state(token, state, lock_id) + @validator("lock_warning_threshold") + @classmethod + def validate_lock_warning_threshold(cls, lock_warning_threshold: int, values): + """Validate the lock warning threshold. + + Args: + lock_warning_threshold: The lock warning threshold. + values: The validated attributes. + + Returns: + The lock warning threshold. + + Raises: + InvalidLockWarningThresholdError: If the lock warning threshold is invalid. + """ + if lock_warning_threshold >= (lock_expiration := values["lock_expiration"]): + raise InvalidLockWarningThresholdError( + f"The lock warning threshold({lock_warning_threshold}) must be less than the lock expiration time({lock_expiration})." + ) + return lock_warning_threshold + @staticmethod def _lock_key(token: str) -> bytes: """Get the redis key for a token's lock. @@ -3441,6 +3571,35 @@ class StateManagerRedis(StateManager): nx=True, # only set if it doesn't exist ) + async def _get_pubsub_message( + self, pubsub: PubSub, timeout: float | None = None + ) -> None: + """Get lock release events from the pubsub. + + Args: + pubsub: The pubsub to get a message from. + timeout: Remaining time to wait for a message. + + Returns: + The message. + """ + if timeout is None: + timeout = self.lock_expiration / 1000.0 + + started = time.time() + message = await pubsub.get_message( + ignore_subscribe_messages=True, + timeout=timeout, + ) + if ( + message is None + or message["data"] not in self._redis_keyspace_lock_release_events + ): + remaining = timeout - (time.time() - started) + if remaining <= 0: + return + await self._get_pubsub_message(pubsub, timeout=remaining) + async def _wait_lock(self, lock_key: bytes, lock_id: bytes) -> None: """Wait for a redis lock to be released via pubsub. @@ -3453,7 +3612,6 @@ class StateManagerRedis(StateManager): Raises: ResponseError: when the keyspace config cannot be set. """ - state_is_locked = False lock_key_channel = f"__keyspace@0__:{lock_key.decode()}" # Enable keyspace notifications for the lock key, so we know when it is available. try: @@ -3467,20 +3625,13 @@ class StateManagerRedis(StateManager): raise async with self.redis.pubsub() as pubsub: await pubsub.psubscribe(lock_key_channel) - while not state_is_locked: - # wait for the lock to be released - while True: - if not await self.redis.exists(lock_key): - break # key was removed, try to get the lock again - message = await pubsub.get_message( - ignore_subscribe_messages=True, - timeout=self.lock_expiration / 1000.0, - ) - if message is None: - continue - if message["data"] in self._redis_keyspace_lock_release_events: - break - state_is_locked = await self._try_get_lock(lock_key, lock_id) + # wait for the lock to be released + while True: + # fast path + if await self._try_get_lock(lock_key, lock_id): + return + # wait for lock events + await self._get_pubsub_message(pubsub) @contextlib.asynccontextmanager async def _lock(self, token: str): @@ -3538,34 +3689,34 @@ def get_state_manager() -> StateManager: class MutableProxy(wrapt.ObjectProxy): """A proxy for a mutable object that tracks changes.""" + # Hint for finding the base class of the proxy. + __base_proxy__ = "MutableProxy" + # Methods on wrapped objects which should mark the state as dirty. - __mark_dirty_attrs__ = set( - [ - "add", - "append", - "clear", - "difference_update", - "discard", - "extend", - "insert", - "intersection_update", - "pop", - "popitem", - "remove", - "reverse", - "setdefault", - "sort", - "symmetric_difference_update", - "update", - ] - ) + __mark_dirty_attrs__ = { + "add", + "append", + "clear", + "difference_update", + "discard", + "extend", + "insert", + "intersection_update", + "pop", + "popitem", + "remove", + "reverse", + "setdefault", + "sort", + "symmetric_difference_update", + "update", + } + # Methods on wrapped objects might return mutable objects that should be tracked. - __wrap_mutable_attrs__ = set( - [ - "get", - "setdefault", - ] - ) + __wrap_mutable_attrs__ = { + "get", + "setdefault", + } # These internal attributes on rx.Base should NOT be wrapped in a MutableProxy. __never_wrap_base_attrs__ = set(Base.__dict__) - {"set"} | set( @@ -3583,6 +3734,39 @@ class MutableProxy(wrapt.ObjectProxy): BaseModelV1, ) + # Dynamically generated classes for tracking dataclass mutations. + __dataclass_proxies__: Dict[type, type] = {} + + def __new__(cls, wrapped: Any, *args, **kwargs) -> MutableProxy: + """Create a proxy instance for a mutable object that tracks changes. + + Args: + wrapped: The object to proxy. + *args: Other args passed to MutableProxy (ignored). + **kwargs: Other kwargs passed to MutableProxy (ignored). + + Returns: + The proxy instance. + """ + if dataclasses.is_dataclass(wrapped): + wrapped_cls = type(wrapped) + wrapper_cls_name = wrapped_cls.__name__ + cls.__name__ + # Find the associated class + if wrapper_cls_name not in cls.__dataclass_proxies__: + # Create a new class that has the __dataclass_fields__ defined + cls.__dataclass_proxies__[wrapper_cls_name] = type( + wrapper_cls_name, + (cls,), + { + dataclasses._FIELDS: getattr( # pyright: ignore [reportGeneralTypeIssues] + wrapped_cls, + dataclasses._FIELDS, # pyright: ignore [reportGeneralTypeIssues] + ), + }, + ) + cls = cls.__dataclass_proxies__[wrapper_cls_name] + return super().__new__(cls) + def __init__(self, wrapped: Any, state: BaseState, field_name: str): """Create a proxy for a mutable object that tracks changes. @@ -3596,11 +3780,19 @@ class MutableProxy(wrapt.ObjectProxy): self._self_state = state self._self_field_name = field_name + def __repr__(self) -> str: + """Get the representation of the wrapped object. + + Returns: + The representation of the wrapped object. + """ + return f"{type(self).__name__}({self.__wrapped__})" + def _mark_dirty( self, wrapped=None, instance=None, - args=tuple(), + args=(), kwargs=None, ) -> Any: """Mark the state as dirty, then call a wrapped function. @@ -3631,7 +3823,27 @@ class MutableProxy(wrapt.ObjectProxy): Returns: Whether the value is of a mutable type. """ - return isinstance(value, cls.__mutable_types__) + return isinstance(value, cls.__mutable_types__) or ( + dataclasses.is_dataclass(value) and not isinstance(value, Var) + ) + + @staticmethod + def _is_called_from_dataclasses_internal() -> bool: + """Check if the current function is called from dataclasses helper. + + Returns: + Whether the current function is called from dataclasses internal code. + """ + # Walk up the stack a bit to see if we are called from dataclasses + # internal code, for example `asdict` or `astuple`. + frame = inspect.currentframe() + for _ in range(5): + # Why not `inspect.stack()` -- this is much faster! + if not (frame := frame and frame.f_back): + break + if inspect.getfile(frame) == dataclasses.__file__: + return True + return False def _wrap_recursive(self, value: Any) -> Any: """Wrap a value recursively if it is mutable. @@ -3642,9 +3854,13 @@ class MutableProxy(wrapt.ObjectProxy): Returns: The wrapped value. """ + # When called from dataclasses internal code, return the unwrapped value + if self._is_called_from_dataclasses_internal(): + return value # Recursively wrap mutable types, but do not re-wrap MutableProxy instances. if self._is_mutable_type(value) and not isinstance(value, MutableProxy): - return type(self)( + base_cls = globals()[self.__base_proxy__] + return base_cls( wrapped=value, state=self._self_state, field_name=self._self_field_name, @@ -3852,11 +4068,14 @@ class ImmutableMutableProxy(MutableProxy): to modify the wrapped object when the StateProxy is immutable. """ + # Ensure that recursively wrapped proxies use ImmutableMutableProxy as base. + __base_proxy__ = "ImmutableMutableProxy" + def _mark_dirty( self, wrapped=None, instance=None, - args=tuple(), + args=(), kwargs=None, ) -> Any: """Raise an exception when an attempt is made to modify the object. diff --git a/reflex/style.py b/reflex/style.py index f0ee8c6a7..a205cdc4a 100644 --- a/reflex/style.py +++ b/reflex/style.py @@ -74,7 +74,7 @@ def set_color_mode( new_color_mode = LiteralVar.create(new_color_mode) return Var( - f"() => {str(base_setter)}({str(new_color_mode)})", + f"() => {base_setter!s}({new_color_mode!s})", _var_data=VarData.merge( base_setter._get_all_var_data(), new_color_mode._get_all_var_data() ), @@ -138,9 +138,6 @@ def convert_item( if isinstance(style_item, Var): return style_item, style_item._get_all_var_data() - # if isinstance(style_item, str) and REFLEX_VAR_OPENING_TAG not in style_item: - # return style_item, None - # Otherwise, convert to Var to collapse VarData encoded in f-string. new_var = LiteralVar.create(style_item) var_data = new_var._get_all_var_data() if new_var is not None else None diff --git a/reflex/testing.py b/reflex/testing.py index 9ddb03504..582d7f8c9 100644 --- a/reflex/testing.py +++ b/reflex/testing.py @@ -8,7 +8,6 @@ import dataclasses import functools import inspect import os -import pathlib import platform import re import signal @@ -20,6 +19,7 @@ import threading import time import types from http.server import SimpleHTTPRequestHandler +from pathlib import Path from typing import ( TYPE_CHECKING, Any, @@ -44,6 +44,7 @@ import reflex.utils.format import reflex.utils.prerequisites import reflex.utils.processes from reflex.config import environment +from reflex.proxy import proxy_middleware from reflex.state import ( BaseState, StateManager, @@ -52,6 +53,7 @@ from reflex.state import ( StateManagerRedis, reload_state_module, ) +from reflex.utils import console try: from selenium import webdriver # pyright: ignore [reportMissingImports] @@ -100,7 +102,7 @@ class chdir(contextlib.AbstractContextManager): def __enter__(self): """Save current directory and perform chdir.""" - self._old_cwd.append(os.getcwd()) + self._old_cwd.append(Path.cwd()) os.chdir(self.path) def __exit__(self, *excinfo): @@ -120,8 +122,8 @@ class AppHarness: app_source: Optional[ Callable[[], None] | types.ModuleType | str | functools.partial[Any] ] - app_path: pathlib.Path - app_module_path: pathlib.Path + app_path: Path + app_module_path: Path app_module: Optional[types.ModuleType] = None app_instance: Optional[reflex.App] = None frontend_process: Optional[subprocess.Popen] = None @@ -136,7 +138,7 @@ class AppHarness: @classmethod def create( cls, - root: pathlib.Path, + root: Path, app_source: Optional[ Callable[[], None] | types.ModuleType | str | functools.partial[Any] ] = None, @@ -206,7 +208,7 @@ class AppHarness: The full state name """ # NOTE: using State.get_name() somehow causes trouble here - # path = [State.get_name()] + [self.get_state_name(p) for p in path] + # path = [State.get_name()] + [self.get_state_name(p) for p in path] # noqa: ERA001 path = ["reflex___state____state"] + [self.get_state_name(p) for p in path] return ".".join(path) @@ -297,6 +299,9 @@ class AppHarness: self.state_manager = StateManagerRedis.create(self.app_instance.state) else: self.state_manager = self.app_instance._state_manager + # Disable proxy for app harness tests. + if proxy_middleware in self.app_instance.lifespan_tasks: + self.app_instance.lifespan_tasks.remove(proxy_middleware) def _reload_state_module(self): """Reload the rx.State module to avoid conflict when reloading.""" @@ -364,9 +369,12 @@ class AppHarness: def _start_frontend(self): # Set up the frontend. with chdir(self.app_path): + backend_host, backend_port = self._poll_for_servers().getsockname() config = reflex.config.get_config() + config.backend_port = backend_port config.api_url = "http://{0}:{1}".format( - *self._poll_for_servers().getsockname(), + backend_host, + backend_port, ) reflex.utils.build.setup_frontend(self.app_path) @@ -385,12 +393,13 @@ class AppHarness: ) if not line: break - print(line) # for pytest diagnosis + print(line) # for pytest diagnosis #noqa: T201 m = re.search(reflex.constants.Next.FRONTEND_LISTENING_REGEX, line) if m is not None: self.frontend_url = m.group(1) config = reflex.config.get_config() config.deploy_url = self.frontend_url + config.frontend_port = int(self.frontend_url.rpartition(":")[2]) break if self.frontend_url is None: raise RuntimeError("Frontend did not start") @@ -403,11 +412,10 @@ class AppHarness: ) # catch I/O operation on closed file. except ValueError as e: - print(e) + console.error(str(e)) break if not line: break - print(line) self.frontend_output_thread = threading.Thread(target=consume_frontend_output) self.frontend_output_thread.start() @@ -436,7 +444,6 @@ class AppHarness: Returns: The rendered app global code. - """ if not inspect.isclass(value) and not inspect.isfunction(value): return f"{key} = {value!r}" @@ -815,7 +822,7 @@ class AppHarness: class SimpleHTTPRequestHandlerCustomErrors(SimpleHTTPRequestHandler): """SimpleHTTPRequestHandler with custom error page handling.""" - def __init__(self, *args, error_page_map: dict[int, pathlib.Path], **kwargs): + def __init__(self, *args, error_page_map: dict[int, Path], **kwargs): """Initialize the handler. Args: @@ -858,8 +865,8 @@ class Subdir404TCPServer(socketserver.TCPServer): def __init__( self, *args, - root: pathlib.Path, - error_page_map: dict[int, pathlib.Path] | None, + root: Path, + error_page_map: dict[int, Path] | None, **kwargs, ): """Initialize the server. @@ -879,7 +886,7 @@ class Subdir404TCPServer(socketserver.TCPServer): Args: request: the requesting socket - client_address: (host, port) referring to the client’s address. + client_address: (host, port) referring to the client's address. """ self.RequestHandlerClass( request, @@ -916,17 +923,20 @@ class AppHarnessProd(AppHarness): root=web_root, error_page_map=error_page_map, ) as self.frontend_server: - self.frontend_url = "http://localhost:{1}".format( - *self.frontend_server.socket.getsockname() - ) + config = reflex.config.get_config() + config.frontend_port = self.frontend_server.server_address[1] + self.frontend_url = f"http://localhost:{config.frontend_port}" self.frontend_server.serve_forever() def _start_frontend(self): # Set up the frontend. with chdir(self.app_path): + backend_host, backend_port = self._poll_for_servers().getsockname() config = reflex.config.get_config() + config.backend_port = backend_port config.api_url = "http://{0}:{1}".format( - *self._poll_for_servers().getsockname(), + backend_host, + backend_port, ) reflex.reflex.export( zipping=False, diff --git a/reflex/utils/build.py b/reflex/utils/build.py index 14709d99c..e263374e1 100644 --- a/reflex/utils/build.py +++ b/reflex/utils/build.py @@ -150,7 +150,7 @@ def zip_app( _zip( component_name=constants.ComponentName.BACKEND, target=zip_dest_dir / constants.ComponentName.BACKEND.zip(), - root_dir=Path("."), + root_dir=Path.cwd(), dirs_to_exclude={"__pycache__"}, files_to_exclude=files_to_exclude, top_level_dirs_to_exclude={"assets"}, diff --git a/reflex/utils/console.py b/reflex/utils/console.py index b3ba7163d..1c08a04b6 100644 --- a/reflex/utils/console.py +++ b/reflex/utils/console.py @@ -2,6 +2,8 @@ from __future__ import annotations +import os + from rich.console import Console from rich.progress import MofNCompleteColumn, Progress, TimeElapsedColumn from rich.prompt import Prompt @@ -12,7 +14,7 @@ from reflex.constants import LogLevel _console = Console() # The current log level. -_LOG_LEVEL = LogLevel.INFO +_LOG_LEVEL = LogLevel.DEFAULT # Deprecated features who's warning has been printed. _EMITTED_DEPRECATION_WARNINGS = set() @@ -20,6 +22,24 @@ _EMITTED_DEPRECATION_WARNINGS = set() # Info messages which have been printed. _EMITTED_INFO = set() +# Warnings which have been printed. +_EMIITED_WARNINGS = set() + +# Errors which have been printed. +_EMITTED_ERRORS = set() + +# Success messages which have been printed. +_EMITTED_SUCCESS = set() + +# Debug messages which have been printed. +_EMITTED_DEBUG = set() + +# Logs which have been printed. +_EMITTED_LOGS = set() + +# Prints which have been printed. +_EMITTED_PRINTS = set() + def set_log_level(log_level: LogLevel): """Set the log level. @@ -43,6 +63,9 @@ def set_log_level(log_level: LogLevel): raise ValueError(f"Invalid log level: {log_level}") from ae global _LOG_LEVEL + if log_level != _LOG_LEVEL: + # Set the loglevel persistently for subprocesses + os.environ["LOGLEVEL"] = log_level.value _LOG_LEVEL = log_level @@ -55,25 +78,37 @@ def is_debug() -> bool: return _LOG_LEVEL <= LogLevel.DEBUG -def print(msg: str, **kwargs): +def print(msg: str, dedupe: bool = False, **kwargs): """Print a message. Args: msg: The message to print. + dedupe: If True, suppress multiple console logs of print message. kwargs: Keyword arguments to pass to the print function. """ + if dedupe: + if msg in _EMITTED_PRINTS: + return + else: + _EMITTED_PRINTS.add(msg) _console.print(msg, **kwargs) -def debug(msg: str, **kwargs): +def debug(msg: str, dedupe: bool = False, **kwargs): """Print a debug message. Args: msg: The debug message. + dedupe: If True, suppress multiple console logs of debug message. kwargs: Keyword arguments to pass to the print function. """ if is_debug(): msg_ = f"[purple]Debug: {msg}[/purple]" + if dedupe: + if msg_ in _EMITTED_DEBUG: + return + else: + _EMITTED_DEBUG.add(msg_) if progress := kwargs.pop("progress", None): progress.console.print(msg_, **kwargs) else: @@ -97,25 +132,37 @@ def info(msg: str, dedupe: bool = False, **kwargs): print(f"[cyan]Info: {msg}[/cyan]", **kwargs) -def success(msg: str, **kwargs): +def success(msg: str, dedupe: bool = False, **kwargs): """Print a success message. Args: msg: The success message. + dedupe: If True, suppress multiple console logs of success message. kwargs: Keyword arguments to pass to the print function. """ if _LOG_LEVEL <= LogLevel.INFO: + if dedupe: + if msg in _EMITTED_SUCCESS: + return + else: + _EMITTED_SUCCESS.add(msg) print(f"[green]Success: {msg}[/green]", **kwargs) -def log(msg: str, **kwargs): +def log(msg: str, dedupe: bool = False, **kwargs): """Takes a string and logs it to the console. Args: msg: The message to log. + dedupe: If True, suppress multiple console logs of log message. kwargs: Keyword arguments to pass to the print function. """ if _LOG_LEVEL <= LogLevel.INFO: + if dedupe: + if msg in _EMITTED_LOGS: + return + else: + _EMITTED_LOGS.add(msg) _console.log(msg, **kwargs) @@ -129,14 +176,20 @@ def rule(title: str, **kwargs): _console.rule(title, **kwargs) -def warn(msg: str, **kwargs): +def warn(msg: str, dedupe: bool = False, **kwargs): """Print a warning message. Args: msg: The warning message. + dedupe: If True, suppress multiple console logs of warning message. kwargs: Keyword arguments to pass to the print function. """ if _LOG_LEVEL <= LogLevel.WARNING: + if dedupe: + if msg in _EMIITED_WARNINGS: + return + else: + _EMIITED_WARNINGS.add(msg) print(f"[orange1]Warning: {msg}[/orange1]", **kwargs) @@ -169,14 +222,20 @@ def deprecate( _EMITTED_DEPRECATION_WARNINGS.add(feature_name) -def error(msg: str, **kwargs): +def error(msg: str, dedupe: bool = False, **kwargs): """Print an error message. Args: msg: The error message. + dedupe: If True, suppress multiple console logs of error message. kwargs: Keyword arguments to pass to the print function. """ if _LOG_LEVEL <= LogLevel.ERROR: + if dedupe: + if msg in _EMITTED_ERRORS: + return + else: + _EMITTED_ERRORS.add(msg) print(f"[red]{msg}[/red]", **kwargs) diff --git a/reflex/utils/exceptions.py b/reflex/utils/exceptions.py index 714dc912c..bceadc977 100644 --- a/reflex/utils/exceptions.py +++ b/reflex/utils/exceptions.py @@ -63,6 +63,10 @@ class UploadValueError(ReflexError, ValueError): """Custom ValueError for upload related errors.""" +class PageValueError(ReflexError, ValueError): + """Custom ValueError for page related errors.""" + + class RouteValueError(ReflexError, ValueError): """Custom ValueError for route related errors.""" @@ -155,6 +159,10 @@ class StateTooLargeError(ReflexError): """Raised when the state is too large to be serialized.""" +class StateSerializationError(ReflexError): + """Raised when the state cannot be serialized.""" + + class SystemPackageMissingError(ReflexError): """Raised when a system package is missing.""" @@ -175,3 +183,11 @@ def raise_system_package_missing_error(package: str) -> NoReturn: " Please install it through your system package manager." + (f" You can do so by running 'brew install {package}'." if IS_MACOS else "") ) + + +class InvalidLockWarningThresholdError(ReflexError): + """Raised when an invalid lock warning threshold is provided.""" + + +class UnretrievableVarValueError(ReflexError): + """Raised when the value of a var is not retrievable.""" diff --git a/reflex/utils/exec.py b/reflex/utils/exec.py index 5291de095..621c4a608 100644 --- a/reflex/utils/exec.py +++ b/reflex/utils/exec.py @@ -24,7 +24,7 @@ from reflex.utils.prerequisites import get_web_dir frontend_process = None -def detect_package_change(json_file_path: str) -> str: +def detect_package_change(json_file_path: Path) -> str: """Calculates the SHA-256 hash of a JSON file and returns it as a hexadecimal string. Args: @@ -37,7 +37,7 @@ def detect_package_change(json_file_path: str) -> str: >>> detect_package_change("package.json") 'a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2' """ - with open(json_file_path, "r") as file: + with json_file_path.open("r") as file: json_data = json.load(file) # Calculate the hash @@ -81,7 +81,7 @@ def run_process_and_launch_url(run_command: list[str], backend_present=True): from reflex.utils import processes json_file_path = get_web_dir() / constants.PackageJson.PATH - last_hash = detect_package_change(str(json_file_path)) + last_hash = detect_package_change(json_file_path) process = None first_run = True @@ -117,14 +117,14 @@ def run_process_and_launch_url(run_command: list[str], backend_present=True): console.print("New packages detected: Updating app...") else: if any( - [x in line for x in ("bin executable does not exist on disk",)] + x in line for x in ("bin executable does not exist on disk",) ): console.error( "Try setting `REFLEX_USE_NPM=1` and re-running `reflex init` and `reflex run` to use npm instead of bun:\n" "`REFLEX_USE_NPM=1 reflex init`\n" "`REFLEX_USE_NPM=1 reflex run`" ) - new_hash = detect_package_change(str(json_file_path)) + new_hash = detect_package_change(json_file_path) if new_hash != last_hash: last_hash = new_hash kill(process.pid) @@ -206,7 +206,9 @@ def get_granian_target(): app_module_path = Path(reflex.__file__).parent / "app_module_for_backend.py" - return f"{str(app_module_path)}:{constants.CompileVars.APP}.{constants.CompileVars.API}" + return ( + f"{app_module_path!s}:{constants.CompileVars.APP}.{constants.CompileVars.API}" + ) def run_backend( @@ -440,10 +442,8 @@ def output_system_info(): system = platform.system() - if ( - system != "Windows" - or system == "Windows" - and prerequisites.is_windows_bun_supported() + if system != "Windows" or ( + system == "Windows" and prerequisites.is_windows_bun_supported() ): dependencies.extend( [ diff --git a/reflex/utils/export.py b/reflex/utils/export.py index 31ac0d0b5..2fbf633f6 100644 --- a/reflex/utils/export.py +++ b/reflex/utils/export.py @@ -1,6 +1,5 @@ """Export utilities.""" -import os from pathlib import Path from typing import Optional @@ -15,7 +14,7 @@ def export( zipping: bool = True, frontend: bool = True, backend: bool = True, - zip_dest_dir: str = os.getcwd(), + zip_dest_dir: str = str(Path.cwd()), upload_db_file: bool = False, api_url: Optional[str] = None, deploy_url: Optional[str] = None, diff --git a/reflex/utils/format.py b/reflex/utils/format.py index 1b3d1740f..1d6671a0b 100644 --- a/reflex/utils/format.py +++ b/reflex/utils/format.py @@ -329,12 +329,12 @@ def format_match( return_value = case[-1] case_conditions = " ".join( - [f"case JSON.stringify({str(condition)}):" for condition in conditions] + [f"case JSON.stringify({condition!s}):" for condition in conditions] ) - case_code = f"{case_conditions} return ({str(return_value)}); break;" + case_code = f"{case_conditions} return ({return_value!s}); break;" switch_code += case_code - switch_code += f"default: return ({str(default)}); break;" + switch_code += f"default: return ({default!s}); break;" switch_code += "};})()" return switch_code @@ -413,7 +413,7 @@ def format_props(*single_props, **key_value_props) -> list[str]: ) for name, prop in sorted(key_value_props.items()) if prop is not None - ] + [(f"{str(LiteralVar.create(prop))}") for prop in single_props] + ] + [(f"{LiteralVar.create(prop)!s}") for prop in single_props] def get_event_handler_parts(handler: EventHandler) -> tuple[str, str]: @@ -664,18 +664,22 @@ def format_library_name(library_fullname: str): return lib -def json_dumps(obj: Any) -> str: +def json_dumps(obj: Any, **kwargs) -> str: """Takes an object and returns a jsonified string. Args: obj: The object to be serialized. + kwargs: Additional keyword arguments to pass to json.dumps. Returns: A string """ from reflex.utils import serializers - return json.dumps(obj, ensure_ascii=False, default=serializers.serialize) + kwargs.setdefault("ensure_ascii", False) + kwargs.setdefault("default", serializers.serialize) + + return json.dumps(obj, **kwargs) def collect_form_dict_names(form_dict: dict[str, Any]) -> dict[str, Any]: @@ -712,8 +716,7 @@ def format_array_ref(refs: str, idx: Var | None) -> str: """ clean_ref = re.sub(r"[^\w]+", "_", refs) if idx is not None: - # idx._var_is_local = True - return f"refs_{clean_ref}[{str(idx)}]" + return f"refs_{clean_ref}[{idx!s}]" return f"refs_{clean_ref}" diff --git a/reflex/utils/path_ops.py b/reflex/utils/path_ops.py index a2ba2b151..38560977e 100644 --- a/reflex/utils/path_ops.py +++ b/reflex/utils/path_ops.py @@ -205,14 +205,14 @@ def update_json_file(file_path: str | Path, update_dict: dict[str, int | str]): # Read the existing json object from the file. json_object = {} if fp.stat().st_size: - with open(fp) as f: + with fp.open() as f: json_object = json.load(f) # Update the json object with the new data. json_object.update(update_dict) # Write the updated json object to the file - with open(fp, "w") as f: + with fp.open("w") as f: json.dump(json_object, f, ensure_ascii=False) diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index 0aeefc9be..0e837b5eb 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -28,8 +28,8 @@ import typer from alembic.util.exc import CommandError from packaging import version from redis import Redis as RedisSync -from redis import exceptions from redis.asyncio import Redis +from redis.exceptions import RedisError from reflex import constants, model from reflex.compiler import templates @@ -109,7 +109,7 @@ def check_latest_package_version(package_name: str): console.warn( f"Your version ({current_version}) of {package_name} is out of date. Upgrade to {latest_version} with 'pip install {package_name} --upgrade'" ) - # Check for depreacted python versions + # Check for deprecated python versions _python_version_check() except Exception: pass @@ -219,9 +219,8 @@ def get_install_package_manager(on_failure_return_none: bool = False) -> str | N Returns: The path to the package manager. """ - if ( - constants.IS_WINDOWS - and not is_windows_bun_supported() + if constants.IS_WINDOWS and ( + not is_windows_bun_supported() or windows_check_onedrive_in_path() or windows_npm_escape_hatch() ): @@ -291,7 +290,7 @@ def get_app(reload: bool = False) -> ModuleType: "If this error occurs in a reflex test case, ensure that `get_app` is mocked." ) module = config.module - sys.path.insert(0, os.getcwd()) + sys.path.insert(0, str(Path.cwd())) app = __import__(module, fromlist=(constants.CompileVars.APP,)) if reload: @@ -334,10 +333,11 @@ def get_redis() -> Redis | None: Returns: The asynchronous redis client. """ - if isinstance((redis_url_or_options := parse_redis_url()), str): - return Redis.from_url(redis_url_or_options) - elif isinstance(redis_url_or_options, dict): - return Redis(**redis_url_or_options) + if (redis_url := parse_redis_url()) is not None: + return Redis.from_url( + redis_url, + retry_on_error=[RedisError], + ) return None @@ -347,14 +347,15 @@ def get_redis_sync() -> RedisSync | None: Returns: The synchronous redis client. """ - if isinstance((redis_url_or_options := parse_redis_url()), str): - return RedisSync.from_url(redis_url_or_options) - elif isinstance(redis_url_or_options, dict): - return RedisSync(**redis_url_or_options) + if (redis_url := parse_redis_url()) is not None: + return RedisSync.from_url( + redis_url, + retry_on_error=[RedisError], + ) return None -def parse_redis_url() -> str | dict | None: +def parse_redis_url() -> str | None: """Parse the REDIS_URL in config if applicable. Returns: @@ -373,16 +374,13 @@ def parse_redis_url() -> str | dict | None: return config.redis_url -async def get_redis_status() -> bool | None: +async def get_redis_status() -> dict[str, bool | None]: """Checks the status of the Redis connection. Attempts to connect to Redis and send a ping command to verify connectivity. Returns: - bool or None: The status of the Redis connection: - - True: Redis is accessible and responding. - - False: Redis is not accessible due to a connection error. - - None: Redis not used i.e redis_url is not set in rxconfig. + The status of the Redis connection. """ try: status = True @@ -391,10 +389,10 @@ async def get_redis_status() -> bool | None: redis_client.ping() else: status = None - except exceptions.RedisError: + except RedisError: status = False - return status + return {"redis": status} def validate_app_name(app_name: str | None = None) -> str: @@ -439,9 +437,11 @@ def create_config(app_name: str): from reflex.compiler import templates config_name = f"{re.sub(r'[^a-zA-Z]', '', app_name).capitalize()}Config" - with open(constants.Config.FILE, "w") as f: - console.debug(f"Creating {constants.Config.FILE}") - f.write(templates.RXCONFIG.render(app_name=app_name, config_name=config_name)) + + console.debug(f"Creating {constants.Config.FILE}") + constants.Config.FILE.write_text( + templates.RXCONFIG.render(app_name=app_name, config_name=config_name) + ) def initialize_gitignore( @@ -495,14 +495,14 @@ def initialize_requirements_txt(): console.debug(f"Detected encoding for {fp} as {encoding}.") try: other_requirements_exist = False - with open(fp, "r", encoding=encoding) as f: - for req in f.readlines(): + with fp.open("r", encoding=encoding) as f: + for req in f: # Check if we have a package name that is reflex if re.match(r"^reflex[^a-zA-Z0-9]", req): console.debug(f"{fp} already has reflex as dependency.") return other_requirements_exist = True - with open(fp, "a", encoding=encoding) as f: + with fp.open("a", encoding=encoding) as f: preceding_newline = "\n" if other_requirements_exist else "" f.write( f"{preceding_newline}{constants.RequirementsTxt.DEFAULTS_STUB}{constants.Reflex.VERSION}\n" @@ -593,7 +593,7 @@ def initialize_web_directory(): """Initialize the web directory on reflex init.""" console.log("Initializing the web directory.") - # Re-use the hash if one is already created, so we don't over-write it when running reflex init + # Reuse the hash if one is already created, so we don't over-write it when running reflex init project_hash = get_project_hash() path_ops.cp(constants.Templates.Dirs.WEB_TEMPLATE, str(get_web_dir())) @@ -646,7 +646,7 @@ def initialize_bun_config(): def init_reflex_json(project_hash: int | None): """Write the hash of the Reflex project to a REFLEX_JSON. - Re-use the hash if one is already created, therefore do not + Reuse the hash if one is already created, therefore do not overwrite it every time we run the reflex init command . @@ -700,7 +700,7 @@ def _update_next_config( } if transpile_packages: next_config["transpilePackages"] = list( - set((format_library_name(p) for p in transpile_packages)) + {format_library_name(p) for p in transpile_packages} ) if export: next_config["output"] = "export" @@ -733,13 +733,13 @@ def download_and_run(url: str, *args, show_status: bool = False, **env): response.raise_for_status() # Save the script to a temporary file. - script = tempfile.NamedTemporaryFile() - with open(script.name, "w") as f: - f.write(response.text) + script = Path(tempfile.NamedTemporaryFile().name) + + script.write_text(response.text) # Run the script. env = {**os.environ, **env} - process = processes.new_process(["bash", f.name, *args], env=env) + process = processes.new_process(["bash", str(script), *args], env=env) show = processes.show_status if show_status else processes.show_logs show(f"Installing {url}", process) @@ -753,14 +753,14 @@ def download_and_extract_fnm_zip(): # Download the zip file url = constants.Fnm.INSTALL_URL console.debug(f"Downloading {url}") - fnm_zip_file = constants.Fnm.DIR / f"{constants.Fnm.FILENAME}.zip" + fnm_zip_file: Path = constants.Fnm.DIR / f"{constants.Fnm.FILENAME}.zip" # Function to download and extract the FNM zip release. try: # Download the FNM zip release. # TODO: show progress to improve UX response = net.get(url, follow_redirects=True) response.raise_for_status() - with open(fnm_zip_file, "wb") as output_file: + with fnm_zip_file.open("wb") as output_file: for chunk in response.iter_bytes(): output_file.write(chunk) @@ -808,7 +808,7 @@ def install_node(): ) else: # All other platforms (Linux, MacOS). # Add execute permissions to fnm executable. - os.chmod(constants.Fnm.EXE, stat.S_IXUSR) + constants.Fnm.EXE.chmod(stat.S_IXUSR) # Install node. # Specify arm64 arch explicitly for M1s and M2s. architecture_arg = ( @@ -834,7 +834,7 @@ def install_bun(): """Install bun onto the user's system.""" win_supported = is_windows_bun_supported() one_drive_in_path = windows_check_onedrive_in_path() - if constants.IS_WINDOWS and not win_supported or one_drive_in_path: + if constants.IS_WINDOWS and (not win_supported or one_drive_in_path): if not win_supported: console.warn( "Bun for Windows is currently only available for x86 64-bit Windows. Installation will fall back on npm." @@ -926,7 +926,7 @@ def cached_procedure(cache_file: str, payload_fn: Callable[..., str]): @cached_procedure( cache_file=str(get_web_dir() / "reflex.install_frontend_packages.cached"), - payload_fn=lambda p, c: f"{repr(sorted(list(p)))},{c.json()}", + payload_fn=lambda p, c: f"{sorted(p)!r},{c.json()}", ) def install_frontend_packages(packages: set[str], config: Config): """Installs the base and custom frontend packages. @@ -946,9 +946,12 @@ def install_frontend_packages(packages: set[str], config: Config): get_package_manager(on_failure_return_none=True) if ( not constants.IS_WINDOWS - or constants.IS_WINDOWS - and is_windows_bun_supported() - and not windows_check_onedrive_in_path() + or ( + constants.IS_WINDOWS + and ( + is_windows_bun_supported() and not windows_check_onedrive_in_path() + ) + ) ) else None ) @@ -1173,6 +1176,24 @@ def initialize_frontend_dependencies(): initialize_web_directory() +def check_db_used() -> bool: + """Check if the database is used. + + Returns: + True if the database is used. + """ + return bool(get_config().db_url) + + +def check_redis_used() -> bool: + """Check if Redis is used. + + Returns: + True if Redis is used. + """ + return bool(get_config().redis_url) + + def check_db_initialized() -> bool: """Check if the database migrations are initialized. @@ -1302,7 +1323,7 @@ def fetch_app_templates(version: str) -> dict[str, Template]: for tp in templates_data: if tp["hidden"] or tp["code_url"] is None: continue - known_fields = set(f.name for f in dataclasses.fields(Template)) + known_fields = {f.name for f in dataclasses.fields(Template)} filtered_templates[tp["name"]] = Template( **{k: v for k, v in tp.items() if k in known_fields} ) @@ -1328,7 +1349,7 @@ def create_config_init_app_from_remote_template(app_name: str, template_url: str raise typer.Exit(1) from ose # Use httpx GET with redirects to download the zip file. - zip_file_path = Path(temp_dir) / "template.zip" + zip_file_path: Path = Path(temp_dir) / "template.zip" try: # Note: following redirects can be risky. We only allow this for reflex built templates at the moment. response = net.get(template_url, follow_redirects=True) @@ -1338,9 +1359,8 @@ def create_config_init_app_from_remote_template(app_name: str, template_url: str console.error(f"Failed to download the template: {he}") raise typer.Exit(1) from he try: - with open(zip_file_path, "wb") as f: - f.write(response.content) - console.debug(f"Downloaded the zip to {zip_file_path}") + zip_file_path.write_bytes(response.content) + console.debug(f"Downloaded the zip to {zip_file_path}") except OSError as ose: console.error(f"Unable to write the downloaded zip to disk {ose}") raise typer.Exit(1) from ose @@ -1412,13 +1432,22 @@ def validate_and_create_app_using_remote_template(app_name, template, templates) """ # If user selects a template, it needs to exist. if template in templates: + from reflex_cli.v2.utils import hosting + + authenticated_token = hosting.authenticated_token() + if not authenticated_token or not authenticated_token[0]: + console.print( + f"Please use `reflex login` to access the '{template}' template." + ) + raise typer.Exit(3) + template_url = templates[template].code_url else: # Check if the template is a github repo. if template.startswith("https://github.com"): template_url = f"{template.strip('/').replace('.git', '')}/archive/main.zip" else: - console.error(f"Template `{template}` not found.") + console.error(f"Template `{template}` not found or invalid.") raise typer.Exit(1) if template_url is None: @@ -1455,7 +1484,7 @@ def generate_template_using_ai(template: str | None = None) -> str: def fetch_remote_templates( - template: Optional[str] = None, + template: str, ) -> tuple[str, dict[str, Template]]: """Fetch the available remote templates. @@ -1464,9 +1493,6 @@ def fetch_remote_templates( Returns: The selected template and the available templates. - - Raises: - Exit: If the template is not valid or if the template is not specified. """ available_templates = {} @@ -1478,19 +1504,7 @@ def fetch_remote_templates( console.debug(f"Error while fetching templates: {e}") template = constants.Templates.DEFAULT - if template == constants.Templates.DEFAULT: - return template, available_templates - - if template in available_templates: - return template, available_templates - - else: - if template is not None: - console.error(f"{template!r} is not a valid template name.") - console.print( - f"Go to the templates page ({constants.Templates.REFLEX_TEMPLATES_URL}) and copy the command to init with a template." - ) - raise typer.Exit(0) + return template, available_templates def initialize_app( @@ -1505,6 +1519,9 @@ def initialize_app( Returns: The name of the template. + + Raises: + Exit: If the template is not valid or unspecified. """ # Local imports to avoid circular imports. from reflex.utils import telemetry @@ -1532,7 +1549,10 @@ def initialize_app( # change to the default to allow creation of default app template = constants.Templates.DEFAULT elif template == constants.Templates.CHOOSE_TEMPLATES: - template, templates = fetch_remote_templates() + console.print( + f"Go to the templates page ({constants.Templates.REFLEX_TEMPLATES_URL}) and copy the command to init with a template." + ) + raise typer.Exit(0) # If the blank template is selected, create a blank app. if template in (constants.Templates.DEFAULT,): diff --git a/reflex/utils/processes.py b/reflex/utils/processes.py index a45676c01..871b5f323 100644 --- a/reflex/utils/processes.py +++ b/reflex/utils/processes.py @@ -58,7 +58,9 @@ def get_process_on_port(port) -> Optional[psutil.Process]: The process on the given port. """ for proc in psutil.process_iter(["pid", "name", "cmdline"]): - try: + with contextlib.suppress( + psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess + ): if importlib.metadata.version("psutil") >= "6.0.0": conns = proc.net_connections(kind="inet") # type: ignore else: @@ -66,8 +68,6 @@ def get_process_on_port(port) -> Optional[psutil.Process]: for conn in conns: if conn.laddr.port == int(port): return proc - except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess): - pass return None @@ -118,7 +118,7 @@ def handle_port(service_name: str, port: str, default_port: str) -> str: """Change port if the specified port is in use and is not explicitly specified as a CLI arg or config arg. otherwise tell the user the port is in use and exit the app. - We make an assumption that when port is the default port,then it hasnt been explicitly set since its not straightforward + We make an assumption that when port is the default port,then it hasn't been explicitly set since its not straightforward to know whether a port was explicitly provided by the user unless its any other than the default. Args: @@ -351,7 +351,7 @@ def atexit_handler(): def get_command_with_loglevel(command: list[str]) -> list[str]: """Add the right loglevel flag to the designated command. - npm uses --loglevel , Bun doesnt use the --loglevel flag and + npm uses --loglevel , Bun doesn't use the --loglevel flag and runs in debug mode by default. Args: @@ -364,7 +364,7 @@ def get_command_with_loglevel(command: list[str]) -> list[str]: npm_path = str(Path(npm_path).resolve()) if npm_path else npm_path if command[0] == npm_path: - return command + ["--loglevel", "silly"] + return [*command, "--loglevel", "silly"] return command diff --git a/reflex/utils/pyi_generator.py b/reflex/utils/pyi_generator.py index fb0a8f8c5..152c06949 100644 --- a/reflex/utils/pyi_generator.py +++ b/reflex/utils/pyi_generator.py @@ -24,7 +24,7 @@ from reflex.vars.base import Var logger = logging.getLogger("pyi_generator") -PWD = Path(".").resolve() +PWD = Path.cwd() EXCLUDED_FILES = [ "app.py", @@ -196,12 +196,7 @@ def _get_type_hint(value, type_hint_globals, is_optional=True) -> str: elif isinstance(value, str): ev = eval(value, type_hint_globals) if rx_types.is_optional(ev): - # hints = { - # _get_type_hint(arg, type_hint_globals, is_optional=False) - # for arg in ev.__args__ - # } return _get_type_hint(ev, type_hint_globals, is_optional=False) - # return f"Optional[{', '.join(hints)}]" if rx_types.is_union(ev): res = [ @@ -260,8 +255,15 @@ def _generate_docstrings(clzs: list[Type[Component]], props: list[str]) -> str: # We've reached the functions, so stop. break + if line == "": + # We hit a blank line, so clear comments to avoid commented out prop appearing in next prop docs. + comments.clear() + continue + # Get comments for prop if line.strip().startswith("#"): + # Remove noqa from the comments. + line = line.partition(" # noqa")[0] comments.append(line) continue @@ -285,10 +287,9 @@ def _generate_docstrings(clzs: list[Type[Component]], props: list[str]) -> str: for line in (clz.create.__doc__ or "").splitlines(): if "**" in line: indent = line.split("**")[0] - for nline in [ - f"{indent}{n}:{' '.join(c)}" for n, c in props_comments.items() - ]: - new_docstring.append(nline) + new_docstring.extend( + [f"{indent}{n}:{' '.join(c)}" for n, c in props_comments.items()] + ) new_docstring.append(line) return "\n".join(new_docstring) @@ -835,7 +836,7 @@ class StubGenerator(ast.NodeTransformer): self.inserted_imports = True default_imports = _generate_imports(self.typing_imports) self.import_statements.extend(ast.unparse(i) for i in default_imports) - return default_imports + [node] + return [*default_imports, node] return node def visit_ImportFrom( @@ -1022,7 +1023,7 @@ class InitStubGenerator(StubGenerator): class PyiGenerator: """A .pyi file generator that will scan all defined Component in Reflex and - generate the approriate stub. + generate the appropriate stub. """ modules: list = [] @@ -1201,4 +1202,4 @@ class PyiGenerator: or "Var[Template]" in line ): line = line.rstrip() + " # type: ignore\n" - print(line, end="") + print(line, end="") # noqa: T201 diff --git a/reflex/utils/telemetry.py b/reflex/utils/telemetry.py index 815d37a1b..fc90932a6 100644 --- a/reflex/utils/telemetry.py +++ b/reflex/utils/telemetry.py @@ -7,6 +7,7 @@ import dataclasses import multiprocessing import platform import warnings +from contextlib import suppress from reflex.config import environment @@ -129,7 +130,7 @@ def _prepare_event(event: str, **kwargs) -> dict: cpuinfo = get_cpu_info() - additional_keys = ["template", "context", "detail"] + additional_keys = ["template", "context", "detail", "user_uuid"] additional_fields = { key: value for key in additional_keys if (value := kwargs.get(key)) is not None } @@ -171,10 +172,11 @@ def _send(event, telemetry_enabled, **kwargs): if not telemetry_enabled: return False - event_data = _prepare_event(event, **kwargs) - if not event_data: - return False - return _send_event(event_data) + with suppress(Exception): + event_data = _prepare_event(event, **kwargs) + if not event_data: + return False + return _send_event(event_data) def send(event: str, telemetry_enabled: bool | None = None, **kwargs): diff --git a/reflex/utils/types.py b/reflex/utils/types.py index 0c39eacc4..b8bcbf2d6 100644 --- a/reflex/utils/types.py +++ b/reflex/utils/types.py @@ -97,7 +97,6 @@ StateIterVar = Union[list, set, tuple] if TYPE_CHECKING: from reflex.vars.base import Var - # ArgsSpec = Callable[[Var], list[Var]] ArgsSpec = ( Callable[[], Sequence[Var]] | Callable[[Var], Sequence[Var]] @@ -331,7 +330,11 @@ def get_attribute_access_type(cls: GenericType, name: str) -> GenericType | None type_ = field.outer_type_ if isinstance(type_, ModelField): type_ = type_.type_ - if not field.required and field.default is None: + if ( + not field.required + and field.default is None + and field.default_factory is None + ): # Ensure frontend uses null coalescing when accessing. type_ = Optional[type_] return type_ @@ -783,7 +786,7 @@ def validate_literal(key: str, value: Any, expected_type: Type, comp_name: str): ) value_str = f"'{value}'" if isinstance(value, str) else value raise ValueError( - f"prop value for {str(key)} of the `{comp_name}` component should be one of the following: {allowed_value_str}. Got {value_str} instead" + f"prop value for {key!s} of the `{comp_name}` component should be one of the following: {allowed_value_str}. Got {value_str} instead" ) diff --git a/reflex/vars/__init__.py b/reflex/vars/__init__.py index 1a4cebe19..cb02319bc 100644 --- a/reflex/vars/__init__.py +++ b/reflex/vars/__init__.py @@ -9,6 +9,7 @@ from .base import get_unique_variable_name as get_unique_variable_name from .base import get_uuid_string_var as get_uuid_string_var from .base import var_operation as var_operation from .base import var_operation_return as var_operation_return +from .datetime import DateTimeVar as DateTimeVar from .function import FunctionStringVar as FunctionStringVar from .function import FunctionVar as FunctionVar from .function import VarOperationCall as VarOperationCall diff --git a/reflex/vars/base.py b/reflex/vars/base.py index 200f693de..a4496d77d 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -42,7 +42,8 @@ from typing_extensions import ParamSpec, TypeGuard, deprecated, get_type_hints, from reflex import constants from reflex.base import Base -from reflex.utils import console, imports, serializers, types +from reflex.constants.compiler import Hooks +from reflex.utils import console, exceptions, imports, serializers, types from reflex.utils.exceptions import ( VarAttributeError, VarDependencyError, @@ -115,12 +116,20 @@ class VarData: # Hooks that need to be present in the component to render this var hooks: Tuple[str, ...] = dataclasses.field(default_factory=tuple) + # Dependencies of the var + deps: Tuple[Var, ...] = dataclasses.field(default_factory=tuple) + + # Position of the hook in the component + position: Hooks.HookPosition | None = None + def __init__( self, state: str = "", field_name: str = "", imports: ImportDict | ParsedImportDict | None = None, - hooks: dict[str, None] | None = None, + hooks: dict[str, VarData | None] | None = None, + deps: list[Var] | None = None, + position: Hooks.HookPosition | None = None, ): """Initialize the var data. @@ -129,6 +138,8 @@ class VarData: field_name: The name of the field in the state. imports: Imports needed to render this var. hooks: Hooks that need to be present in the component to render this var. + deps: Dependencies of the var for useCallback. + position: Position of the hook in the component. """ immutable_imports: ImmutableParsedImportDict = tuple( sorted( @@ -139,6 +150,8 @@ class VarData: object.__setattr__(self, "field_name", field_name) object.__setattr__(self, "imports", immutable_imports) object.__setattr__(self, "hooks", tuple(hooks or {})) + object.__setattr__(self, "deps", tuple(deps or [])) + object.__setattr__(self, "position", position or None) def old_school_imports(self) -> ImportDict: """Return the imports as a mutable dict. @@ -146,7 +159,7 @@ class VarData: Returns: The imports as a mutable dict. """ - return dict((k, list(v)) for k, v in self.imports) + return {k: list(v) for k, v in self.imports} def merge(*all: VarData | None) -> VarData | None: """Merge multiple var data objects. @@ -154,6 +167,9 @@ class VarData: Args: *all: The var data objects to merge. + Raises: + ReflexError: If trying to merge VarData with different positions. + Returns: The merged var data object. @@ -178,18 +194,40 @@ class VarData: (var_data.state for var_data in all_var_datas if var_data.state), "" ) - hooks = {hook: None for var_data in all_var_datas for hook in var_data.hooks} + hooks: dict[str, VarData | None] = { + hook: None for var_data in all_var_datas for hook in var_data.hooks + } _imports = imports.merge_imports( *(var_data.imports for var_data in all_var_datas) ) - if state or _imports or hooks or field_name: + deps = [dep for var_data in all_var_datas for dep in var_data.deps] + + positions = list( + { + var_data.position + for var_data in all_var_datas + if var_data.position is not None + } + ) + if positions: + if len(positions) > 1: + raise exceptions.ReflexError( + f"Cannot merge var data with different positions: {positions}" + ) + position = positions[0] + else: + position = None + + if state or _imports or hooks or field_name or deps or position: return VarData( state=state, field_name=field_name, imports=_imports, hooks=hooks, + deps=deps, + position=position, ) return None @@ -200,7 +238,14 @@ class VarData: Returns: True if any field is set to a non-default value. """ - return bool(self.state or self.imports or self.hooks or self.field_name) + return bool( + self.state + or self.imports + or self.hooks + or self.field_name + or self.deps + or self.position + ) @classmethod def from_state(cls, state: Type[BaseState] | str, field_name: str = "") -> VarData: @@ -480,7 +525,6 @@ class Var(Generic[VAR_TYPE]): raise TypeError( "The _var_full_name_needs_state_prefix argument is not supported for Var." ) - value_with_replaced = dataclasses.replace( self, _var_type=_var_type or self._var_type, @@ -1057,7 +1101,7 @@ class Var(Generic[VAR_TYPE]): if self._var_type is Any: raise TypeError( - f"You must provide an annotation for the state var `{str(self)}`. Annotation cannot be `{self._var_type}`." + f"You must provide an annotation for the state var `{self!s}`. Annotation cannot be `{self._var_type}`." ) if name in REPLACED_NAMES: @@ -1569,7 +1613,7 @@ class CachedVarOperation: if name == "_js_expr": return self._cached_var_name - parent_classes = inspect.getmro(self.__class__) + parent_classes = inspect.getmro(type(self)) next_class = parent_classes[parent_classes.index(CachedVarOperation) + 1] @@ -1591,14 +1635,12 @@ class CachedVarOperation: The cached VarData. """ return VarData.merge( - *map( - lambda value: ( - value._get_all_var_data() if isinstance(value, Var) else None - ), - map( - lambda field: getattr(self, field.name), - dataclasses.fields(self), # type: ignore - ), + *( + value._get_all_var_data() if isinstance(value, Var) else None + for value in ( + getattr(self, field.name) + for field in dataclasses.fields(self) # type: ignore + ) ), self._var_data, ) @@ -1611,7 +1653,7 @@ class CachedVarOperation: """ return hash( ( - self.__class__.__name__, + type(self).__name__, *[ getattr(self, field.name) for field in dataclasses.fields(self) # type: ignore @@ -1733,7 +1775,7 @@ class CallableVar(Var): Returns: The hash of the object. """ - return hash((self.__class__.__name__, self.original_var)) + return hash((type(self).__name__, self.original_var)) RETURN_TYPE = TypeVar("RETURN_TYPE") @@ -1889,20 +1931,20 @@ class ComputedVar(Var[RETURN_TYPE]): Raises: TypeError: If kwargs contains keys that are not allowed. """ - field_values = dict( - fget=kwargs.pop("fget", self._fget), - initial_value=kwargs.pop("initial_value", self._initial_value), - cache=kwargs.pop("cache", self._cache), - deps=kwargs.pop("deps", self._static_deps), - auto_deps=kwargs.pop("auto_deps", self._auto_deps), - interval=kwargs.pop("interval", self._update_interval), - backend=kwargs.pop("backend", self._backend), - _js_expr=kwargs.pop("_js_expr", self._js_expr), - _var_type=kwargs.pop("_var_type", self._var_type), - _var_data=kwargs.pop( + field_values = { + "fget": kwargs.pop("fget", self._fget), + "initial_value": kwargs.pop("initial_value", self._initial_value), + "cache": kwargs.pop("cache", self._cache), + "deps": kwargs.pop("deps", self._static_deps), + "auto_deps": kwargs.pop("auto_deps", self._auto_deps), + "interval": kwargs.pop("interval", self._update_interval), + "backend": kwargs.pop("backend", self._backend), + "_js_expr": kwargs.pop("_js_expr", self._js_expr), + "_var_type": kwargs.pop("_var_type", self._var_type), + "_var_data": kwargs.pop( "_var_data", VarData.merge(self._var_data, merge_var_data) ), - ) + } if kwargs: unexpected_kwargs = ", ".join(kwargs.keys()) @@ -2117,7 +2159,7 @@ class ComputedVar(Var[RETURN_TYPE]): ref_obj = None if instruction.argval in invalid_names: raise VarValueError( - f"Cached var {str(self)} cannot access arbitrary state via `{instruction.argval}`." + f"Cached var {self!s} cannot access arbitrary state via `{instruction.argval}`." ) if callable(ref_obj): # recurse into callable attributes @@ -2236,7 +2278,7 @@ def computed_var( def computed_var( fget: Callable[[BASE_STATE], Any] | None = None, initial_value: Any | types.Unset = types.Unset(), - cache: bool = False, + cache: Optional[bool] = None, deps: Optional[List[Union[str, Var]]] = None, auto_deps: bool = True, interval: Optional[Union[datetime.timedelta, int]] = None, @@ -2262,6 +2304,15 @@ def computed_var( ValueError: If caching is disabled and an update interval is set. VarDependencyError: If user supplies dependencies without caching. """ + if cache is None: + cache = False + console.deprecate( + "Default non-cached rx.var", + "the default value will be `@rx.var(cache=True)` in a future release. " + "To retain uncached var, explicitly pass `@rx.var(cache=False)`", + deprecation_version="0.6.8", + removal_version="0.7.0", + ) if cache is False and interval is not None: raise ValueError("Cannot set update interval without caching.") @@ -2371,10 +2422,7 @@ class CustomVarOperation(CachedVarOperation, Var[T]): The cached VarData. """ return VarData.merge( - *map( - lambda arg: arg[1]._get_all_var_data(), - self._args, - ), + *(arg[1]._get_all_var_data() for arg in self._args), self._return._get_all_var_data(), self._var_data, ) @@ -2492,7 +2540,7 @@ class StateOperation(CachedVarOperation, Var): Returns: The cached var name. """ - return f"{str(self._state_name)}.{str(self._field)}" + return f"{self._state_name!s}.{self._field!s}" def __getattr__(self, name: str) -> Any: """Get an attribute of the var. @@ -2804,9 +2852,9 @@ def dispatch( if result_origin_var_type in dispatchers: fn = dispatchers[result_origin_var_type] - fn_first_arg_type = list(inspect.signature(fn).parameters.values())[ - 0 - ].annotation + fn_first_arg_type = next( + iter(inspect.signature(fn).parameters.values()) + ).annotation fn_return = inspect.signature(fn).return_annotation diff --git a/reflex/vars/datetime.py b/reflex/vars/datetime.py new file mode 100644 index 000000000..b6f4c24c6 --- /dev/null +++ b/reflex/vars/datetime.py @@ -0,0 +1,222 @@ +"""Immutable datetime and date vars.""" + +from __future__ import annotations + +import dataclasses +import sys +from datetime import date, datetime +from typing import Any, NoReturn, TypeVar, Union, overload + +from reflex.utils.exceptions import VarTypeError +from reflex.vars.number import BooleanVar + +from .base import ( + CustomVarOperationReturn, + LiteralVar, + Var, + VarData, + var_operation, + var_operation_return, +) + +DATETIME_T = TypeVar("DATETIME_T", datetime, date) + +datetime_types = Union[datetime, date] + + +def raise_var_type_error(): + """Raise a VarTypeError. + + Raises: + VarTypeError: Cannot compare a datetime object with a non-datetime object. + """ + raise VarTypeError("Cannot compare a datetime object with a non-datetime object.") + + +class DateTimeVar(Var[DATETIME_T], python_types=(datetime, date)): + """A variable that holds a datetime or date object.""" + + @overload + def __lt__(self, other: datetime_types) -> BooleanVar: ... + + @overload + def __lt__(self, other: NoReturn) -> NoReturn: ... + + def __lt__(self, other: Any): + """Less than comparison. + + Args: + other: The other datetime to compare. + + Returns: + The result of the comparison. + """ + if not isinstance(other, DATETIME_TYPES): + raise_var_type_error() + return date_lt_operation(self, other) + + @overload + def __le__(self, other: datetime_types) -> BooleanVar: ... + + @overload + def __le__(self, other: NoReturn) -> NoReturn: ... + + def __le__(self, other: Any): + """Less than or equal comparison. + + Args: + other: The other datetime to compare. + + Returns: + The result of the comparison. + """ + if not isinstance(other, DATETIME_TYPES): + raise_var_type_error() + return date_le_operation(self, other) + + @overload + def __gt__(self, other: datetime_types) -> BooleanVar: ... + + @overload + def __gt__(self, other: NoReturn) -> NoReturn: ... + + def __gt__(self, other: Any): + """Greater than comparison. + + Args: + other: The other datetime to compare. + + Returns: + The result of the comparison. + """ + if not isinstance(other, DATETIME_TYPES): + raise_var_type_error() + return date_gt_operation(self, other) + + @overload + def __ge__(self, other: datetime_types) -> BooleanVar: ... + + @overload + def __ge__(self, other: NoReturn) -> NoReturn: ... + + def __ge__(self, other: Any): + """Greater than or equal comparison. + + Args: + other: The other datetime to compare. + + Returns: + The result of the comparison. + """ + if not isinstance(other, DATETIME_TYPES): + raise_var_type_error() + return date_ge_operation(self, other) + + +@var_operation +def date_gt_operation(lhs: Var | Any, rhs: Var | Any) -> CustomVarOperationReturn: + """Greater than comparison. + + Args: + lhs: The left-hand side of the operation. + rhs: The right-hand side of the operation. + + Returns: + The result of the operation. + """ + return date_compare_operation(rhs, lhs, strict=True) + + +@var_operation +def date_lt_operation(lhs: Var | Any, rhs: Var | Any) -> CustomVarOperationReturn: + """Less than comparison. + + Args: + lhs: The left-hand side of the operation. + rhs: The right-hand side of the operation. + + Returns: + The result of the operation. + """ + return date_compare_operation(lhs, rhs, strict=True) + + +@var_operation +def date_le_operation(lhs: Var | Any, rhs: Var | Any) -> CustomVarOperationReturn: + """Less than or equal comparison. + + Args: + lhs: The left-hand side of the operation. + rhs: The right-hand side of the operation. + + Returns: + The result of the operation. + """ + return date_compare_operation(lhs, rhs) + + +@var_operation +def date_ge_operation(lhs: Var | Any, rhs: Var | Any) -> CustomVarOperationReturn: + """Greater than or equal comparison. + + Args: + lhs: The left-hand side of the operation. + rhs: The right-hand side of the operation. + + Returns: + The result of the operation. + """ + return date_compare_operation(rhs, lhs) + + +def date_compare_operation( + lhs: DateTimeVar[DATETIME_T] | Any, + rhs: DateTimeVar[DATETIME_T] | Any, + strict: bool = False, +) -> CustomVarOperationReturn: + """Check if the value is less than the other value. + + Args: + lhs: The left-hand side of the operation. + rhs: The right-hand side of the operation. + strict: Whether to use strict comparison. + + Returns: + The result of the operation. + """ + return var_operation_return( + f"({lhs} { '<' if strict else '<='} {rhs})", + bool, + ) + + +@dataclasses.dataclass( + eq=False, + frozen=True, + **{"slots": True} if sys.version_info >= (3, 10) else {}, +) +class LiteralDatetimeVar(LiteralVar, DateTimeVar): + """Base class for immutable datetime and date vars.""" + + _var_value: datetime | date = dataclasses.field(default=datetime.now()) + + @classmethod + def create(cls, value: datetime | date, _var_data: VarData | None = None): + """Create a new instance of the class. + + Args: + value: The value to set. + + Returns: + LiteralDatetimeVar: The new instance of the class. + """ + js_expr = f'"{value!s}"' + return cls( + _js_expr=js_expr, + _var_type=type(value), + _var_value=value, + _var_data=_var_data, + ) + + +DATETIME_TYPES = (datetime, date, DateTimeVar) diff --git a/reflex/vars/function.py b/reflex/vars/function.py index c65b38f70..2a7d50e1b 100644 --- a/reflex/vars/function.py +++ b/reflex/vars/function.py @@ -240,7 +240,7 @@ class VarOperationCall(Generic[P, R], CachedVarOperation, Var[R]): Returns: The name of the var. """ - return f"({str(self._func)}({', '.join([str(LiteralVar.create(arg)) for arg in self._args])}))" + return f"({self._func!s}({', '.join([str(LiteralVar.create(arg)) for arg in self._args])}))" @cached_property_no_lock def _cached_get_all_var_data(self) -> VarData | None: @@ -292,7 +292,7 @@ class VarOperationCall(Generic[P, R], CachedVarOperation, Var[R]): class DestructuredArg: """Class for destructured arguments.""" - fields: Tuple[str, ...] = tuple() + fields: Tuple[str, ...] = () rest: Optional[str] = None def to_javascript(self) -> str: @@ -314,7 +314,7 @@ class DestructuredArg: class FunctionArgs: """Class for function arguments.""" - args: Tuple[Union[str, DestructuredArg], ...] = tuple() + args: Tuple[Union[str, DestructuredArg], ...] = () rest: Optional[str] = None diff --git a/reflex/vars/number.py b/reflex/vars/number.py index a762796e2..d04aded35 100644 --- a/reflex/vars/number.py +++ b/reflex/vars/number.py @@ -51,7 +51,7 @@ def raise_unsupported_operand_types( VarTypeError: The operand types are unsupported. """ raise VarTypeError( - f"Unsupported Operand type(s) for {operator}: {', '.join(map(lambda t: t.__name__, operands_types))}" + f"Unsupported Operand type(s) for {operator}: {', '.join(t.__name__ for t in operands_types)}" ) @@ -1012,7 +1012,7 @@ class LiteralNumberVar(LiteralVar, NumberVar): Returns: int: The hash value of the object. """ - return hash((self.__class__.__name__, self._var_value)) + return hash((type(self).__name__, self._var_value)) @classmethod def create(cls, value: float | int, _var_data: VarData | None = None): @@ -1064,7 +1064,7 @@ class LiteralBooleanVar(LiteralVar, BooleanVar): Returns: int: The hash value of the object. """ - return hash((self.__class__.__name__, self._var_value)) + return hash((type(self).__name__, self._var_value)) @classmethod def create(cls, value: bool, _var_data: VarData | None = None): diff --git a/reflex/vars/object.py b/reflex/vars/object.py index e60ea09e3..5de431f5a 100644 --- a/reflex/vars/object.py +++ b/reflex/vars/object.py @@ -272,7 +272,7 @@ class ObjectVar(Var[OBJECT_TYPE], python_types=dict): attribute_type = get_attribute_access_type(var_type, name) if attribute_type is None: raise VarAttributeError( - f"The State var `{str(self)}` has no attribute '{name}' or may have been annotated " + f"The State var `{self!s}` has no attribute '{name}' or may have been annotated " f"wrongly." ) return ObjectItemOperation.create(self, name, attribute_type).guess_type() @@ -332,7 +332,7 @@ class LiteralObjectVar(CachedVarOperation, ObjectVar[OBJECT_TYPE], LiteralVar): "({ " + ", ".join( [ - f"[{str(LiteralVar.create(key))}] : {str(LiteralVar.create(value))}" + f"[{LiteralVar.create(key)!s}] : {LiteralVar.create(value)!s}" for key, value in self._var_value.items() ] ) @@ -362,7 +362,7 @@ class LiteralObjectVar(CachedVarOperation, ObjectVar[OBJECT_TYPE], LiteralVar): Returns: The hash of the var. """ - return hash((self.__class__.__name__, self._js_expr)) + return hash((type(self).__name__, self._js_expr)) @cached_property_no_lock def _cached_get_all_var_data(self) -> VarData | None: @@ -494,8 +494,8 @@ class ObjectItemOperation(CachedVarOperation, Var): The name of the operation. """ if types.is_optional(self._object._var_type): - return f"{str(self._object)}?.[{str(self._key)}]" - return f"{str(self._object)}[{str(self._key)}]" + return f"{self._object!s}?.[{self._key!s}]" + return f"{self._object!s}[{self._key!s}]" @classmethod def create( diff --git a/reflex/vars/sequence.py b/reflex/vars/sequence.py index 08429883f..5864e70b9 100644 --- a/reflex/vars/sequence.py +++ b/reflex/vars/sequence.py @@ -271,6 +271,25 @@ class StringVar(Var[STRING_TYPE], python_types=str): raise_unsupported_operand_types("startswith", (type(self), type(prefix))) return string_starts_with_operation(self, prefix) + @overload + def endswith(self, suffix: StringVar | str) -> BooleanVar: ... + + @overload + def endswith(self, suffix: NoReturn) -> NoReturn: ... + + def endswith(self, suffix: Any) -> BooleanVar: + """Check if the string ends with a suffix. + + Args: + suffix: The suffix. + + Returns: + The string ends with operation. + """ + if not isinstance(suffix, (StringVar, str)): + raise_unsupported_operand_types("endswith", (type(self), type(suffix))) + return string_ends_with_operation(self, suffix) + @overload def __lt__(self, other: StringVar | str) -> BooleanVar: ... @@ -501,6 +520,24 @@ def string_starts_with_operation( ) +@var_operation +def string_ends_with_operation( + full_string: StringVar[Any], suffix: StringVar[Any] | str +): + """Check if a string ends with a suffix. + + Args: + full_string: The full string. + suffix: The suffix. + + Returns: + Whether the string ends with the suffix. + """ + return var_operation_return( + js_expression=f"{full_string}.endsWith({suffix})", var_type=bool + ) + + @var_operation def string_item_operation(string: StringVar[Any], index: NumberVar | int): """Get an item from a string. @@ -667,7 +704,7 @@ class LiteralStringVar(LiteralVar, StringVar[str]): Returns: The hash of the var. """ - return hash((self.__class__.__name__, self._var_value)) + return hash((type(self).__name__, self._var_value)) def json(self) -> str: """Get the JSON representation of the var. @@ -1177,7 +1214,7 @@ class ArrayVar(Var[ARRAY_VAR_TYPE], python_types=(list, tuple, set)): if num_args == 0: return_value = fn() - function_var = ArgsFunctionOperation.create(tuple(), return_value) + function_var = ArgsFunctionOperation.create((), return_value) else: # generic number var number_var = Var("").to(NumberVar, int) @@ -1349,7 +1386,7 @@ class ArraySliceOperation(CachedVarOperation, ArrayVar): LiteralVar.create(end) if end is not None else Var(_js_expr="undefined") ) if step is None: - return f"{str(self._array)}.slice({str(normalized_start)}, {str(normalized_end)})" + return f"{self._array!s}.slice({normalized_start!s}, {normalized_end!s})" if not isinstance(step, Var): if step < 0: actual_start = end + 1 if end is not None else 0 @@ -1357,12 +1394,12 @@ class ArraySliceOperation(CachedVarOperation, ArrayVar): return str(self._array[actual_start:actual_end].reverse()[::-step]) if step == 0: raise ValueError("slice step cannot be zero") - return f"{str(self._array)}.slice({str(normalized_start)}, {str(normalized_end)}).filter((_, i) => i % {str(step)} === 0)" + return f"{self._array!s}.slice({normalized_start!s}, {normalized_end!s}).filter((_, i) => i % {step!s} === 0)" actual_start_reverse = end + 1 if end is not None else 0 actual_end_reverse = start + 1 if start is not None else self._array.length() - return f"{str(self.step)} > 0 ? {str(self._array)}.slice({str(normalized_start)}, {str(normalized_end)}).filter((_, i) => i % {str(step)} === 0) : {str(self._array)}.slice({str(actual_start_reverse)}, {str(actual_end_reverse)}).reverse().filter((_, i) => i % {str(-step)} === 0)" + return f"{self.step!s} > 0 ? {self._array!s}.slice({normalized_start!s}, {normalized_end!s}).filter((_, i) => i % {step!s} === 0) : {self._array!s}.slice({actual_start_reverse!s}, {actual_end_reverse!s}).reverse().filter((_, i) => i % {-step!s} === 0)" @classmethod def create( @@ -1535,7 +1572,7 @@ def array_item_operation(array: ArrayVar, index: NumberVar | int): element_type = unionize(*args) return var_operation_return( - js_expression=f"{str(array)}.at({str(index)})", + js_expression=f"{array!s}.at({index!s})", var_type=element_type, ) @@ -1555,7 +1592,7 @@ def array_range_operation( The range of numbers. """ return var_operation_return( - js_expression=f"Array.from({{ length: ({str(stop)} - {str(start)}) / {str(step)} }}, (_, i) => {str(start)} + i * {str(step)})", + js_expression=f"Array.from({{ length: ({stop!s} - {start!s}) / {step!s} }}, (_, i) => {start!s} + i * {step!s})", var_type=List[int], ) diff --git a/scripts/integration.sh b/scripts/integration.sh index dc8b5d553..41d3051d0 100755 --- a/scripts/integration.sh +++ b/scripts/integration.sh @@ -34,4 +34,4 @@ if [ -f /proc/$pid/winpid ]; then echo "Windows detected, passing winpid $pid to port waiter" fi -python scripts/wait_for_listening_port.py $check_ports --timeout=900 --server-pid "$pid" +python scripts/wait_for_listening_port.py $check_ports --timeout=900 --server-pid "$pid" $WAIT_FOR_LISTENING_PORT_ARGS diff --git a/scripts/wait_for_listening_port.py b/scripts/wait_for_listening_port.py index 247ff4fba..71b6dd8b2 100644 --- a/scripts/wait_for_listening_port.py +++ b/scripts/wait_for_listening_port.py @@ -10,6 +10,8 @@ import time from concurrent.futures import ThreadPoolExecutor, as_completed from typing import Tuple +import httpx + # psutil is already a dependency of Reflex itself - so it's OK to use import psutil @@ -23,9 +25,10 @@ def _pid_exists(pid): return pid in psutil.pids() +# Not really used anymore now that we actually check the HTTP response. def _wait_for_port(port, server_pid, timeout) -> Tuple[bool, str]: start = time.time() - print(f"Waiting for up to {timeout} seconds for port {port} to start listening.") + print(f"Waiting for up to {timeout} seconds for port {port} to start listening.") # noqa: T201 while True: if not _pid_exists(server_pid): return False, f"Server PID {server_pid} is not running." @@ -41,26 +44,70 @@ def _wait_for_port(port, server_pid, timeout) -> Tuple[bool, str]: time.sleep(5) +def _wait_for_http_response(port, server_pid, timeout, path) -> Tuple[bool, str, str]: + start = time.time() + if path[0] != "/": + # This is a hack for passing the path on windows without a leading slash + # which mangles it https://stackoverflow.com/a/49013604 + path = "/" + path + url = f"http://localhost:{port}{path}" + print(f"Waiting for up to {timeout} seconds for {url} to return HTTP response.") # noqa: T201 + while True: + try: + if not _pid_exists(server_pid): + return False, f"Server PID {server_pid} is not running.", "" + response = httpx.get(url, timeout=0.5) + response.raise_for_status() + return ( + True, + f"{url} returned response after {time.time() - start} seconds", + response.text, + ) + except Exception as exc: # noqa: PERF203 + if time.time() - start > timeout: + return ( + False, + f"{url} still returning errors after {timeout} seconds: {exc!r}.", + "", + ) + time.sleep(5) + + def main(): """Wait for ports to start listening.""" parser = argparse.ArgumentParser(description="Wait for ports to start listening.") parser.add_argument("port", type=int, nargs="+") parser.add_argument("--timeout", type=int, required=True) parser.add_argument("--server-pid", type=int) + parser.add_argument("--path", type=str, default="/") args = parser.parse_args() + start = time.time() executor = ThreadPoolExecutor(max_workers=len(args.port)) - futures = [] - for p in args.port: - futures.append( - executor.submit(_wait_for_port, p, args.server_pid, args.timeout) + futures = [ + executor.submit( + _wait_for_http_response, + p, + args.server_pid, + args.timeout, + args.path, ) + for p in args.port + ] + base_content = None for f in as_completed(futures): - ok, msg = f.result() + ok, msg, content = f.result() if ok: - print(f"OK: {msg}") + print(f"OK: {msg}") # noqa: T201 + if base_content is None: + base_content = content + else: + assert ( + content == base_content + ), f"HTTP responses are not equal {content!r} != {base_content!r}." else: - print(f"FAIL: {msg}") + print(f"FAIL: {msg}") # noqa: T201 exit(1) + print(f"OK: All HTTP responses are equal after {time.time() - start} sec.") # noqa: T201 if __name__ == "__main__": diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index f7b825f16..d11344903 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -6,6 +6,7 @@ from pathlib import Path import pytest +import reflex.app from reflex.config import environment from reflex.testing import AppHarness, AppHarnessProd @@ -76,3 +77,25 @@ def app_harness_env(request): The AppHarness class to use for the test. """ return request.param + + +@pytest.fixture(autouse=True) +def raise_console_error(request, mocker): + """Spy on calls to `console.error` used by the framework. + + Help catch spurious error conditions that might otherwise go unnoticed. + + If a test is marked with `ignore_console_error`, the spy will be ignored + after the test. + + Args: + request: The pytest request object. + mocker: The pytest mocker object. + + Yields: + control to the test function. + """ + spy = mocker.spy(reflex.app.console, "error") + yield + if "ignore_console_error" not in request.keywords: + spy.assert_not_called() diff --git a/tests/integration/init-test/in_docker_test_script.sh b/tests/integration/init-test/in_docker_test_script.sh index 31d245588..54f821ccf 100755 --- a/tests/integration/init-test/in_docker_test_script.sh +++ b/tests/integration/init-test/in_docker_test_script.sh @@ -29,7 +29,7 @@ source ~/venv/bin/activate pip install -U pip echo "Installing reflex from local repo code" -pip install /reflex-repo +pip install '/reflex-repo[proxy]' redis-server & diff --git a/tests/integration/test_call_script.py b/tests/integration/test_call_script.py index 71200221b..203c20e9b 100644 --- a/tests/integration/test_call_script.py +++ b/tests/integration/test_call_script.py @@ -15,6 +15,7 @@ from .utils import SessionStorage def CallScript(): """A test app for browser javascript integration.""" + from pathlib import Path from typing import Dict, List, Optional, Union import reflex as rx @@ -160,7 +161,7 @@ def CallScript(): @rx.event def call_with_var_str_cast(self): return rx.call_script( - f"{str(rx.Var('inline_counter'))} + {str(rx.Var('external_counter'))}", + f"{rx.Var('inline_counter')!s} + {rx.Var('external_counter')!s}", callback=CallScriptState.set_last_result, # type: ignore ) @@ -175,7 +176,7 @@ def CallScript(): def call_with_var_str_cast_wrapped(self): return rx.call_script( rx.Var( - f"{str(rx.Var('inline_counter'))} + {str(rx.Var('external_counter'))}" + f"{rx.Var('inline_counter')!s} + {rx.Var('external_counter')!s}" ), callback=CallScriptState.set_last_result, # type: ignore ) @@ -186,8 +187,7 @@ def CallScript(): self.reset() app = rx.App(state=rx.State) - with open("assets/external.js", "w") as f: - f.write(external_scripts) + Path("assets/external.js").write_text(external_scripts) @app.add_page def index(): @@ -315,7 +315,7 @@ def CallScript(): rx.button( "call_with_var_str_cast_inline", on_click=rx.call_script( - f"{str(rx.Var('inline_counter'))} + {str(rx.Var('external_counter'))}", + f"{rx.Var('inline_counter')!s} + {rx.Var('external_counter')!s}", callback=CallScriptState.set_last_result, # type: ignore ), id="call_with_var_str_cast_inline", @@ -334,7 +334,7 @@ def CallScript(): "call_with_var_str_cast_wrapped_inline", on_click=rx.call_script( rx.Var( - f"{str(rx.Var('inline_counter'))} + {str(rx.Var('external_counter'))}" + f"{rx.Var('inline_counter')!s} + {rx.Var('external_counter')!s}" ), callback=CallScriptState.set_last_result, # type: ignore ), diff --git a/tests/integration/test_client_storage.py b/tests/integration/test_client_storage.py index 236d3e14e..2652d6ccb 100644 --- a/tests/integration/test_client_storage.py +++ b/tests/integration/test_client_storage.py @@ -637,8 +637,7 @@ async def test_client_side_state( assert await AppHarness._poll_for_async(poll_for_not_hydrated) # Trigger event to get a new instance of the state since the old was expired. - state_var_input = driver.find_element(By.ID, "state_var") - state_var_input.send_keys("re-triggering") + set_sub("c1", "c1 post expire") # get new references to all cookie and local storage elements (again) c1 = driver.find_element(By.ID, "c1") @@ -659,7 +658,7 @@ async def test_client_side_state( l1s = driver.find_element(By.ID, "l1s") s1s = driver.find_element(By.ID, "s1s") - assert c1.text == "c1 value" + assert c1.text == "c1 post expire" assert c2.text == "c2 value" assert c3.text == "" # temporary cookie expired after reset state! assert c4.text == "c4 value" @@ -690,11 +689,11 @@ async def test_client_side_state( async def poll_for_c1_set(): sub_state = await get_sub_state() - return sub_state.c1 == "c1 value" + return sub_state.c1 == "c1 post expire" assert await AppHarness._poll_for_async(poll_for_c1_set) sub_state = await get_sub_state() - assert sub_state.c1 == "c1 value" + assert sub_state.c1 == "c1 post expire" assert sub_state.c2 == "c2 value" assert sub_state.c3 == "" assert sub_state.c4 == "c4 value" diff --git a/tests/integration/test_computed_vars.py b/tests/integration/test_computed_vars.py index a41458173..03aaf18b4 100644 --- a/tests/integration/test_computed_vars.py +++ b/tests/integration/test_computed_vars.py @@ -106,7 +106,6 @@ def ComputedVars(): ), ) - # raise Exception(State.count3._deps(objclass=State)) app = rx.App() app.add_page(index) diff --git a/tests/integration/test_dynamic_routes.py b/tests/integration/test_dynamic_routes.py index eed066696..8a3cde3a2 100644 --- a/tests/integration/test_dynamic_routes.py +++ b/tests/integration/test_dynamic_routes.py @@ -2,6 +2,7 @@ from __future__ import annotations +import time from typing import Callable, Coroutine, Generator, Type from urllib.parse import urlsplit @@ -89,6 +90,11 @@ def DynamicRoute(): @rx.page(route="/arg/[arg_str]") def arg() -> rx.Component: return rx.vstack( + rx.input( + value=DynamicState.router.session.client_token, + read_only=True, + id="token", + ), rx.data_list.root( rx.data_list.item( rx.data_list.label("rx.State.arg_str (dynamic)"), @@ -172,6 +178,8 @@ def driver(dynamic_route: AppHarness) -> Generator[WebDriver, None, None]: """ assert dynamic_route.app_instance is not None, "app is not running" driver = dynamic_route.frontend() + # TODO: drop after flakiness is resolved + driver.implicitly_wait(30) try: yield driver finally: @@ -373,17 +381,22 @@ async def test_on_load_navigate_non_dynamic( async def test_render_dynamic_arg( dynamic_route: AppHarness, driver: WebDriver, + token: str, ): """Assert that dynamic arg var is rendered correctly in different contexts. Args: dynamic_route: harness for DynamicRoute app. driver: WebDriver instance. + token: The token visible in the driver browser. """ assert dynamic_route.app_instance is not None with poll_for_navigation(driver): driver.get(f"{dynamic_route.frontend_url}/arg/0") + # TODO: drop after flakiness is resolved + time.sleep(3) + def assert_content(expected: str, expect_not: str): ids = [ "state-arg_str", @@ -398,7 +411,8 @@ async def test_render_dynamic_arg( el = driver.find_element(By.ID, id) assert el assert ( - dynamic_route.poll_for_content(el, exp_not_equal=expect_not) == expected + dynamic_route.poll_for_content(el, timeout=30, exp_not_equal=expect_not) + == expected ) assert_content("0", "") diff --git a/tests/integration/test_exception_handlers.py b/tests/integration/test_exception_handlers.py index 406c21e5d..a645d1de6 100644 --- a/tests/integration/test_exception_handlers.py +++ b/tests/integration/test_exception_handlers.py @@ -13,6 +13,8 @@ from selenium.webdriver.support.ui import WebDriverWait from reflex.testing import AppHarness, AppHarnessProd +pytestmark = [pytest.mark.ignore_console_error] + def TestApp(): """A test app for event exception handler integration.""" diff --git a/tests/integration/test_input.py b/tests/integration/test_input.py index c718749aa..e9fec7dc1 100644 --- a/tests/integration/test_input.py +++ b/tests/integration/test_input.py @@ -183,6 +183,6 @@ async def test_fully_controlled_input(fully_controlled_input: AppHarness): clear_button.click() assert AppHarness._poll_for(lambda: on_change_input.get_attribute("value") == "") # potential bug: clearing the on_change field doesn't itself trigger on_change - # assert backend_state.text == "" - # assert debounce_input.get_attribute("value") == "" - # assert value_input.get_attribute("value") == "" + # assert backend_state.text == "" #noqa: ERA001 + # assert debounce_input.get_attribute("value") == "" #noqa: ERA001 + # assert value_input.get_attribute("value") == "" #noqa: ERA001 diff --git a/tests/integration/test_state_inheritance.py b/tests/integration/test_state_inheritance.py index 81512a67a..6b93a2ed7 100644 --- a/tests/integration/test_state_inheritance.py +++ b/tests/integration/test_state_inheritance.py @@ -73,7 +73,7 @@ def StateInheritance(): def on_click_other_mixin(self): self.other_mixin_clicks += 1 self.other_mixin = ( - f"{self.__class__.__name__}.clicked.{self.other_mixin_clicks}" + f"{type(self).__name__}.clicked.{self.other_mixin_clicks}" ) class Base1(Mixin, rx.State): diff --git a/tests/integration/test_upload.py b/tests/integration/test_upload.py index b7f14b03d..0331c15d6 100644 --- a/tests/integration/test_upload.py +++ b/tests/integration/test_upload.py @@ -6,12 +6,16 @@ import asyncio import time from pathlib import Path from typing import Generator +from urllib.parse import urlsplit import pytest from selenium.webdriver.common.by import By +from reflex.constants.event import Endpoint from reflex.testing import AppHarness, WebDriver +from .utils import poll_for_navigation + def UploadFile(): """App for testing dynamic routes.""" @@ -23,7 +27,7 @@ def UploadFile(): class UploadState(rx.State): _file_data: Dict[str, str] = {} - event_order: List[str] = [] + event_order: rx.Field[List[str]] = rx.field([]) progress_dicts: List[dict] = [] disabled: bool = False large_data: str = "" @@ -50,6 +54,15 @@ def UploadFile(): self.large_data = "" self.event_order.append("chain_event") + async def handle_upload_tertiary(self, files: List[rx.UploadFile]): + for file in files: + (rx.get_upload_dir() / (file.filename or "INVALID")).write_bytes( + await file.read() + ) + + def do_download(self): + return rx.download(rx.get_upload_url("test.txt")) + def index(): return rx.vstack( rx.input( @@ -123,6 +136,34 @@ def UploadFile(): on_click=rx.cancel_upload("secondary"), id="cancel_button_secondary", ), + rx.heading("Tertiary Upload/Download"), + rx.upload.root( + rx.vstack( + rx.button("Select File"), + rx.text("Drag and drop files here or click to select files"), + ), + id="tertiary", + ), + rx.button( + "Upload", + on_click=UploadState.handle_upload_tertiary( # type: ignore + rx.upload_files( + upload_id="tertiary", + ), + ), + id="upload_button_tertiary", + ), + rx.button( + "Download - Frontend", + on_click=rx.download(rx.get_upload_url("test.txt")), + id="download-frontend", + ), + rx.button( + "Download - Backend", + on_click=UploadState.do_download, + id="download-backend", + ), + rx.text(UploadState.event_order.to_string(), id="event-order"), ) app = rx.App(state=rx.State) @@ -164,6 +205,24 @@ def driver(upload_file: AppHarness): driver.quit() +def poll_for_token(driver: WebDriver, upload_file: AppHarness) -> str: + """Poll for the token input to be populated. + + Args: + driver: WebDriver instance. + upload_file: harness for UploadFile app. + + Returns: + token value + """ + token_input = driver.find_element(By.ID, "token") + assert token_input + # wait for the backend connection to send the token + token = upload_file.poll_for_value(token_input) + assert token is not None + return token + + @pytest.mark.parametrize("secondary", [False, True]) @pytest.mark.asyncio async def test_upload_file( @@ -178,11 +237,7 @@ async def test_upload_file( secondary: whether to use the secondary upload form """ assert upload_file.app_instance is not None - token_input = driver.find_element(By.ID, "token") - assert token_input - # wait for the backend connection to send the token - token = upload_file.poll_for_value(token_input) - assert token is not None + token = poll_for_token(driver, upload_file) full_state_name = upload_file.get_full_state_name(["_upload_state"]) state_name = upload_file.get_state_name("_upload_state") substate_token = f"{token}_{full_state_name}" @@ -204,6 +259,19 @@ async def test_upload_file( upload_box.send_keys(str(target_file)) upload_button.click() + # check that the selected files are displayed + selected_files = driver.find_element(By.ID, f"selected_files{suffix}") + assert Path(selected_files.text).name == Path(exp_name).name + + if secondary: + event_order_displayed = driver.find_element(By.ID, "event-order") + AppHarness._poll_for(lambda: "chain_event" in event_order_displayed.text) + + state = await upload_file.get_state(substate_token) + # only the secondary form tracks progress and chain events + assert state.substates[state_name].event_order.count("upload_progress") == 1 + assert state.substates[state_name].event_order.count("chain_event") == 1 + # look up the backend state and assert on uploaded contents async def get_file_data(): return ( @@ -217,16 +285,6 @@ async def test_upload_file( normalized_file_data = {Path(k).name: v for k, v in file_data.items()} assert normalized_file_data[Path(exp_name).name] == exp_contents - # check that the selected files are displayed - selected_files = driver.find_element(By.ID, f"selected_files{suffix}") - assert Path(selected_files.text).name == Path(exp_name).name - - state = await upload_file.get_state(substate_token) - if secondary: - # only the secondary form tracks progress and chain events - assert state.substates[state_name].event_order.count("upload_progress") == 1 - assert state.substates[state_name].event_order.count("chain_event") == 1 - @pytest.mark.asyncio async def test_upload_file_multiple(tmp_path, upload_file: AppHarness, driver): @@ -238,11 +296,7 @@ async def test_upload_file_multiple(tmp_path, upload_file: AppHarness, driver): driver: WebDriver instance. """ assert upload_file.app_instance is not None - token_input = driver.find_element(By.ID, "token") - assert token_input - # wait for the backend connection to send the token - token = upload_file.poll_for_value(token_input) - assert token is not None + token = poll_for_token(driver, upload_file) full_state_name = upload_file.get_full_state_name(["_upload_state"]) state_name = upload_file.get_state_name("_upload_state") substate_token = f"{token}_{full_state_name}" @@ -301,11 +355,7 @@ def test_clear_files( secondary: whether to use the secondary upload form. """ assert upload_file.app_instance is not None - token_input = driver.find_element(By.ID, "token") - assert token_input - # wait for the backend connection to send the token - token = upload_file.poll_for_value(token_input) - assert token is not None + poll_for_token(driver, upload_file) suffix = "_secondary" if secondary else "" @@ -357,11 +407,7 @@ async def test_cancel_upload(tmp_path, upload_file: AppHarness, driver: WebDrive driver: WebDriver instance. """ assert upload_file.app_instance is not None - token_input = driver.find_element(By.ID, "token") - assert token_input - # wait for the backend connection to send the token - token = upload_file.poll_for_value(token_input) - assert token is not None + token = poll_for_token(driver, upload_file) state_name = upload_file.get_state_name("_upload_state") state_full_name = upload_file.get_full_state_name(["_upload_state"]) substate_token = f"{token}_{state_full_name}" @@ -381,12 +427,77 @@ async def test_cancel_upload(tmp_path, upload_file: AppHarness, driver: WebDrive await asyncio.sleep(0.3) cancel_button.click() - # look up the backend state and assert on progress + # Wait a bit for the upload to get cancelled. + await asyncio.sleep(0.5) + + # Get interim progress dicts saved in the on_upload_progress handler. + async def _progress_dicts(): + state = await upload_file.get_state(substate_token) + return state.substates[state_name].progress_dicts + + # We should have _some_ progress + assert await AppHarness._poll_for_async(_progress_dicts) + + # But there should never be a final progress record for a cancelled upload. + for p in await _progress_dicts(): + assert p["progress"] != 1 + state = await upload_file.get_state(substate_token) - assert state.substates[state_name].progress_dicts file_data = state.substates[state_name]._file_data assert isinstance(file_data, dict) normalized_file_data = {Path(k).name: v for k, v in file_data.items()} assert Path(exp_name).name not in normalized_file_data target_file.unlink() + + +@pytest.mark.asyncio +async def test_upload_download_file( + tmp_path, + upload_file: AppHarness, + driver: WebDriver, +): + """Submit a file upload and then fetch it with rx.download. + + This checks the special case `getBackendURL` logic in the _download event + handler in state.js. + + Args: + tmp_path: pytest tmp_path fixture + upload_file: harness for UploadFile app. + driver: WebDriver instance. + """ + assert upload_file.app_instance is not None + poll_for_token(driver, upload_file) + + upload_box = driver.find_elements(By.XPATH, "//input[@type='file']")[2] + assert upload_box + upload_button = driver.find_element(By.ID, "upload_button_tertiary") + assert upload_button + + exp_name = "test.txt" + exp_contents = "test file contents!" + target_file = tmp_path / exp_name + target_file.write_text(exp_contents) + + upload_box.send_keys(str(target_file)) + upload_button.click() + + # Download via event embedded in frontend code. + download_frontend = driver.find_element(By.ID, "download-frontend") + with poll_for_navigation(driver): + download_frontend.click() + assert urlsplit(driver.current_url).path == f"/{Endpoint.UPLOAD.value}/test.txt" + assert driver.find_element(by=By.TAG_NAME, value="body").text == exp_contents + + # Go back and wait for the app to reload. + with poll_for_navigation(driver): + driver.back() + poll_for_token(driver, upload_file) + + # Download via backend event handler. + download_backend = driver.find_element(By.ID, "download-backend") + with poll_for_navigation(driver): + download_backend.click() + assert urlsplit(driver.current_url).path == f"/{Endpoint.UPLOAD.value}/test.txt" + assert driver.find_element(by=By.TAG_NAME, value="body").text == exp_contents diff --git a/tests/integration/tests_playwright/test_appearance.py b/tests/integration/tests_playwright/test_appearance.py new file mode 100644 index 000000000..60aeeaa6b --- /dev/null +++ b/tests/integration/tests_playwright/test_appearance.py @@ -0,0 +1,218 @@ +from typing import Generator + +import pytest +from playwright.sync_api import Page, expect + +from reflex.testing import AppHarness + + +def DefaultLightModeApp(): + import reflex as rx + from reflex.style import color_mode + + app = rx.App(theme=rx.theme(appearance="light")) + + @app.add_page + def index(): + return rx.text(color_mode) + + +def DefaultDarkModeApp(): + import reflex as rx + from reflex.style import color_mode + + app = rx.App(theme=rx.theme(appearance="dark")) + + @app.add_page + def index(): + return rx.text(color_mode) + + +def DefaultSystemModeApp(): + import reflex as rx + from reflex.style import color_mode + + app = rx.App() + + @app.add_page + def index(): + return rx.text(color_mode) + + +def ColorToggleApp(): + import reflex as rx + from reflex.style import color_mode, resolved_color_mode, set_color_mode + + app = rx.App(theme=rx.theme(appearance="light")) + + @app.add_page + def index(): + return rx.box( + rx.segmented_control.root( + rx.segmented_control.item( + rx.icon(tag="monitor", size=20), + value="system", + ), + rx.segmented_control.item( + rx.icon(tag="sun", size=20), + value="light", + ), + rx.segmented_control.item( + rx.icon(tag="moon", size=20), + value="dark", + ), + on_change=set_color_mode, + variant="classic", + radius="large", + value=color_mode, + ), + rx.text(color_mode, id="current_color_mode"), + rx.text(resolved_color_mode, id="resolved_color_mode"), + rx.text(rx.color_mode_cond("LightMode", "DarkMode"), id="color_mode_cond"), + ) + + +@pytest.fixture() +def light_mode_app(tmp_path_factory) -> Generator[AppHarness, None, None]: + """Start DefaultLightMode app at tmp_path via AppHarness. + + Args: + tmp_path_factory: pytest tmp_path_factory fixture + + Yields: + running AppHarness instance + + """ + with AppHarness.create( + root=tmp_path_factory.mktemp("appearance_app"), + app_source=DefaultLightModeApp, # type: ignore + ) as harness: + assert harness.app_instance is not None, "app is not running" + yield harness + + +@pytest.fixture() +def dark_mode_app(tmp_path_factory) -> Generator[AppHarness, None, None]: + """Start DefaultDarkMode app at tmp_path via AppHarness. + + Args: + tmp_path_factory: pytest tmp_path_factory fixture + + Yields: + running AppHarness instance + + """ + with AppHarness.create( + root=tmp_path_factory.mktemp("appearance_app"), + app_source=DefaultDarkModeApp, # type: ignore + ) as harness: + assert harness.app_instance is not None, "app is not running" + yield harness + + +@pytest.fixture() +def system_mode_app(tmp_path_factory) -> Generator[AppHarness, None, None]: + """Start DefaultSystemMode app at tmp_path via AppHarness. + + Args: + tmp_path_factory: pytest tmp_path_factory fixture + + Yields: + running AppHarness instance + + """ + with AppHarness.create( + root=tmp_path_factory.mktemp("appearance_app"), + app_source=DefaultSystemModeApp, # type: ignore + ) as harness: + assert harness.app_instance is not None, "app is not running" + yield harness + + +@pytest.fixture() +def color_toggle_app(tmp_path_factory) -> Generator[AppHarness, None, None]: + """Start ColorToggle app at tmp_path via AppHarness. + + Args: + tmp_path_factory: pytest tmp_path_factory fixture + + Yields: + running AppHarness instance + + """ + with AppHarness.create( + root=tmp_path_factory.mktemp("appearance_app"), + app_source=ColorToggleApp, # type: ignore + ) as harness: + assert harness.app_instance is not None, "app is not running" + yield harness + + +def test_appearance_light_mode(light_mode_app: AppHarness, page: Page): + assert light_mode_app.frontend_url is not None + page.goto(light_mode_app.frontend_url) + + expect(page.get_by_text("light")).to_be_visible() + + +def test_appearance_dark_mode(dark_mode_app: AppHarness, page: Page): + assert dark_mode_app.frontend_url is not None + page.goto(dark_mode_app.frontend_url) + + expect(page.get_by_text("dark")).to_be_visible() + + +def test_appearance_system_mode(system_mode_app: AppHarness, page: Page): + assert system_mode_app.frontend_url is not None + page.goto(system_mode_app.frontend_url) + + expect(page.get_by_text("system")).to_be_visible() + + +def test_appearance_color_toggle(color_toggle_app: AppHarness, page: Page): + assert color_toggle_app.frontend_url is not None + page.goto(color_toggle_app.frontend_url) + + # Radio buttons locators. + radio_system = page.get_by_role("radio").nth(0) + radio_light = page.get_by_role("radio").nth(1) + radio_dark = page.get_by_role("radio").nth(2) + + # Text locators to check. + current_color_mode = page.locator("id=current_color_mode") + resolved_color_mode = page.locator("id=resolved_color_mode") + color_mode_cond = page.locator("id=color_mode_cond") + root_body = page.locator('div[data-is-root-theme="true"]') + + # Background colors. + dark_background = "rgb(17, 17, 19)" # value based on dark native appearance, can change depending on the browser + light_background = "rgb(255, 255, 255)" + + # check initial state + expect(current_color_mode).to_have_text("light") + expect(resolved_color_mode).to_have_text("light") + expect(color_mode_cond).to_have_text("LightMode") + expect(root_body).to_have_css("background-color", light_background) + + # click dark mode + radio_dark.click() + expect(current_color_mode).to_have_text("dark") + expect(resolved_color_mode).to_have_text("dark") + expect(color_mode_cond).to_have_text("DarkMode") + expect(root_body).to_have_css("background-color", dark_background) + + # click light mode + radio_light.click() + expect(current_color_mode).to_have_text("light") + expect(resolved_color_mode).to_have_text("light") + expect(color_mode_cond).to_have_text("LightMode") + expect(root_body).to_have_css("background-color", light_background) + page.reload() + expect(root_body).to_have_css("background-color", light_background) + + # click system mode + radio_system.click() + expect(current_color_mode).to_have_text("system") + expect(resolved_color_mode).to_have_text("light") + expect(color_mode_cond).to_have_text("LightMode") + expect(root_body).to_have_css("background-color", light_background) diff --git a/tests/integration/tests_playwright/test_datetime_operations.py b/tests/integration/tests_playwright/test_datetime_operations.py new file mode 100644 index 000000000..fafd15c42 --- /dev/null +++ b/tests/integration/tests_playwright/test_datetime_operations.py @@ -0,0 +1,87 @@ +from typing import Generator + +import pytest +from playwright.sync_api import Page, expect + +from reflex.testing import AppHarness + + +def DatetimeOperationsApp(): + from datetime import datetime + + import reflex as rx + + class DtOperationsState(rx.State): + date1: datetime = datetime(2021, 1, 1) + date2: datetime = datetime(2031, 1, 1) + date3: datetime = datetime(2021, 1, 1) + + app = rx.App(state=DtOperationsState) + + @app.add_page + def index(): + return rx.vstack( + rx.text(DtOperationsState.date1, id="date1"), + rx.text(DtOperationsState.date2, id="date2"), + rx.text(DtOperationsState.date3, id="date3"), + rx.text("Operations between date1 and date2"), + rx.text(DtOperationsState.date1 == DtOperationsState.date2, id="1_eq_2"), + rx.text(DtOperationsState.date1 != DtOperationsState.date2, id="1_neq_2"), + rx.text(DtOperationsState.date1 < DtOperationsState.date2, id="1_lt_2"), + rx.text(DtOperationsState.date1 <= DtOperationsState.date2, id="1_le_2"), + rx.text(DtOperationsState.date1 > DtOperationsState.date2, id="1_gt_2"), + rx.text(DtOperationsState.date1 >= DtOperationsState.date2, id="1_ge_2"), + rx.text("Operations between date1 and date3"), + rx.text(DtOperationsState.date1 == DtOperationsState.date3, id="1_eq_3"), + rx.text(DtOperationsState.date1 != DtOperationsState.date3, id="1_neq_3"), + rx.text(DtOperationsState.date1 < DtOperationsState.date3, id="1_lt_3"), + rx.text(DtOperationsState.date1 <= DtOperationsState.date3, id="1_le_3"), + rx.text(DtOperationsState.date1 > DtOperationsState.date3, id="1_gt_3"), + rx.text(DtOperationsState.date1 >= DtOperationsState.date3, id="1_ge_3"), + ) + + +@pytest.fixture() +def datetime_operations_app(tmp_path_factory) -> Generator[AppHarness, None, None]: + """Start Table app at tmp_path via AppHarness. + + Args: + tmp_path_factory: pytest tmp_path_factory fixture + + Yields: + running AppHarness instance + + """ + with AppHarness.create( + root=tmp_path_factory.mktemp("datetime_operations_app"), + app_source=DatetimeOperationsApp, # type: ignore + ) as harness: + assert harness.app_instance is not None, "app is not running" + yield harness + + +def test_datetime_operations(datetime_operations_app: AppHarness, page: Page): + assert datetime_operations_app.frontend_url is not None + + page.goto(datetime_operations_app.frontend_url) + expect(page).to_have_url(datetime_operations_app.frontend_url + "/") + # Check the actual values + expect(page.locator("id=date1")).to_have_text("2021-01-01 00:00:00") + expect(page.locator("id=date2")).to_have_text("2031-01-01 00:00:00") + expect(page.locator("id=date3")).to_have_text("2021-01-01 00:00:00") + + # Check the operations between date1 and date2 + expect(page.locator("id=1_eq_2")).to_have_text("false") + expect(page.locator("id=1_neq_2")).to_have_text("true") + expect(page.locator("id=1_lt_2")).to_have_text("true") + expect(page.locator("id=1_le_2")).to_have_text("true") + expect(page.locator("id=1_gt_2")).to_have_text("false") + expect(page.locator("id=1_ge_2")).to_have_text("false") + + # Check the operations between date1 and date3 + expect(page.locator("id=1_eq_3")).to_have_text("true") + expect(page.locator("id=1_neq_3")).to_have_text("false") + expect(page.locator("id=1_lt_3")).to_have_text("false") + expect(page.locator("id=1_le_3")).to_have_text("true") + expect(page.locator("id=1_gt_3")).to_have_text("false") + expect(page.locator("id=1_ge_3")).to_have_text("true") diff --git a/tests/integration/tests_playwright/test_link_hover.py b/tests/integration/tests_playwright/test_link_hover.py new file mode 100644 index 000000000..9510bd358 --- /dev/null +++ b/tests/integration/tests_playwright/test_link_hover.py @@ -0,0 +1,46 @@ +from typing import Generator + +import pytest +from playwright.sync_api import Page, expect + +from reflex.testing import AppHarness + + +def LinkApp(): + import reflex as rx + + app = rx.App() + + def index(): + return rx.vstack( + rx.box(height="10em"), # spacer, so the link isn't hovered initially + rx.link( + "Click me", + href="#", + color="blue", + _hover=rx.Style({"color": "red"}), + ), + ) + + app.add_page(index, "/") + + +@pytest.fixture() +def link_app(tmp_path_factory) -> Generator[AppHarness, None, None]: + with AppHarness.create( + root=tmp_path_factory.mktemp("link_app"), + app_source=LinkApp, # type: ignore + ) as harness: + assert harness.app_instance is not None, "app is not running" + yield harness + + +def test_link_hover(link_app: AppHarness, page: Page): + assert link_app.frontend_url is not None + page.goto(link_app.frontend_url) + + link = page.get_by_role("link") + expect(link).to_have_text("Click me") + expect(link).to_have_css("color", "rgb(0, 0, 255)") + link.hover() + expect(link).to_have_css("color", "rgb(255, 0, 0)") diff --git a/tests/integration/tests_playwright/test_table.py b/tests/integration/tests_playwright/test_table.py index 0a39b197e..db716aa5b 100644 --- a/tests/integration/tests_playwright/test_table.py +++ b/tests/integration/tests_playwright/test_table.py @@ -97,4 +97,5 @@ def test_table(page: Page, table_app: AppHarness): # Check cells rows = table.get_by_role("cell").all_inner_texts() for i, expected_row in enumerate(expected_cells_data): - assert [rows[idx := i * 2], rows[idx + 1]] == expected_row + idx = i * 2 + assert [rows[idx], rows[idx + 1]] == expected_row diff --git a/tests/units/components/base/test_bare.py b/tests/units/components/base/test_bare.py index c30ffaf15..178820cff 100644 --- a/tests/units/components/base/test_bare.py +++ b/tests/units/components/base/test_bare.py @@ -13,9 +13,6 @@ STATE_VAR = Var(_js_expr="default_state.name") ("{}", '{"{}"}'), (None, '{""}'), (STATE_VAR, "{default_state.name}"), - # This behavior is now unsupported. - # ("${default_state.name}", "${default_state.name}"), - # ("{state.name}", "{state.name}"), ], ) def test_fstrings(contents, expected): diff --git a/tests/units/components/core/test_banner.py b/tests/units/components/core/test_banner.py index fe6de5eae..e1498d12c 100644 --- a/tests/units/components/core/test_banner.py +++ b/tests/units/components/core/test_banner.py @@ -12,7 +12,7 @@ def test_websocket_target_url(): url = WebsocketTargetURL.create() var_data = url._get_all_var_data() assert var_data is not None - assert sorted(tuple((key for key, _ in var_data.imports))) == sorted( + assert sorted(key for key, _ in var_data.imports) == sorted( ("$/utils/state", "$/env.json") ) @@ -20,7 +20,7 @@ def test_websocket_target_url(): def test_connection_banner(): banner = ConnectionBanner.create() _imports = banner._get_all_imports(collapse=True) - assert sorted(tuple(_imports)) == sorted( + assert sorted(_imports) == sorted( ( "react", "$/utils/context", @@ -38,7 +38,7 @@ def test_connection_banner(): def test_connection_modal(): modal = ConnectionModal.create() _imports = modal._get_all_imports(collapse=True) - assert sorted(tuple(_imports)) == sorted( + assert sorted(_imports) == sorted( ( "react", "$/utils/context", diff --git a/tests/units/components/core/test_colors.py b/tests/units/components/core/test_colors.py index 74fbeb20f..c1295fb41 100644 --- a/tests/units/components/core/test_colors.py +++ b/tests/units/components/core/test_colors.py @@ -32,38 +32,38 @@ def create_color_var(color): (create_color_var(rx.color("mint", 3, True)), '"var(--mint-a3)"', Color), ( create_color_var(rx.color(ColorState.color, ColorState.shade)), # type: ignore - f'("var(--"+{str(color_state_name)}.color+"-"+(((__to_string) => __to_string.toString())({str(color_state_name)}.shade))+")")', + f'("var(--"+{color_state_name!s}.color+"-"+(((__to_string) => __to_string.toString())({color_state_name!s}.shade))+")")', Color, ), ( create_color_var( rx.color(ColorState.color, ColorState.shade, ColorState.alpha) # type: ignore ), - f'("var(--"+{str(color_state_name)}.color+"-"+({str(color_state_name)}.alpha ? "a" : "")+(((__to_string) => __to_string.toString())({str(color_state_name)}.shade))+")")', + f'("var(--"+{color_state_name!s}.color+"-"+({color_state_name!s}.alpha ? "a" : "")+(((__to_string) => __to_string.toString())({color_state_name!s}.shade))+")")', Color, ), ( create_color_var(rx.color(f"{ColorState.color}", f"{ColorState.shade}")), # type: ignore - f'("var(--"+{str(color_state_name)}.color+"-"+{str(color_state_name)}.shade+")")', + f'("var(--"+{color_state_name!s}.color+"-"+{color_state_name!s}.shade+")")', Color, ), ( create_color_var( rx.color(f"{ColorState.color_part}ato", f"{ColorState.shade}") # type: ignore ), - f'("var(--"+({str(color_state_name)}.color_part+"ato")+"-"+{str(color_state_name)}.shade+")")', + f'("var(--"+({color_state_name!s}.color_part+"ato")+"-"+{color_state_name!s}.shade+")")', Color, ), ( create_color_var(f'{rx.color(ColorState.color, f"{ColorState.shade}")}'), # type: ignore - f'("var(--"+{str(color_state_name)}.color+"-"+{str(color_state_name)}.shade+")")', + f'("var(--"+{color_state_name!s}.color+"-"+{color_state_name!s}.shade+")")', str, ), ( create_color_var( f'{rx.color(f"{ColorState.color}", f"{ColorState.shade}")}' # type: ignore ), - f'("var(--"+{str(color_state_name)}.color+"-"+{str(color_state_name)}.shade+")")', + f'("var(--"+{color_state_name!s}.color+"-"+{color_state_name!s}.shade+")")', str, ), ], @@ -82,7 +82,7 @@ def test_color(color, expected, expected_type: Union[Type[str], Type[Color]]): ), ( rx.cond(True, rx.color(ColorState.color), rx.color(ColorState.color, 5)), # type: ignore - f'(true ? ("var(--"+{str(color_state_name)}.color+"-7)") : ("var(--"+{str(color_state_name)}.color+"-5)"))', + f'(true ? ("var(--"+{color_state_name!s}.color+"-7)") : ("var(--"+{color_state_name!s}.color+"-5)"))', ), ( rx.match( @@ -93,7 +93,7 @@ def test_color(color, expected, expected_type: Union[Type[str], Type[Color]]): ), '(() => { switch (JSON.stringify("condition")) {case JSON.stringify("first"): return ("var(--mint-7)");' ' break;case JSON.stringify("second"): return ("var(--tomato-5)"); break;default: ' - f'return (("var(--"+{str(color_state_name)}.color+"-2)")); break;}};}})()', + f'return (("var(--"+{color_state_name!s}.color+"-2)")); break;}};}})()', ), ( rx.match( @@ -103,9 +103,9 @@ def test_color(color, expected, expected_type: Union[Type[str], Type[Color]]): rx.color(ColorState.color, 2), # type: ignore ), '(() => { switch (JSON.stringify("condition")) {case JSON.stringify("first"): ' - f'return (("var(--"+{str(color_state_name)}.color+"-7)")); break;case JSON.stringify("second"): ' - f'return (("var(--"+{str(color_state_name)}.color+"-5)")); break;default: ' - f'return (("var(--"+{str(color_state_name)}.color+"-2)")); break;}};}})()', + f'return (("var(--"+{color_state_name!s}.color+"-7)")); break;case JSON.stringify("second"): ' + f'return (("var(--"+{color_state_name!s}.color+"-5)")); break;default: ' + f'return (("var(--"+{color_state_name!s}.color+"-2)")); break;}};}})()', ), ], ) diff --git a/tests/units/components/core/test_cond.py b/tests/units/components/core/test_cond.py index f9bdc7d60..e88f35c9a 100644 --- a/tests/units/components/core/test_cond.py +++ b/tests/units/components/core/test_cond.py @@ -96,7 +96,7 @@ def test_prop_cond(c1: Any, c2: Any): c1 = json.dumps(c1) if not isinstance(c2, Var): c2 = json.dumps(c2) - assert str(prop_cond) == f"(true ? {str(c1)} : {str(c2)})" + assert str(prop_cond) == f"(true ? {c1!s} : {c2!s})" def test_cond_no_mix(): @@ -135,7 +135,7 @@ def test_cond_computed_var(): comp = cond(True, CondStateComputed.computed_int, CondStateComputed.computed_str) - # TODO: shouln't this be a ComputedVar? + # TODO: shouldn't this be a ComputedVar? assert isinstance(comp, Var) state_name = format_state_name(CondStateComputed.get_full_name()) diff --git a/tests/units/components/core/test_debounce.py b/tests/units/components/core/test_debounce.py index 2fad9c925..29d3bcddc 100644 --- a/tests/units/components/core/test_debounce.py +++ b/tests/units/components/core/test_debounce.py @@ -108,7 +108,7 @@ def test_render_with_special_props(): ) )._render() assert len(tag.special_props) == 1 - assert list(tag.special_props)[0].equals(special_prop) + assert next(iter(tag.special_props)).equals(special_prop) def test_event_triggers(): diff --git a/tests/units/components/core/test_foreach.py b/tests/units/components/core/test_foreach.py index 228165d3e..094f6029d 100644 --- a/tests/units/components/core/test_foreach.py +++ b/tests/units/components/core/test_foreach.py @@ -1,8 +1,10 @@ from typing import Dict, List, Set, Tuple, Union +import pydantic.v1 import pytest from reflex import el +from reflex.base import Base from reflex.components.component import Component from reflex.components.core.foreach import ( Foreach, @@ -18,6 +20,12 @@ from reflex.vars.number import NumberVar from reflex.vars.sequence import ArrayVar +class ForEachTag(Base): + """A tag for testing the ForEach component.""" + + name: str = "" + + class ForEachState(BaseState): """A state for testing the ForEach component.""" @@ -46,6 +54,8 @@ class ForEachState(BaseState): bad_annotation_list: list = [["red", "orange"], ["yellow", "blue"]] color_index_tuple: Tuple[int, str] = (0, "red") + default_factory_list: list[ForEachTag] = pydantic.v1.Field(default_factory=list) + class ComponentStateTest(ComponentState): """A test component state.""" @@ -290,3 +300,11 @@ def test_foreach_component_state(): ForEachState.colors_list, ComponentStateTest.create, ) + + +def test_foreach_default_factory(): + """Test that the default factory is called.""" + _ = Foreach.create( + ForEachState.default_factory_list, + lambda tag: text(tag.name), + ) diff --git a/tests/units/components/core/test_html.py b/tests/units/components/core/test_html.py index 4847e1d5a..79c258dfb 100644 --- a/tests/units/components/core/test_html.py +++ b/tests/units/components/core/test_html.py @@ -33,9 +33,9 @@ def test_html_fstring_create(): assert ( str(html.dangerouslySetInnerHTML) # type: ignore - == f'({{ ["__html"] : ("

Hello "+{str(TestState.myvar)}+"!

") }})' + == f'({{ ["__html"] : ("

Hello "+{TestState.myvar!s}+"!

") }})' ) assert ( str(html) - == f'
' # type: ignore + == f'
' # type: ignore ) diff --git a/tests/units/components/media/test_image.py b/tests/units/components/media/test_image.py index f8618347c..742bd8c38 100644 --- a/tests/units/components/media/test_image.py +++ b/tests/units/components/media/test_image.py @@ -42,7 +42,7 @@ def test_set_src_str(): "`pic2.jpeg`", ) # For plain rx.el.img, an explicit var is not created, so the quoting happens later - # assert str(image.src) == "pic2.jpeg" # type: ignore + # assert str(image.src) == "pic2.jpeg" # type: ignore #noqa: ERA001 def test_set_src_img(pil_image: Img): diff --git a/tests/units/components/test_component.py b/tests/units/components/test_component.py index a2485d10e..674873b69 100644 --- a/tests/units/components/test_component.py +++ b/tests/units/components/test_component.py @@ -810,7 +810,8 @@ def test_component_create_unpack_tuple_child(test_component, element, expected): comp = test_component.create(element) assert len(comp.children) == 1 - assert isinstance((fragment_wrapper := comp.children[0]), Fragment) + fragment_wrapper = comp.children[0] + assert isinstance(fragment_wrapper, Fragment) assert fragment_wrapper.render() == expected @@ -917,17 +918,17 @@ def test_invalid_event_handler_args(component2, test_state): # # Event Handler types must match # with pytest.raises(EventHandlerArgTypeMismatch): # component2.create( - # on_user_visited_count_changed=test_state.do_something_with_bool - # ) + # on_user_visited_count_changed=test_state.do_something_with_bool # noqa: ERA001 RUF100 + # ) # noqa: ERA001 RUF100 # with pytest.raises(EventHandlerArgTypeMismatch): - # component2.create(on_user_list_changed=test_state.do_something_with_int) + # component2.create(on_user_list_changed=test_state.do_something_with_int) #noqa: ERA001 # with pytest.raises(EventHandlerArgTypeMismatch): - # component2.create(on_user_list_changed=test_state.do_something_with_list_int) + # component2.create(on_user_list_changed=test_state.do_something_with_list_int) #noqa: ERA001 - # component2.create(on_open=test_state.do_something_with_int) - # component2.create(on_open=test_state.do_something_with_bool) - # component2.create(on_user_visited_count_changed=test_state.do_something_with_int) - # component2.create(on_user_list_changed=test_state.do_something_with_list_str) + # component2.create(on_open=test_state.do_something_with_int) #noqa: ERA001 + # component2.create(on_open=test_state.do_something_with_bool) #noqa: ERA001 + # component2.create(on_user_visited_count_changed=test_state.do_something_with_int) #noqa: ERA001 + # component2.create(on_user_list_changed=test_state.do_something_with_list_str) #noqa: ERA001 # lambda cannot return weird values. with pytest.raises(ValueError): @@ -1436,8 +1437,6 @@ def test_get_vars(component, exp_vars): comp_vars, sorted(exp_vars, key=lambda v: v._js_expr), ): - # print(str(comp_var), str(exp_var)) - # print(comp_var._get_all_var_data(), exp_var._get_all_var_data()) assert comp_var.equals(exp_var) diff --git a/tests/units/conftest.py b/tests/units/conftest.py index 2f619a941..fb6229aca 100644 --- a/tests/units/conftest.py +++ b/tests/units/conftest.py @@ -206,7 +206,7 @@ class chdir(contextlib.AbstractContextManager): def __enter__(self): """Save current directory and perform chdir.""" - self._old_cwd.append(Path(".").resolve()) + self._old_cwd.append(Path.cwd()) os.chdir(self.path) def __exit__(self, *excinfo): diff --git a/tests/units/states/upload.py b/tests/units/states/upload.py index 338025bcd..66d9479b4 100644 --- a/tests/units/states/upload.py +++ b/tests/units/states/upload.py @@ -61,14 +61,13 @@ class FileUploadState(State): """ for file in files: upload_data = await file.read() - outfile = f"{self._tmp_path}/{file.filename}" + assert file.filename is not None + outfile = self._tmp_path / file.filename # Save the file. - with open(outfile, "wb") as file_object: - file_object.write(upload_data) + outfile.write_bytes(upload_data) # Update the img var. - assert file.filename is not None self.img_list.append(file.filename) @rx.event(background=True) @@ -109,14 +108,13 @@ class ChildFileUploadState(FileStateBase1): """ for file in files: upload_data = await file.read() - outfile = f"{self._tmp_path}/{file.filename}" + assert file.filename is not None + outfile = self._tmp_path / file.filename # Save the file. - with open(outfile, "wb") as file_object: - file_object.write(upload_data) + outfile.write_bytes(upload_data) # Update the img var. - assert file.filename is not None self.img_list.append(file.filename) @rx.event(background=True) @@ -157,14 +155,13 @@ class GrandChildFileUploadState(FileStateBase2): """ for file in files: upload_data = await file.read() - outfile = f"{self._tmp_path}/{file.filename}" + assert file.filename is not None + outfile = self._tmp_path / file.filename # Save the file. - with open(outfile, "wb") as file_object: - file_object.write(upload_data) + outfile.write_bytes(upload_data) # Update the img var. - assert file.filename is not None self.img_list.append(file.filename) @rx.event(background=True) diff --git a/tests/units/test_app.py b/tests/units/test_app.py index 216d36f62..48a4bdda1 100644 --- a/tests/units/test_app.py +++ b/tests/units/test_app.py @@ -899,8 +899,6 @@ class DynamicState(BaseState): loaded: int = 0 counter: int = 0 - # side_effect_counter: int = 0 - def on_load(self): """Event handler for page on_load, should trigger for all navigation events.""" self.loaded = self.loaded + 1 @@ -917,7 +915,6 @@ class DynamicState(BaseState): Returns: same as self.dynamic """ - # self.side_effect_counter = self.side_effect_counter + 1 return self.dynamic on_load_internal = OnLoadInternalState.on_load_internal.fn @@ -1059,7 +1056,6 @@ async def test_dynamic_route_var_route_change_completed_on_load( arg_name: exp_val, f"comp_{arg_name}": exp_val, constants.CompileVars.IS_HYDRATED: False, - # "side_effect_counter": exp_index, "router": exp_router, } }, @@ -1155,8 +1151,6 @@ async def test_dynamic_route_var_route_change_completed_on_load( state = await app.state_manager.get_state(substate_token) assert state.loaded == len(exp_vals) assert state.counter == len(exp_vals) - # print(f"Expected {exp_vals} rendering side effects, got {state.side_effect_counter}") - # assert state.side_effect_counter == len(exp_vals) if isinstance(app.state_manager, StateManagerRedis): await app.state_manager.close() @@ -1479,17 +1473,20 @@ def test_add_page_component_returning_tuple(): app._compile_page("index") app._compile_page("page2") - assert isinstance((fragment_wrapper := app.pages["index"].children[0]), Fragment) - assert isinstance((first_text := fragment_wrapper.children[0]), Text) + fragment_wrapper = app.pages["index"].children[0] + assert isinstance(fragment_wrapper, Fragment) + first_text = fragment_wrapper.children[0] + assert isinstance(first_text, Text) assert str(first_text.children[0].contents) == '"first"' # type: ignore - assert isinstance((second_text := fragment_wrapper.children[1]), Text) + second_text = fragment_wrapper.children[1] + assert isinstance(second_text, Text) assert str(second_text.children[0].contents) == '"second"' # type: ignore # Test page with trailing comma. - assert isinstance( - (page2_fragment_wrapper := app.pages["page2"].children[0]), Fragment - ) - assert isinstance((third_text := page2_fragment_wrapper.children[0]), Text) + page2_fragment_wrapper = app.pages["page2"].children[0] + assert isinstance(page2_fragment_wrapper, Fragment) + third_text = page2_fragment_wrapper.children[0] + assert isinstance(third_text, Text) assert str(third_text.children[0].contents) == '"third"' # type: ignore diff --git a/tests/units/test_attribute_access_type.py b/tests/units/test_attribute_access_type.py index 0d490ec1e..d08c17c8c 100644 --- a/tests/units/test_attribute_access_type.py +++ b/tests/units/test_attribute_access_type.py @@ -3,11 +3,19 @@ from __future__ import annotations from typing import Dict, List, Optional, Type, Union import attrs +import pydantic.v1 import pytest import sqlalchemy +import sqlmodel from sqlalchemy import JSON, TypeDecorator from sqlalchemy.ext.hybrid import hybrid_property -from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column, relationship +from sqlalchemy.orm import ( + DeclarativeBase, + Mapped, + MappedAsDataclass, + mapped_column, + relationship, +) import reflex as rx from reflex.utils.types import GenericType, get_attribute_access_type @@ -53,6 +61,10 @@ class SQLALabel(SQLABase): id: Mapped[int] = mapped_column(primary_key=True) test_id: Mapped[int] = mapped_column(sqlalchemy.ForeignKey("test.id")) test: Mapped[SQLAClass] = relationship(back_populates="labels") + test_dataclass_id: Mapped[int] = mapped_column( + sqlalchemy.ForeignKey("test_dataclass.id") + ) + test_dataclass: Mapped[SQLAClassDataclass] = relationship(back_populates="labels") class SQLAClass(SQLABase): @@ -104,9 +116,64 @@ class SQLAClass(SQLABase): return self.labels[0] if self.labels else None +class SQLAClassDataclass(MappedAsDataclass, SQLABase): + """Test sqlalchemy model.""" + + id: Mapped[int] = mapped_column(primary_key=True) + no_default: Mapped[int] = mapped_column(nullable=True) + count: Mapped[int] = mapped_column() + name: Mapped[str] = mapped_column() + int_list: Mapped[List[int]] = mapped_column( + sqlalchemy.types.ARRAY(item_type=sqlalchemy.INTEGER) + ) + str_list: Mapped[List[str]] = mapped_column( + sqlalchemy.types.ARRAY(item_type=sqlalchemy.String) + ) + optional_int: Mapped[Optional[int]] = mapped_column(nullable=True) + sqla_tag_id: Mapped[int] = mapped_column(sqlalchemy.ForeignKey(SQLATag.id)) + sqla_tag: Mapped[Optional[SQLATag]] = relationship() + labels: Mapped[List[SQLALabel]] = relationship(back_populates="test_dataclass") + # do not use lower case dict here! + # https://github.com/sqlalchemy/sqlalchemy/issues/9902 + dict_str_str: Mapped[Dict[str, str]] = mapped_column() + default_factory: Mapped[List[int]] = mapped_column( + sqlalchemy.types.ARRAY(item_type=sqlalchemy.INTEGER), + default_factory=list, + ) + __tablename__: str = "test_dataclass" + + @property + def str_property(self) -> str: + """String property. + + Returns: + Name attribute + """ + return self.name + + @hybrid_property + def str_or_int_property(self) -> Union[str, int]: + """String or int property. + + Returns: + Name attribute + """ + return self.name + + @hybrid_property + def first_label(self) -> Optional[SQLALabel]: + """First label property. + + Returns: + First label + """ + return self.labels[0] if self.labels else None + + class ModelClass(rx.Model): """Test reflex model.""" + no_default: Optional[int] = sqlmodel.Field(nullable=True) count: int = 0 name: str = "test" int_list: List[int] = [] @@ -115,6 +182,7 @@ class ModelClass(rx.Model): sqla_tag: Optional[SQLATag] = None labels: List[SQLALabel] = [] dict_str_str: Dict[str, str] = {} + default_factory: List[int] = sqlmodel.Field(default_factory=list) @property def str_property(self) -> str: @@ -147,6 +215,7 @@ class ModelClass(rx.Model): class BaseClass(rx.Base): """Test rx.Base class.""" + no_default: Optional[int] = pydantic.v1.Field(required=False) count: int = 0 name: str = "test" int_list: List[int] = [] @@ -155,6 +224,7 @@ class BaseClass(rx.Base): sqla_tag: Optional[SQLATag] = None labels: List[SQLALabel] = [] dict_str_str: Dict[str, str] = {} + default_factory: List[int] = pydantic.v1.Field(default_factory=list) @property def str_property(self) -> str: @@ -236,6 +306,7 @@ class AttrClass: sqla_tag: Optional[SQLATag] = None labels: List[SQLALabel] = [] dict_str_str: Dict[str, str] = {} + default_factory: List[int] = attrs.field(factory=list) @property def str_property(self) -> str: @@ -265,27 +336,17 @@ class AttrClass: return self.labels[0] if self.labels else None -@pytest.fixture( - params=[ +@pytest.mark.parametrize( + "cls", + [ SQLAClass, + SQLAClassDataclass, BaseClass, BareClass, ModelClass, AttrClass, - ] + ], ) -def cls(request: pytest.FixtureRequest) -> type: - """Fixture for the class to test. - - Args: - request: pytest request object. - - Returns: - Class to test. - """ - return request.param - - @pytest.mark.parametrize( "attr, expected", [ @@ -311,3 +372,38 @@ def test_get_attribute_access_type(cls: type, attr: str, expected: GenericType) expected: Expected type. """ assert get_attribute_access_type(cls, attr) == expected + + +@pytest.mark.parametrize( + "cls", + [ + SQLAClassDataclass, + BaseClass, + ModelClass, + AttrClass, + ], +) +def test_get_attribute_access_type_default_factory(cls: type) -> None: + """Test get_attribute_access_type returns the correct type for default factory fields. + + Args: + cls: Class to test. + """ + assert get_attribute_access_type(cls, "default_factory") == List[int] + + +@pytest.mark.parametrize( + "cls", + [ + SQLAClassDataclass, + BaseClass, + ModelClass, + ], +) +def test_get_attribute_access_type_no_default(cls: type) -> None: + """Test get_attribute_access_type returns the correct type for fields with no default which are not required. + + Args: + cls: Class to test. + """ + assert get_attribute_access_type(cls, "no_default") == Optional[int] diff --git a/tests/units/test_db_config.py b/tests/units/test_db_config.py index b8d7c07cb..5b716e6bb 100644 --- a/tests/units/test_db_config.py +++ b/tests/units/test_db_config.py @@ -164,7 +164,7 @@ def test_constructor_postgresql(username, password, host, port, database, expect "localhost", 5432, "db", - "postgresql+psycopg2://user:pass@localhost:5432/db", + "postgresql+psycopg://user:pass@localhost:5432/db", ), ( "user", @@ -172,17 +172,17 @@ def test_constructor_postgresql(username, password, host, port, database, expect "localhost", None, "db", - "postgresql+psycopg2://user@localhost/db", + "postgresql+psycopg://user@localhost/db", ), - ("user", "", "", None, "db", "postgresql+psycopg2://user@/db"), - ("", "", "localhost", 5432, "db", "postgresql+psycopg2://localhost:5432/db"), - ("", "", "", None, "db", "postgresql+psycopg2:///db"), + ("user", "", "", None, "db", "postgresql+psycopg://user@/db"), + ("", "", "localhost", 5432, "db", "postgresql+psycopg://localhost:5432/db"), + ("", "", "", None, "db", "postgresql+psycopg:///db"), ], ) -def test_constructor_postgresql_psycopg2( +def test_constructor_postgresql_psycopg( username, password, host, port, database, expected_url ): - """Test DBConfig.postgresql_psycopg2 constructor creates the instance correctly. + """Test DBConfig.postgresql_psycopg constructor creates the instance correctly. Args: username: Database username. @@ -192,10 +192,10 @@ def test_constructor_postgresql_psycopg2( database: Database name. expected_url: Expected database URL generated. """ - db_config = DBConfig.postgresql_psycopg2( + db_config = DBConfig.postgresql_psycopg( username=username, password=password, host=host, port=port, database=database ) - assert db_config.engine == "postgresql+psycopg2" + assert db_config.engine == "postgresql+psycopg" assert db_config.username == username assert db_config.password == password assert db_config.host == host diff --git a/tests/units/test_event.py b/tests/units/test_event.py index 4399ab2a0..d7e993efa 100644 --- a/tests/units/test_event.py +++ b/tests/units/test_event.py @@ -209,10 +209,6 @@ def test_event_redirect(input, output): assert isinstance(spec, EventSpec) assert spec.handler.fn.__qualname__ == "_redirect" - # this asserts need comment about what it's testing (they fail with Var as input) - # assert spec.args[0][0].equals(Var(_js_expr="path")) - # assert spec.args[0][1].equals(Var(_js_expr="/path")) - assert format.format_event(spec) == output @@ -227,12 +223,17 @@ def test_event_console_log(): ) assert ( format.format_event(spec) - == 'Event("_call_function", {function:(() => (console["log"]("message")))})' + == 'Event("_call_function", {function:(() => (console["log"]("message"))),callback:null})' ) spec = event.console_log(Var(_js_expr="message")) assert ( format.format_event(spec) - == 'Event("_call_function", {function:(() => (console["log"](message)))})' + == 'Event("_call_function", {function:(() => (console["log"](message))),callback:null})' + ) + spec2 = event.console_log(Var(_js_expr="message2")).add_args(Var("throwaway")) + assert ( + format.format_event(spec2) + == 'Event("_call_function", {function:(() => (console["log"](message2))),callback:null})' ) @@ -247,12 +248,17 @@ def test_event_window_alert(): ) assert ( format.format_event(spec) - == 'Event("_call_function", {function:(() => (window["alert"]("message")))})' + == 'Event("_call_function", {function:(() => (window["alert"]("message"))),callback:null})' ) spec = event.window_alert(Var(_js_expr="message")) assert ( format.format_event(spec) - == 'Event("_call_function", {function:(() => (window["alert"](message)))})' + == 'Event("_call_function", {function:(() => (window["alert"](message))),callback:null})' + ) + spec2 = event.window_alert(Var(_js_expr="message2")).add_args(Var("throwaway")) + assert ( + format.format_event(spec2) + == 'Event("_call_function", {function:(() => (window["alert"](message2))),callback:null})' ) @@ -319,7 +325,7 @@ def test_remove_cookie_with_options(): assert spec.args[1][1].equals(LiteralVar.create(options)) assert ( format.format_event(spec) - == f'Event("_remove_cookie", {{key:"testkey",options:{str(LiteralVar.create(options))}}})' + == f'Event("_remove_cookie", {{key:"testkey",options:{LiteralVar.create(options)!s}}})' ) diff --git a/tests/units/test_health_endpoint.py b/tests/units/test_health_endpoint.py index fe350266f..6d12d79d6 100644 --- a/tests/units/test_health_endpoint.py +++ b/tests/units/test_health_endpoint.py @@ -15,11 +15,11 @@ from reflex.utils.prerequisites import get_redis_status "mock_redis_client, expected_status", [ # Case 1: Redis client is available and responds to ping - (Mock(ping=lambda: None), True), + (Mock(ping=lambda: None), {"redis": True}), # Case 2: Redis client raises RedisError - (Mock(ping=lambda: (_ for _ in ()).throw(RedisError)), False), + (Mock(ping=lambda: (_ for _ in ()).throw(RedisError)), {"redis": False}), # Case 3: Redis client is not used - (None, None), + (None, {"redis": None}), ], ) async def test_get_redis_status(mock_redis_client, expected_status, mocker): @@ -41,12 +41,12 @@ async def test_get_redis_status(mock_redis_client, expected_status, mocker): "mock_engine, execute_side_effect, expected_status", [ # Case 1: Database is accessible - (MagicMock(), None, True), + (MagicMock(), None, {"db": True}), # Case 2: Database connection error (OperationalError) ( MagicMock(), sqlalchemy.exc.OperationalError("error", "error", "error"), - False, + {"db": False}, ), ], ) @@ -74,25 +74,49 @@ async def test_get_db_status(mock_engine, execute_side_effect, expected_status, @pytest.mark.asyncio @pytest.mark.parametrize( - "db_status, redis_status, expected_status, expected_code", + "db_enabled, redis_enabled, db_status, redis_status, expected_status, expected_code", [ # Case 1: Both services are connected - (True, True, {"status": True, "db": True, "redis": True}, 200), + (True, True, True, True, {"status": True, "db": True, "redis": True}, 200), # Case 2: Database not connected, Redis connected - (False, True, {"status": False, "db": False, "redis": True}, 503), + (True, True, False, True, {"status": False, "db": False, "redis": True}, 503), # Case 3: Database connected, Redis not connected - (True, False, {"status": False, "db": True, "redis": False}, 503), + (True, True, True, False, {"status": False, "db": True, "redis": False}, 503), # Case 4: Both services not connected - (False, False, {"status": False, "db": False, "redis": False}, 503), + (True, True, False, False, {"status": False, "db": False, "redis": False}, 503), # Case 5: Database Connected, Redis not used - (True, None, {"status": True, "db": True, "redis": False}, 200), + (True, False, True, None, {"status": True, "db": True}, 200), + # Case 6: Database not used, Redis Connected + (False, True, None, True, {"status": True, "redis": True}, 200), + # Case 7: Both services not used + (False, False, None, None, {"status": True}, 200), ], ) -async def test_health(db_status, redis_status, expected_status, expected_code, mocker): +async def test_health( + db_enabled, + redis_enabled, + db_status, + redis_status, + expected_status, + expected_code, + mocker, +): # Mock get_db_status and get_redis_status - mocker.patch("reflex.app.get_db_status", return_value=db_status) mocker.patch( - "reflex.utils.prerequisites.get_redis_status", return_value=redis_status + "reflex.utils.prerequisites.check_db_used", + return_value=db_enabled, + ) + mocker.patch( + "reflex.utils.prerequisites.check_redis_used", + return_value=redis_enabled, + ) + mocker.patch( + "reflex.app.get_db_status", + return_value={"db": db_status}, + ) + mocker.patch( + "reflex.utils.prerequisites.get_redis_status", + return_value={"redis": redis_status}, ) # Call the async health function diff --git a/tests/units/test_model.py b/tests/units/test_model.py index ac8187e03..0a83f39ec 100644 --- a/tests/units/test_model.py +++ b/tests/units/test_model.py @@ -46,7 +46,7 @@ def test_default_primary_key(model_default_primary: Model): Args: model_default_primary: Fixture. """ - assert "id" in model_default_primary.__class__.__fields__ + assert "id" in type(model_default_primary).__fields__ def test_custom_primary_key(model_custom_primary: Model): @@ -55,7 +55,7 @@ def test_custom_primary_key(model_custom_primary: Model): Args: model_custom_primary: Fixture. """ - assert "id" not in model_custom_primary.__class__.__fields__ + assert "id" not in type(model_custom_primary).__fields__ @pytest.mark.filterwarnings( diff --git a/tests/units/test_prerequisites.py b/tests/units/test_prerequisites.py index 2497318e7..90afe0963 100644 --- a/tests/units/test_prerequisites.py +++ b/tests/units/test_prerequisites.py @@ -105,8 +105,8 @@ def test_initialize_requirements_txt_no_op(mocker): return_value=Mock(best=lambda: Mock(encoding="utf-8")), ) mock_fp_touch = mocker.patch("pathlib.Path.touch") - open_mock = mock_open(read_data="reflex==0.2.9") - mocker.patch("builtins.open", open_mock) + open_mock = mock_open(read_data="reflex==0.6.7") + mocker.patch("pathlib.Path.open", open_mock) initialize_requirements_txt() assert open_mock.call_count == 1 assert open_mock.call_args.kwargs["encoding"] == "utf-8" @@ -122,7 +122,7 @@ def test_initialize_requirements_txt_missing_reflex(mocker): return_value=Mock(best=lambda: Mock(encoding="utf-8")), ) open_mock = mock_open(read_data="random-package=1.2.3") - mocker.patch("builtins.open", open_mock) + mocker.patch("pathlib.Path.open", open_mock) initialize_requirements_txt() # Currently open for read, then open for append assert open_mock.call_count == 2 @@ -138,7 +138,7 @@ def test_initialize_requirements_txt_not_exist(mocker): # File does not exist, create file with reflex mocker.patch("pathlib.Path.exists", return_value=False) open_mock = mock_open() - mocker.patch("builtins.open", open_mock) + mocker.patch("pathlib.Path.open", open_mock) initialize_requirements_txt() assert open_mock.call_count == 2 # By default, use utf-8 encoding @@ -170,7 +170,7 @@ def test_requirements_txt_other_encoding(mocker): ) initialize_requirements_txt() open_mock = mock_open(read_data="random-package=1.2.3") - mocker.patch("builtins.open", open_mock) + mocker.patch("pathlib.Path.open", open_mock) initialize_requirements_txt() # Currently open for read, then open for append assert open_mock.call_count == 2 diff --git a/tests/units/test_sqlalchemy.py b/tests/units/test_sqlalchemy.py index b18799e0c..23e315785 100644 --- a/tests/units/test_sqlalchemy.py +++ b/tests/units/test_sqlalchemy.py @@ -127,8 +127,8 @@ def test_automigration( assert result[0].b == 4.2 # No-op - # assert Model.migrate(autogenerate=True) - # assert len(list(versions.glob("*.py"))) == 4 + # assert Model.migrate(autogenerate=True) #noqa: ERA001 + # assert len(list(versions.glob("*.py"))) == 4 #noqa: ERA001 # drop table (AlembicSecond) model_registry.get_metadata().clear() diff --git a/tests/units/test_state.py b/tests/units/test_state.py index 8e61b8dae..41fac443e 100644 --- a/tests/units/test_state.py +++ b/tests/units/test_state.py @@ -55,7 +55,13 @@ from reflex.state import ( ) from reflex.testing import chdir from reflex.utils import format, prerequisites, types -from reflex.utils.exceptions import ReflexRuntimeError, SetUndefinedStateVarError +from reflex.utils.exceptions import ( + InvalidLockWarningThresholdError, + ReflexRuntimeError, + SetUndefinedStateVarError, + StateSerializationError, + UnretrievableVarValueError, +) from reflex.utils.format import json_dumps from reflex.vars.base import Var, computed_var from tests.units.states.mutation import MutableSQLAModel, MutableTestState @@ -63,7 +69,9 @@ from tests.units.states.mutation import MutableSQLAModel, MutableTestState from .states import GenState CI = bool(os.environ.get("CI", False)) -LOCK_EXPIRATION = 2000 if CI else 300 +LOCK_EXPIRATION = 2500 if CI else 300 +LOCK_WARNING_THRESHOLD = 1000 if CI else 100 +LOCK_WARN_SLEEP = 1.5 if CI else 0.15 LOCK_EXPIRE_SLEEP = 2.5 if CI else 0.4 @@ -108,7 +116,7 @@ class TestState(BaseState): # Set this class as not test one __test__ = False - num1: int + num1: rx.Field[int] num2: float = 3.14 key: str map_key: str = "a" @@ -156,7 +164,7 @@ class ChildState(TestState): """A child state fixture.""" value: str - count: int = 23 + count: rx.Field[int] = rx.field(23) def change_both(self, value: str, count: int): """Change both the value and count. @@ -787,7 +795,6 @@ async def test_process_event_simple(test_state): assert test_state.num1 == 69 # The delta should contain the changes, including computed vars. - # assert update.delta == {"test_state": {"num1": 69, "sum": 72.14}} assert update.delta == { TestState.get_full_name(): {"num1": 69, "sum": 72.14, "upper": ""}, GrandchildState3.get_full_name(): {"computed": ""}, @@ -970,7 +977,7 @@ class InterdependentState(BaseState): """A state with 3 vars and 3 computed vars. x: a variable that no computed var depends on - v1: a varable that one computed var directly depeneds on + v1: a variable that one computed var directly depends on _v2: a backend variable that one computed var directly depends on v1x2: a computed var that depends on v1 @@ -1657,7 +1664,7 @@ async def state_manager(request) -> AsyncGenerator[StateManager, None]: @pytest.fixture() -def substate_token(state_manager, token): +def substate_token(state_manager, token) -> str: """A token + substate name for looking up in state manager. Args: @@ -1698,7 +1705,7 @@ async def test_state_manager_modify_state( assert not state_manager._states_locks[token].locked() # separate instances should NOT share locks - sm2 = state_manager.__class__(state=TestState) + sm2 = type(state_manager)(state=TestState) assert sm2._state_manager_lock is state_manager._state_manager_lock assert not sm2._states_locks if state_manager._states_locks: @@ -1784,6 +1791,7 @@ async def test_state_manager_lock_expire( substate_token_redis: A token + substate name for looking up in state manager. """ state_manager_redis.lock_expiration = LOCK_EXPIRATION + state_manager_redis.lock_warning_threshold = LOCK_WARNING_THRESHOLD async with state_manager_redis.modify_state(substate_token_redis): await asyncio.sleep(0.01) @@ -1808,6 +1816,7 @@ async def test_state_manager_lock_expire_contend( unexp_num1 = 666 state_manager_redis.lock_expiration = LOCK_EXPIRATION + state_manager_redis.lock_warning_threshold = LOCK_WARNING_THRESHOLD order = [] @@ -1837,6 +1846,57 @@ async def test_state_manager_lock_expire_contend( assert (await state_manager_redis.get_state(substate_token_redis)).num1 == exp_num1 +@pytest.mark.asyncio +async def test_state_manager_lock_warning_threshold_contend( + state_manager_redis: StateManager, token: str, substate_token_redis: str, mocker +): + """Test that the state manager triggers a warning when lock contention exceeds the warning threshold. + + Args: + state_manager_redis: A state manager instance. + token: A token. + substate_token_redis: A token + substate name for looking up in state manager. + mocker: Pytest mocker object. + """ + console_warn = mocker.patch("reflex.utils.console.warn") + + state_manager_redis.lock_expiration = LOCK_EXPIRATION + state_manager_redis.lock_warning_threshold = LOCK_WARNING_THRESHOLD + + order = [] + + async def _coro_blocker(): + async with state_manager_redis.modify_state(substate_token_redis): + order.append("blocker") + await asyncio.sleep(LOCK_WARN_SLEEP) + + tasks = [ + asyncio.create_task(_coro_blocker()), + ] + + await tasks[0] + console_warn.assert_called() + assert console_warn.call_count == 7 + + +class CopyingAsyncMock(AsyncMock): + """An AsyncMock, but deepcopy the args and kwargs first.""" + + def __call__(self, *args, **kwargs): + """Call the mock. + + Args: + args: the arguments passed to the mock + kwargs: the keyword arguments passed to the mock + + Returns: + The result of the mock call + """ + args = copy.deepcopy(args) + kwargs = copy.deepcopy(kwargs) + return super().__call__(*args, **kwargs) + + @pytest.fixture(scope="function") def mock_app_simple(monkeypatch) -> rx.App: """Simple Mock app fixture. @@ -1853,7 +1913,7 @@ def mock_app_simple(monkeypatch) -> rx.App: setattr(app_module, CompileVars.APP, app) app.state = TestState - app.event_namespace.emit = AsyncMock() # type: ignore + app.event_namespace.emit = CopyingAsyncMock() # type: ignore def _mock_get_app(*args, **kwargs): return app_module @@ -1877,6 +1937,14 @@ def mock_app(mock_app_simple: rx.App, state_manager: StateManager) -> rx.App: return mock_app_simple +@dataclasses.dataclass +class ModelDC: + """A dataclass.""" + + foo: str = "bar" + ls: list[dict] = dataclasses.field(default_factory=list) + + @pytest.mark.asyncio async def test_state_proxy(grandchild_state: GrandchildState, mock_app: rx.App): """Test that the state proxy works. @@ -1957,21 +2025,19 @@ async def test_state_proxy(grandchild_state: GrandchildState, mock_app: rx.App): mock_app.event_namespace.emit.assert_called_once() mcall = mock_app.event_namespace.emit.mock_calls[0] assert mcall.args[0] == str(SocketEvent.EVENT) - assert json.loads(mcall.args[1]) == dataclasses.asdict( - StateUpdate( - delta={ - parent_state.get_full_name(): { - "upper": "", - "sum": 3.14, - }, - grandchild_state.get_full_name(): { - "value2": "42", - }, - GrandchildState3.get_full_name(): { - "computed": "", - }, - } - ) + assert mcall.args[1] == StateUpdate( + delta={ + parent_state.get_full_name(): { + "upper": "", + "sum": 3.14, + }, + grandchild_state.get_full_name(): { + "value2": "42", + }, + GrandchildState3.get_full_name(): { + "computed": "", + }, + } ) assert mcall.kwargs["to"] == grandchild_state.router.session.session_id @@ -1981,6 +2047,7 @@ class BackgroundTaskState(BaseState): order: List[str] = [] dict_list: Dict[str, List[int]] = {"foo": [1, 2, 3]} + dc: ModelDC = ModelDC() def __init__(self, **kwargs): # noqa: D107 super().__init__(**kwargs) @@ -2006,10 +2073,18 @@ class BackgroundTaskState(BaseState): with pytest.raises(ImmutableStateError): self.order.append("bad idea") + with pytest.raises(ImmutableStateError): + # Cannot manipulate dataclass attributes. + self.dc.foo = "baz" + with pytest.raises(ImmutableStateError): # Even nested access to mutables raises an exception. self.dict_list["foo"].append(42) + with pytest.raises(ImmutableStateError): + # Cannot modify dataclass list attribute. + self.dc.ls.append({"foo": "bar"}) + with pytest.raises(ImmutableStateError): # Direct calling another handler that modifies state raises an exception. self.other() @@ -2153,51 +2228,51 @@ async def test_background_task_no_block(mock_app: rx.App, token: str): assert mock_app.event_namespace is not None emit_mock = mock_app.event_namespace.emit - first_ws_message = json.loads(emit_mock.mock_calls[0].args[1]) + first_ws_message = emit_mock.mock_calls[0].args[1] assert ( - first_ws_message["delta"][BackgroundTaskState.get_full_name()].pop("router") + first_ws_message.delta[BackgroundTaskState.get_full_name()].pop("router") is not None ) - assert first_ws_message == { - "delta": { + assert first_ws_message == StateUpdate( + delta={ BackgroundTaskState.get_full_name(): { "order": ["background_task:start"], "computed_order": ["background_task:start"], } }, - "events": [], - "final": True, - } + events=[], + final=True, + ) for call in emit_mock.mock_calls[1:5]: - assert json.loads(call.args[1]) == { - "delta": { + assert call.args[1] == StateUpdate( + delta={ BackgroundTaskState.get_full_name(): { "computed_order": ["background_task:start"], } }, - "events": [], - "final": True, - } - assert json.loads(emit_mock.mock_calls[-2].args[1]) == { - "delta": { + events=[], + final=True, + ) + assert emit_mock.mock_calls[-2].args[1] == StateUpdate( + delta={ BackgroundTaskState.get_full_name(): { "order": exp_order, "computed_order": exp_order, "dict_list": {}, } }, - "events": [], - "final": True, - } - assert json.loads(emit_mock.mock_calls[-1].args[1]) == { - "delta": { + events=[], + final=True, + ) + assert emit_mock.mock_calls[-1].args[1] == StateUpdate( + delta={ BackgroundTaskState.get_full_name(): { "computed_order": exp_order, }, }, - "events": [], - "final": True, - } + events=[], + final=True, + ) @pytest.mark.asyncio @@ -2552,7 +2627,7 @@ def test_duplicate_substate_class(mocker): class TestState(BaseState): pass - class ChildTestState(TestState): # type: ignore # noqa + class ChildTestState(TestState): # type: ignore pass class ChildTestState(TestState): # type: ignore # noqa @@ -2628,7 +2703,7 @@ class Custom1(Base): self.foo = val def double_foo(self) -> str: - """Concantenate foo with foo. + """Concatenate foo with foo. Returns: foo + foo @@ -2669,23 +2744,23 @@ def test_state_union_optional(): c3r: Custom3 = Custom3(c2r=Custom2(c1r=Custom1(foo=""))) custom_union: Union[Custom1, Custom2, Custom3] = Custom1(foo="") - assert str(UnionState.c3.c2) == f'{str(UnionState.c3)}?.["c2"]' # type: ignore - assert str(UnionState.c3.c2.c1) == f'{str(UnionState.c3)}?.["c2"]?.["c1"]' # type: ignore + assert str(UnionState.c3.c2) == f'{UnionState.c3!s}?.["c2"]' # type: ignore + assert str(UnionState.c3.c2.c1) == f'{UnionState.c3!s}?.["c2"]?.["c1"]' # type: ignore assert ( - str(UnionState.c3.c2.c1.foo) == f'{str(UnionState.c3)}?.["c2"]?.["c1"]?.["foo"]' # type: ignore + str(UnionState.c3.c2.c1.foo) == f'{UnionState.c3!s}?.["c2"]?.["c1"]?.["foo"]' # type: ignore ) assert ( - str(UnionState.c3.c2.c1r.foo) == f'{str(UnionState.c3)}?.["c2"]?.["c1r"]["foo"]' # type: ignore + str(UnionState.c3.c2.c1r.foo) == f'{UnionState.c3!s}?.["c2"]?.["c1r"]["foo"]' # type: ignore ) - assert str(UnionState.c3.c2r.c1) == f'{str(UnionState.c3)}?.["c2r"]["c1"]' # type: ignore + assert str(UnionState.c3.c2r.c1) == f'{UnionState.c3!s}?.["c2r"]["c1"]' # type: ignore assert ( - str(UnionState.c3.c2r.c1.foo) == f'{str(UnionState.c3)}?.["c2r"]["c1"]?.["foo"]' # type: ignore + str(UnionState.c3.c2r.c1.foo) == f'{UnionState.c3!s}?.["c2r"]["c1"]?.["foo"]' # type: ignore ) assert ( - str(UnionState.c3.c2r.c1r.foo) == f'{str(UnionState.c3)}?.["c2r"]["c1r"]["foo"]' # type: ignore + str(UnionState.c3.c2r.c1r.foo) == f'{UnionState.c3!s}?.["c2r"]["c1r"]["foo"]' # type: ignore ) - assert str(UnionState.c3i.c2) == f'{str(UnionState.c3i)}["c2"]' # type: ignore - assert str(UnionState.c3r.c2) == f'{str(UnionState.c3r)}["c2"]' # type: ignore + assert str(UnionState.c3i.c2) == f'{UnionState.c3i!s}["c2"]' # type: ignore + assert str(UnionState.c3r.c2) == f'{UnionState.c3r!s}["c2"]' # type: ignore assert UnionState.custom_union.foo is not None # type: ignore assert UnionState.custom_union.c1 is not None # type: ignore assert UnionState.custom_union.c1r is not None # type: ignore @@ -3210,9 +3285,9 @@ async def test_setvar(mock_app: rx.App, token: str): print(update) assert state.array == [43] - # Cannot setvar for non-existant var + # Cannot setvar for non-existent var with pytest.raises(AttributeError): - TestState.setvar("non_existant_var") + TestState.setvar("non_existent_var") # Cannot setvar for computed vars with pytest.raises(AttributeError): @@ -3234,12 +3309,42 @@ async def test_setvar_async_setter(): @pytest.mark.parametrize( "expiration_kwargs, expected_values", [ - ({"redis_lock_expiration": 20000}, (20000, constants.Expiration.TOKEN)), + ( + {"redis_lock_expiration": 20000}, + ( + 20000, + constants.Expiration.TOKEN, + constants.Expiration.LOCK_WARNING_THRESHOLD, + ), + ), ( {"redis_lock_expiration": 50000, "redis_token_expiration": 5600}, - (50000, 5600), + (50000, 5600, constants.Expiration.LOCK_WARNING_THRESHOLD), + ), + ( + {"redis_token_expiration": 7600}, + ( + constants.Expiration.LOCK, + 7600, + constants.Expiration.LOCK_WARNING_THRESHOLD, + ), + ), + ( + {"redis_lock_expiration": 50000, "redis_lock_warning_threshold": 1500}, + (50000, constants.Expiration.TOKEN, 1500), + ), + ( + {"redis_token_expiration": 5600, "redis_lock_warning_threshold": 3000}, + (constants.Expiration.LOCK, 5600, 3000), + ), + ( + { + "redis_lock_expiration": 50000, + "redis_token_expiration": 5600, + "redis_lock_warning_threshold": 2000, + }, + (50000, 5600, 2000), ), - ({"redis_token_expiration": 7600}, (constants.Expiration.LOCK, 7600)), ], ) def test_redis_state_manager_config_knobs(tmp_path, expiration_kwargs, expected_values): @@ -3269,6 +3374,44 @@ config = rx.Config( state_manager = StateManager.create(state=State) assert state_manager.lock_expiration == expected_values[0] # type: ignore assert state_manager.token_expiration == expected_values[1] # type: ignore + assert state_manager.lock_warning_threshold == expected_values[2] # type: ignore + + +@pytest.mark.skipif("REDIS_URL" not in os.environ, reason="Test requires redis") +@pytest.mark.parametrize( + "redis_lock_expiration, redis_lock_warning_threshold", + [ + (10000, 10000), + (20000, 30000), + ], +) +def test_redis_state_manager_config_knobs_invalid_lock_warning_threshold( + tmp_path, redis_lock_expiration, redis_lock_warning_threshold +): + proj_root = tmp_path / "project1" + proj_root.mkdir() + + config_string = f""" +import reflex as rx +config = rx.Config( + app_name="project1", + redis_url="redis://localhost:6379", + state_manager_mode="redis", + redis_lock_expiration = {redis_lock_expiration}, + redis_lock_warning_threshold = {redis_lock_warning_threshold}, +) + """ + + (proj_root / "rxconfig.py").write_text(dedent(config_string)) + + with chdir(proj_root): + # reload config for each parameter to avoid stale values + reflex.config.get_config(reload=True) + from reflex.state import State, StateManager + + with pytest.raises(InvalidLockWarningThresholdError): + StateManager.create(state=State) + del sys.modules[constants.Config.MODULE] class MixinState(State, mixin=True): @@ -3433,8 +3576,9 @@ def test_fallback_pickle(): # Some object, like generator, are still unpicklable with dill. state3 = DillState(_reflex_internal_init=True) # type: ignore state3._g = (i for i in range(10)) - pk3 = state3._serialize() - assert len(pk3) == 0 + + with pytest.raises(StateSerializationError): + _ = state3._serialize() def test_typed_state() -> None: @@ -3456,13 +3600,6 @@ class ModelV2(BaseModelV2): foo: str = "bar" -@dataclasses.dataclass -class ModelDC: - """A dataclass.""" - - foo: str = "bar" - - class PydanticState(rx.State): """A state with pydantic BaseModel vars.""" @@ -3484,11 +3621,22 @@ def test_mutable_models(): assert state.dirty_vars == {"v2"} state.dirty_vars.clear() - # Not yet supported ENG-4083 - # assert isinstance(state.dc, MutableProxy) - # state.dc.foo = "baz" - # assert state.dirty_vars == {"dc"} - # state.dirty_vars.clear() + assert isinstance(state.dc, MutableProxy) + state.dc.foo = "baz" + assert state.dirty_vars == {"dc"} + state.dirty_vars.clear() + assert state.dirty_vars == set() + state.dc.ls.append({"hi": "reflex"}) + assert state.dirty_vars == {"dc"} + state.dirty_vars.clear() + assert state.dirty_vars == set() + assert dataclasses.asdict(state.dc) == {"foo": "baz", "ls": [{"hi": "reflex"}]} + assert dataclasses.astuple(state.dc) == ("baz", [{"hi": "reflex"}]) + # creating a new instance shouldn't mark the state dirty + assert dataclasses.replace(state.dc, foo="quuc") == ModelDC( + foo="quuc", ls=[{"hi": "reflex"}] + ) + assert state.dirty_vars == set() def test_get_value(): @@ -3638,3 +3786,32 @@ async def test_upcast_event_handler_arg(handler, payload): state = UpcastState() async for update in state._process_event(handler, state, payload): assert update.delta == {UpcastState.get_full_name(): {"passed": True}} + + +@pytest.mark.asyncio +async def test_get_var_value(state_manager: StateManager, substate_token: str): + """Test that get_var_value works correctly. + + Args: + state_manager: The state manager to use. + substate_token: Token for the substate used by state_manager. + """ + state = await state_manager.get_state(substate_token) + + # State Var from same state + assert await state.get_var_value(TestState.num1) == 0 + state.num1 = 42 + assert await state.get_var_value(TestState.num1) == 42 + + # State Var from another state + child_state = await state.get_state(ChildState) + assert await state.get_var_value(ChildState.count) == 23 + child_state.count = 66 + assert await state.get_var_value(ChildState.count) == 66 + + # LiteralVar with known value + assert await state.get_var_value(rx.Var.create([1, 2, 3])) == [1, 2, 3] + + # Generic Var with no state + with pytest.raises(UnretrievableVarValueError): + await state.get_var_value(rx.Var("undefined")) diff --git a/tests/units/test_telemetry.py b/tests/units/test_telemetry.py index 25ad91323..d8a77dfd6 100644 --- a/tests/units/test_telemetry.py +++ b/tests/units/test_telemetry.py @@ -34,12 +34,6 @@ def test_disable(): @pytest.mark.parametrize("event", ["init", "reinit", "run-dev", "run-prod", "export"]) def test_send(mocker, event): httpx_post_mock = mocker.patch("httpx.post") - # mocker.patch( - # "builtins.open", - # mocker.mock_open( - # read_data='{"project_hash": "78285505863498957834586115958872998605"}' - # ), - # ) # Mock the read_text method of Path pathlib_path_read_text_mock = mocker.patch( diff --git a/tests/units/test_var.py b/tests/units/test_var.py index 4940246e7..bfa8aa35a 100644 --- a/tests/units/test_var.py +++ b/tests/units/test_var.py @@ -372,7 +372,7 @@ def test_basic_operations(TestObj): "var, expected", [ (v([1, 2, 3]), "[1, 2, 3]"), - (v(set([1, 2, 3])), "[1, 2, 3]"), + (v({1, 2, 3}), "[1, 2, 3]"), (v(["1", "2", "3"]), '["1", "2", "3"]'), ( Var(_js_expr="foo")._var_set_state("state").to(list), @@ -515,7 +515,7 @@ def test_var_indexing_types(var, type_): """Test that indexing returns valid types. Args: - var : The list, typle base var. + var : The list, tuple base var. type_ : The type on indexed object. """ @@ -903,7 +903,7 @@ def test_literal_var(): True, False, None, - set([1, 2, 3]), + {1, 2, 3}, ] ) assert ( @@ -1495,8 +1495,6 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s ) eval(f"operand1_var {operator} operand2_var") eval(f"operand2_var {operator} operand1_var") - # operand1_var.operation(op=operator, other=operand2_var) - # operand1_var.operation(op=operator, other=operand2_var, flip=True) @pytest.mark.parametrize( @@ -1770,14 +1768,12 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s ) def test_invalid_var_operations(operand1_var: Var, operand2_var, operators: List[str]): for operator in operators: - print(f"testing {operator} on {str(operand1_var)} and {str(operand2_var)}") + print(f"testing {operator} on {operand1_var!s} and {operand2_var!s}") with pytest.raises(TypeError): print(eval(f"operand1_var {operator} operand2_var")) - # operand1_var.operation(op=operator, other=operand2_var) with pytest.raises(TypeError): print(eval(f"operand2_var {operator} operand1_var")) - # operand1_var.operation(op=operator, other=operand2_var, flip=True) @pytest.mark.parametrize( diff --git a/tests/units/utils/test_format.py b/tests/units/utils/test_format.py index cd1d0179d..2a2aa8259 100644 --- a/tests/units/utils/test_format.py +++ b/tests/units/utils/test_format.py @@ -262,7 +262,7 @@ def test_to_kebab_case(input: str, output: str): ], ) def test_format_string(input: str, output: str): - """Test formating the input as JS string literal. + """Test formatting the input as JS string literal. Args: input: the input string. @@ -680,7 +680,7 @@ def test_format_array_ref(input, output): ], ) def test_format_library_name(input: str, output: str): - """Test formating a library name to remove the @version part. + """Test formatting a library name to remove the @version part. Args: input: the input string. diff --git a/tests/units/utils/test_serializers.py b/tests/units/utils/test_serializers.py index 355f40d3f..e5a47abaa 100644 --- a/tests/units/utils/test_serializers.py +++ b/tests/units/utils/test_serializers.py @@ -222,9 +222,10 @@ def test_serialize(value: Any, expected: str): '"2021-01-01 01:01:01.000001"', True, ), + (datetime.date(2021, 1, 1), '"2021-01-01"', True), (Color(color="slate", shade=1), '"var(--slate-1)"', True), (BaseSubclass, '"BaseSubclass"', True), - (Path("."), '"."', True), + (Path(), '"."', True), ], ) def test_serialize_var_to_str(value: Any, expected: str, exp_var_is_string: bool): diff --git a/tests/units/utils/test_types.py b/tests/units/utils/test_types.py index 623aacc1f..87790e979 100644 --- a/tests/units/utils/test_types.py +++ b/tests/units/utils/test_types.py @@ -17,7 +17,7 @@ def test_validate_literal_error_msg(params, allowed_value_str, value_str): types.validate_literal(*params) assert ( - err.value.args[0] == f"prop value for {str(params[0])} of the `{params[-1]}` " + err.value.args[0] == f"prop value for {params[0]!s} of the `{params[-1]}` " f"component should be one of the following: {allowed_value_str}. Got {value_str} instead" ) diff --git a/tests/units/utils/test_utils.py b/tests/units/utils/test_utils.py index dd1a3b3ef..f8573111c 100644 --- a/tests/units/utils/test_utils.py +++ b/tests/units/utils/test_utils.py @@ -270,7 +270,7 @@ def test_unsupported_literals(cls: type): ("appname2.io", "AppnameioConfig"), ], ) -def test_create_config(app_name, expected_config_name, mocker): +def test_create_config(app_name: str, expected_config_name: str, mocker): """Test templates.RXCONFIG is formatted with correct app name and config class name. Args: @@ -278,7 +278,7 @@ def test_create_config(app_name, expected_config_name, mocker): expected_config_name: Expected config name. mocker: Mocker object. """ - mocker.patch("builtins.open") + mocker.patch("pathlib.Path.write_text") tmpl_mock = mocker.patch("reflex.compiler.templates.RXCONFIG") prerequisites.create_config(app_name) tmpl_mock.render.assert_called_with( @@ -298,7 +298,7 @@ def tmp_working_dir(tmp_path): Yields: subdirectory of tmp_path which is now the current working directory. """ - old_pwd = Path(".").resolve() + old_pwd = Path.cwd() working_dir = tmp_path / "working_dir" working_dir.mkdir() os.chdir(working_dir) @@ -464,7 +464,7 @@ def test_node_install_unix(tmp_path, mocker, machine, system): mocker.patch("httpx.stream", return_value=Resp()) download = mocker.patch("reflex.utils.prerequisites.download_and_extract_fnm_zip") process = mocker.patch("reflex.utils.processes.new_process") - chmod = mocker.patch("reflex.utils.prerequisites.os.chmod") + chmod = mocker.patch("pathlib.Path.chmod") mocker.patch("reflex.utils.processes.stream_logs") prerequisites.install_node()