Skip to content

Commit d2b183e

Browse files
committed
Merge branch 'main' into lendemor/fix_duplicate_tab_issue
2 parents 2f215a3 + c2917d4 commit d2b183e

File tree

366 files changed

+55736
-17409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

366 files changed

+55736
-17409
lines changed

.github/codeql-config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
paths-ignore:
2+
- "**/tests/**"

.github/workflows/benchmarks.yml

Lines changed: 5 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -70,58 +70,6 @@ jobs:
7070
env:
7171
GITHUB_SHA: ${{ github.sha }}
7272

73-
simple-apps-benchmarks: # This app tests the compile times of various compoonents and pages
74-
if: github.event.pull_request.merged == true
75-
env:
76-
OUTPUT_FILE: benchmarks.json
77-
timeout-minutes: 50
78-
strategy:
79-
# Prioritize getting more information out of the workflow (even if something fails)
80-
fail-fast: false
81-
matrix:
82-
# Show OS combos first in GUI
83-
os: [ubuntu-latest, windows-latest, macos-latest]
84-
python-version: ["3.9.21", "3.10.16", "3.11.11", "3.12.8"]
85-
exclude:
86-
- os: windows-latest
87-
python-version: "3.10.16"
88-
- os: windows-latest
89-
python-version: "3.9.21"
90-
# keep only one python version for MacOS
91-
- os: macos-latest
92-
python-version: "3.9.21"
93-
- os: macos-latest
94-
python-version: "3.10.16"
95-
- os: macos-latest
96-
python-version: "3.11.11"
97-
include:
98-
- os: windows-latest
99-
python-version: "3.10.11"
100-
- os: windows-latest
101-
python-version: "3.9.13"
102-
103-
runs-on: ${{ matrix.os }}
104-
steps:
105-
- uses: actions/checkout@v4
106-
- uses: ./.github/actions/setup_build_env
107-
with:
108-
python-version: ${{ matrix.python-version }}
109-
run-poetry-install: true
110-
create-venv-at-path: .venv
111-
- name: Run benchmark tests
112-
env:
113-
APP_HARNESS_HEADLESS: 1
114-
PYTHONUNBUFFERED: 1
115-
run: |
116-
poetry run pytest -v benchmarks/ --benchmark-json=${{ env.OUTPUT_FILE }} -s
117-
- name: Upload benchmark results
118-
# Only run if the database creds are available in this context.
119-
run:
120-
poetry run python benchmarks/benchmark_compile_times.py --os "${{ matrix.os }}"
121-
--python-version "${{ matrix.python-version }}" --commit-sha "${{ github.sha }}"
122-
--benchmark-json "${{ env.OUTPUT_FILE }}" --branch-name "${{ github.head_ref || github.ref_name }}"
123-
--event-type "${{ github.event_name }}" --pr-id "${{ github.event.pull_request.id }}"
124-
12573
reflex-dist-size: # This job is used to calculate the size of the Reflex distribution (wheel file)
12674
if: github.event.pull_request.merged == true
12775
timeout-minutes: 30
@@ -161,7 +109,11 @@ jobs:
161109
runs-on: ${{ matrix.os }}
162110
steps:
163111
- uses: actions/checkout@v4
164-
112+
- name: Set up python
113+
id: setup-python
114+
uses: actions/setup-python@v5
115+
with:
116+
python-version: ${{ matrix.python-version }}
165117
- name: Install Poetry
166118
uses: snok/install-poetry@v1
167119
with:

.github/workflows/check_outdated_dependencies.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
- uses: ./.github/actions/setup_build_env
1818
with:
19-
python-version: "3.9.21"
19+
python-version: '3.10'
2020
run-poetry-install: true
2121
create-venv-at-path: .venv
2222

@@ -55,7 +55,7 @@ jobs:
5555
path: reflex-web
5656
- name: Install Requirements for reflex-web
5757
working-directory: ./reflex-web
58-
run: poetry run uv pip install -r requirements.txt
58+
run: poetry run uv pip install $(grep -ivE "reflex " requirements.txt)
5959
- name: Install additional dependencies for DB access
6060
run: poetry run uv pip install psycopg
6161
- name: Init Website for reflex-web
@@ -73,7 +73,7 @@ jobs:
7373
echo "$outdated"
7474
7575
# Ignore 3rd party dependencies that are not updated.
76-
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)
76+
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|ag-grid' || true)
7777
no_extra=$(echo "$filtered_outdated" | grep -vE '\|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-' || true)
7878
7979

