Skip to content

Commit

Permalink
Merge branch 'main' into lendemor/default_cache_rx_var
Browse files Browse the repository at this point in the history
  • Loading branch information
Lendemor committed Dec 9, 2024
2 parents 8d76ccb + 3d89d74 commit 1fb24f7
Show file tree
Hide file tree
Showing 321 changed files with 20,728 additions and 11,450 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@reflex-dev/reflex-team
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/check_node_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ jobs:
strategy:
matrix:
python-version: ['3.12']
split_index: [1, 2]
node-version: ['node']
fail-fast: false

steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_build_env
Expand All @@ -30,11 +33,11 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: |
poetry run uv pip install pyvirtualdisplay pillow
poetry run uv pip install pyvirtualdisplay pillow pytest-split
poetry run playwright install --with-deps
- run: |
poetry run pytest tests/test_node_version.py
poetry run pytest tests/integration
poetry run pytest tests/integration --splits 2 --group ${{matrix.split_index}}


2 changes: 1 addition & 1 deletion .github/workflows/check_outdated_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
echo "$outdated"
# Ignore 3rd party dependencies that are not updated.
filtered_outdated=$(echo "$outdated" | grep -vE 'Package|@chakra-ui|lucide-react|@splinetool/runtime|ag-grid-react|framer-motion|react-markdown|remark-math|remark-gfm|rehype-katex|rehype-raw' || true)
filtered_outdated=$(echo "$outdated" | grep -vE 'Package|@chakra-ui|lucide-react|@splinetool/runtime|ag-grid-react|framer-motion|react-markdown|remark-math|remark-gfm|rehype-katex|rehype-raw|remark-unwrap-images' || true)
no_extra=$(echo "$filtered_outdated" | grep -vE '\|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-' || true)
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/integration_app_harness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ concurrency:

on:
push:
branches: ['main']
branches: ["main"]
paths-ignore:
- '**/*.md'
- "**/*.md"
pull_request:
branches: ['main']
branches: ["main"]
paths-ignore:
- '**/*.md'
- "**/*.md"

permissions:
contents: read
Expand All @@ -22,8 +22,10 @@ jobs:
timeout-minutes: 30
strategy:
matrix:
state_manager: ['redis', 'memory']
python-version: ['3.11.5', '3.12.0']
state_manager: ["redis", "memory"]
split_index: [1, 2]
python-version: ["3.11.5", "3.12.0"]
fail-fast: false
runs-on: ubuntu-22.04
services:
# Label used to access the service container
Expand All @@ -45,13 +47,14 @@ jobs:
python-version: ${{ matrix.python-version }}
run-poetry-install: true
create-venv-at-path: .venv
- run: poetry run uv pip install pyvirtualdisplay pillow
- run: poetry run uv pip install pyvirtualdisplay pillow pytest-split
- name: Run app harness tests
env:
SCREENSHOT_DIR: /tmp/screenshots
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 pytest tests/integration
poetry run playwright install --with-deps
poetry run pytest tests/integration --splits 2 --group ${{matrix.split_index}}
- uses: actions/upload-artifact@v4
name: Upload failed test screenshots
if: always()
Expand Down
33 changes: 31 additions & 2 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
fail-fast: false
matrix:
# Show OS combos first in GUI
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest]
python-version: ['3.10.11', '3.11.4']

env:
Expand All @@ -145,7 +145,7 @@ jobs:

- name: Install Requirements for reflex-web
working-directory: ./reflex-web
run: poetry run uv pip install -r requirements.txt
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
- name: Init Website for reflex-web
Expand All @@ -162,7 +162,36 @@ 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:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fail_fast: true
repos:

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.6.9
rev: v0.7.4
hooks:
- id: ruff-format
args: [reflex, tests]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ You can create a multi-page app by adding more pages.

<div align="center">