.github/workflows/codeql.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL Advanced"
13+
14+
on:
15+
push:
16+
branches: ["main"]
17+
pull_request:
18+
branches: ["main"]
19+
schedule:
20+
- cron: "36 7 * * 4"
21+
22+
jobs:
23+
analyze:
24+
name: Analyze (${{ matrix.language }})
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners (GitHub.com only)
29+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31+
permissions:
32+
# required for all workflows
33+
security-events: write
34+
35+
# required to fetch internal or private CodeQL packs
36+
packages: read
37+
38+
# only required for workflows in private repositories
39+
actions: read
40+
contents: read
41+
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
include:
46+
- language: javascript-typescript
47+
build-mode: none
48+
- language: python
49+
build-mode: none
50+
- language: actions
51+
build-mode: none
52+
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
53+
# Use `c-cpp` to analyze code written in C, C++ or both
54+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
55+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
56+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
57+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
58+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
59+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
60+
steps:
61+
- name: Checkout repository
62+
uses: actions/checkout@v4
63+
64+
# Add any setup steps before running the `github/codeql-action/init` action.
65+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
66+
# or others). This is typically only required for manual builds.
67+
# - name: Setup runtime (example)
68+
# uses: actions/setup-example@v1
69+
70+
# Initializes the CodeQL tools for scanning.
71+
- name: Initialize CodeQL
72+
uses: github/codeql-action/init@v3
73+
with:
74+
languages: ${{ matrix.language }}
75+
config-file: .github/codeql-config.yml
76+
build-mode: ${{ matrix.build-mode }}
77+
# If you wish to specify custom queries, you can do so here or in a config file.
78+
# By default, queries listed here will override any specified in a config file.
79+
# Prefix the list here with "+" to use these queries and those in the config file.
80+
81+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
82+
# queries: security-extended,security-and-quality
83+
84+
# If the analyze step fails for one of the languages you are analyzing with
85+
# "We were unable to automatically build your code", modify the matrix above
86+
# to set the build mode to "manual" for that language. Then modify this step
87+
# to build your code.
88+
# ℹ️ Command-line programs to run using the OS shell.
89+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
90+
- if: matrix.build-mode == 'manual'
91+
shell: bash
92+
run: |
93+
echo 'If you are using a "manual" build mode for one or more of the' \
94+
'languages you are analyzing, replace this with the commands to build' \
95+
'your code, for example:'
96+
echo ' make bootstrap'
97+
echo ' make release'
98+
exit 1
99+
100+
- name: Perform CodeQL Analysis
101+
uses: github/codeql-action/analyze@v3
102+
with:
103+
category: "/language:${{matrix.language}}"

.github/workflows/integration_app_harness.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,10 @@ jobs:
4747
python-version: ${{ matrix.python-version }}
4848
run-poetry-install: true
4949
create-venv-at-path: .venv
50-
- run: poetry run uv pip install pyvirtualdisplay pillow pytest-split
50+
- run: poetry run uv pip install pyvirtualdisplay pillow pytest-split pytest-retry
5151
- name: Run app harness tests
5252
env:
53-
SCREENSHOT_DIR: /tmp/screenshots/${{ matrix.state_manager }}/${{ matrix.python-version }}/${{ matrix.split_index }}
5453
REDIS_URL: ${{ matrix.state_manager == 'redis' && 'redis://localhost:6379' || '' }}
5554
run: |
5655
poetry run playwright install chromium
57-
poetry run pytest tests/integration --splits 2 --group ${{matrix.split_index}}
58-
- uses: actions/upload-artifact@v4
59-
name: Upload failed test screenshots
60-
if: always()
61-
with:
62-
name: failed_test_screenshots
63-
path: /tmp/screenshots
56+
poetry run pytest tests/integration --retries 3 --maxfail=5 --splits 2 --group ${{matrix.split_index}}

.github/workflows/integration_tests.yml

Lines changed: 24 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ env:
3333
PR_TITLE: ${{ github.event.pull_request.title }}
3434

3535
jobs:
36-
example-counter:
36+
example-counter-and-nba-proxy:
3737
env:
3838
OUTPUT_FILE: import_benchmark.json
3939
timeout-minutes: 30
@@ -43,22 +43,17 @@ jobs:
4343
matrix:
4444
# Show OS combos first in GUI
4545
os: [ubuntu-latest, windows-latest]
46-
python-version: ["3.9.21", "3.10.16", "3.11.11", "3.12.8", "3.13.1"]
47-
# Windows is a bit behind on Python version availability in Github
46+
python-version: ['3.10.16', '3.11.11', '3.12.8', '3.13.1']
4847
exclude:
4948
- os: windows-latest
5049
python-version: "3.11.11"
5150
- os: windows-latest
52-
python-version: "3.10.16"
53-
- os: windows-latest
54-
python-version: "3.9.21"
51+
python-version: '3.10.16'
5552
include:
5653
- os: windows-latest
5754
python-version: "3.11.9"
5855
- os: windows-latest
59-
python-version: "3.10.11"
60-
- os: windows-latest
61-
python-version: "3.9.13"
56+
python-version: '3.10.11'
6257

6358
runs-on: ${{ matrix.os }}
6459
steps:
@@ -84,8 +79,6 @@ jobs:
8479
run: |
8580
poetry run reflex export --backend-only
8681
- name: Check run --backend-only before init for counter example
87-
env:
88-
WAIT_FOR_LISTENING_PORT_ARGS: --path ping
8982
run: |
9083
poetry run bash scripts/integration.sh ./reflex-examples/counter dev 8001 --backend-only --backend-port 8001
9184
- name: Init Website for counter example
@@ -101,26 +94,26 @@ jobs:
10194
# Check that npm is home
10295
npm -v
10396
poetry run bash scripts/integration.sh ./reflex-examples/counter dev
104-
- name: Measure and upload .web size
105-
run:
106-
poetry run python benchmarks/benchmark_web_size.py --os "${{ matrix.os }}"
107-
--python-version "${{ matrix.python-version }}" --commit-sha "${{ github.sha }}"
108-
--pr-id "${{ github.event.pull_request.id }}"
109-
--branch-name "${{ github.head_ref || github.ref_name }}"
110-
--path ./reflex-examples/counter/.web
111-
--app-name "counter"
112-
- name: Install hyperfine
113-
run: cargo install hyperfine
114-
- name: Benchmark imports
115-
working-directory: ./reflex-examples/counter
116-
run: hyperfine --warmup 3 "export POETRY_VIRTUALENVS_PATH=../../.venv; poetry run python counter/counter.py" --show-output --export-json "${{ env.OUTPUT_FILE }}" --shell bash
117-
- name: Upload Benchmarks
118-
run:
119-
poetry run python benchmarks/benchmark_imports.py --os "${{ matrix.os }}"
120-
--python-version "${{ matrix.python-version }}" --commit-sha "${{ github.sha }}"
121-
--benchmark-json "./reflex-examples/counter/${{ env.OUTPUT_FILE }}"
122-
--branch-name "${{ github.head_ref || github.ref_name }}" --pr-id "${{ github.event.pull_request.id }}"
123-
--app-name "counter"
97+
- name: Install requirements for nba proxy example
98+
working-directory: ./reflex-examples/nba-proxy
99+
run: |
100+
poetry run uv pip install -r requirements.txt
101+
- name: Install additional dependencies for DB access
102+
run: poetry run uv pip install psycopg
103+
- name: Check export --backend-only before init for nba-proxy example
104+
working-directory: ./reflex-examples/nba-proxy
105+
run: |
106+
poetry run reflex export --backend-only
107+
- name: Init Website for nba-proxy example
108+
working-directory: ./reflex-examples/nba-proxy
109+
run: |
110+
poetry run reflex init --loglevel debug
111+
- name: Run Website and Check for errors
112+
run: |
113+
# Check that npm is home
114+
npm -v
115+
poetry run bash scripts/integration.sh ./reflex-examples/nba-proxy dev
116+
124117
125118
reflex-web:
126119
strategy:
@@ -161,12 +154,6 @@ jobs:
161154
# Check that npm is home
162155
npm -v
163156
poetry run bash scripts/integration.sh ./reflex-web prod
164-
- name: Measure and upload .web size
165-
run:
166-
poetry run python benchmarks/benchmark_web_size.py --os "${{ matrix.os }}"
167-
--python-version "${{ matrix.python-version }}" --commit-sha "${{ github.sha }}"
168-
--pr-id "${{ github.event.pull_request.id }}" --branch-name "${{ github.head_ref || github.ref_name }}"
169-
--app-name "reflex-web" --path ./reflex-web/.web
170157
171158
rx-shout-from-template:
172159
strategy:
@@ -230,9 +217,3 @@ jobs:
230217
# Check that npm is home
231218
npm -v
232219
poetry run bash scripts/integration.sh ./reflex-web prod
233-
- name: Measure and upload .web size
234-
run:
235-
poetry run python benchmarks/benchmark_web_size.py --os "${{ matrix.os }}"
236-
--python-version "${{ matrix.python-version }}" --commit-sha "${{ github.sha }}"
237-
--pr-id "${{ github.event.pull_request.id }}" --branch-name "${{ github.head_ref || github.ref_name }}"
238-
--app-name "reflex-web" --path ./reflex-web/.web

.github/workflows/integration_tests_wsl.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ jobs:
7878
shell: wsl-bash {0}
7979
run: |
8080
export TELEMETRY_ENABLED=false
81-
export WAIT_FOR_LISTENING_PORT_ARGS="--path ping"
8281
dos2unix scripts/integration.sh
8382
poetry run bash scripts/integration.sh ./reflex-examples/counter dev 8001 --backend-only --backend-port 8001
8483
- name: Init Website for counter example

.github/workflows/performance.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: performance-tests
2+
3+
on:
4+
push:
5+
branches:
6+
- "main" # or "master"
7+
paths-ignore:
8+
- "**/*.md"
9+
pull_request:
10+
workflow_dispatch:
11+
12+
env:
13+
TELEMETRY_ENABLED: false
14+
NODE_OPTIONS: "--max_old_space_size=8192"
15+
PR_TITLE: ${{ github.event.pull_request.title }}
16+
APP_HARNESS_HEADLESS: 1
17+
PYTHONUNBUFFERED: 1
18+
19+
jobs:
20+
benchmarks:
21+
name: Run benchmarks
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: ./.github/actions/setup_build_env
26+
with:
27+
python-version: 3.12.8
28+
run-poetry-install: true
29+
create-venv-at-path: .venv
30+
- name: Run benchmarks
31+
uses: CodSpeedHQ/action@v3
32+
with:
33+
token: ${{ secrets.CODSPEED_TOKEN }}
34+
run: poetry run pytest tests/benchmarks --codspeed

0 commit comments

Comments
 (0)