📑 [Docs](https://reflex.dev/docs/getting-started/introduction) &nbsp; | &nbsp; 🗞️ [Blog](https://reflex.dev/blog) &nbsp; | &nbsp; 📱 [Component Library](https://reflex.dev/docs/library) &nbsp; | &nbsp; 🖼️ [Gallery](https://reflex.dev/docs/gallery) &nbsp; | &nbsp; 🛸 [Deployment](https://reflex.dev/docs/hosting/deploy-quick-start) &nbsp;
📑 [Docs](https://reflex.dev/docs/getting-started/introduction) &nbsp; | &nbsp; 🗞️ [Blog](https://reflex.dev/blog) &nbsp; | &nbsp; 📱 [Component Library](https://reflex.dev/docs/library) &nbsp; | &nbsp; 🖼️ [Templates](https://reflex.dev/templates/) &nbsp; | &nbsp; 🛸 [Deployment](https://reflex.dev/docs/hosting/deploy-quick-start) &nbsp;

</div>

Expand Down
3 changes: 1 addition & 2 deletions benchmarks/benchmark_lighthouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ def get_lighthouse_scores(directory_path: str | Path) -> dict:
try:
for filename in directory_path.iterdir():
if filename.suffix == ".json" and filename.stem != "manifest":
file_path = directory_path / filename
data = json.loads(file_path.read_text())
data = json.loads(filename.read_text())
# Extract scores and add them to the dictionary with the filename as key
scores[data["finalUrl"].replace("http://localhost:3000/", "/")] = {
"performance_score": data["categories"]["performance"]["score"],
Expand Down
14 changes: 7 additions & 7 deletions benchmarks/test_benchmark_compile_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ def app_with_one_page(
Yields:
an AppHarness instance
"""
root = tmp_path_factory.mktemp(f"app1")
root = tmp_path_factory.mktemp("app1")

yield AppHarness.create(root=root, app_source=AppWithOnePage) # type: ignore
yield AppHarness.create(root=root, app_source=AppWithOnePage)


@pytest.fixture(scope="session")
Expand All @@ -227,7 +227,7 @@ def app_with_ten_pages(
Yields:
an AppHarness instance
"""
root = tmp_path_factory.mktemp(f"app10")
root = tmp_path_factory.mktemp("app10")
yield AppHarness.create(
root=root,
app_source=functools.partial(
Expand All @@ -249,7 +249,7 @@ def app_with_hundred_pages(
Yields:
an AppHarness instance
"""
root = tmp_path_factory.mktemp(f"app100")
root = tmp_path_factory.mktemp("app100")

yield AppHarness.create(
root=root,
Expand All @@ -272,11 +272,11 @@ def app_with_thousand_pages(
Yields:
an AppHarness instance
"""
root = tmp_path_factory.mktemp(f"app1000")
root = tmp_path_factory.mktemp("app1000")

yield AppHarness.create(
root=root,
app_source=functools.partial( # type: ignore
app_source=functools.partial(
AppWithThousandPages,
render_comp=render_multiple_pages, # type: ignore
),
Expand All @@ -295,7 +295,7 @@ def app_with_ten_thousand_pages(
Yields:
running AppHarness instance
"""
root = tmp_path_factory.mktemp(f"app10000")
root = tmp_path_factory.mktemp("app10000")

yield AppHarness.create(
root=root,
Expand Down
2 changes: 1 addition & 1 deletion docker-example/production-app-platform/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# Stage 1: init
FROM python:3.11 as init

ARG uv=/root/.cargo/bin/uv
ARG uv=/root/.local/bin/uv

# Install `uv` for faster package boostrapping
ADD --chmod=755 https://astral.sh/uv/install.sh /install.sh
Expand Down
2 changes: 1 addition & 1 deletion docker-example/production-compose/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Stage 1: init
FROM python:3.11 as init

ARG uv=/root/.cargo/bin/uv
ARG uv=/root/.local/bin/uv

# Install `uv` for faster package boostrapping
ADD --chmod=755 https://astral.sh/uv/install.sh /install.sh
Expand Down
Loading

0 comments on commit 1fb24f7

Please sign in to comment.