From 396e1d3fe135796b213fda120121860fd59d0ae7 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 7 May 2026 14:33:44 -0700 Subject: [PATCH 1/9] fix rx-shout integration test for new uv project structure --- .github/workflows/integration_tests.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 8db72900f23..af2f36f724c 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -186,17 +186,27 @@ jobs: - name: Init reflex-web from template run: uv 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 + - name: Override reflex source to local checkout + # Pointing `reflex` at the parent reflex workspace makes uv pick up + # reflex AND every reflex-* sub-package as editable installs from + # this repo, instead of pulling them from PyPI. working-directory: ./rx-shout-from-template - - name: Install additional dependencies - run: uv pip install -r requirements.txt + run: | + cat >> pyproject.toml <<'EOF' + + [tool.uv.sources] + reflex = { path = "..", editable = true } + EOF + - name: Install rx-shout dependencies + # Re-locks because pyproject.toml changed; --prerelease=allow matches + # the template's own lock options (rx_shout depends on reflex pre-releases). working-directory: ./rx-shout-from-template + run: uv sync --prerelease=allow - name: Run Website and Check for errors run: | # Check that npm is home npm -v - uv run bash scripts/integration.sh ./rx-shout-from-template prod + uv run --project ./rx-shout-from-template --no-sync bash scripts/integration.sh ./rx-shout-from-template prod reflex-docs-macos: if: github.event_name == 'push' && github.ref == 'refs/heads/main' From 13427ef39c4b734156dc344634f01026b614e38c Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 7 May 2026 14:58:09 -0700 Subject: [PATCH 2/9] name all reflex subpackages avoid case of mixed installation from local/pypi for reflex subpackages --- .github/workflows/integration_tests.yml | 27 +++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index af2f36f724c..d1396c32511 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -186,16 +186,35 @@ jobs: - name: Init reflex-web from template run: uv run reflex init --template https://github.com/masenf/rx_shout working-directory: ./rx-shout-from-template - - name: Override reflex source to local checkout - # Pointing `reflex` at the parent reflex workspace makes uv pick up - # reflex AND every reflex-* sub-package as editable installs from - # this repo, instead of pulling them from PyPI. + - name: Override reflex sources to local checkout + # Force reflex AND every reflex-* sub-package to install editable + # from this repo instead of PyPI. Listed explicitly (rather than + # relying on transitive propagation through the parent `reflex` + # path source) so that any direct or transitive dep on a sub-package + # is guaranteed to resolve to the local workspace member. working-directory: ./rx-shout-from-template run: | cat >> pyproject.toml <<'EOF' [tool.uv.sources] reflex = { path = "..", editable = true } + reflex-base = { path = "../packages/reflex-base", editable = true } + reflex-components-code = { path = "../packages/reflex-components-code", editable = true } + reflex-components-core = { path = "../packages/reflex-components-core", editable = true } + reflex-components-dataeditor = { path = "../packages/reflex-components-dataeditor", editable = true } + reflex-components-gridjs = { path = "../packages/reflex-components-gridjs", editable = true } + reflex-components-internal = { path = "../packages/reflex-components-internal", editable = true } + reflex-components-lucide = { path = "../packages/reflex-components-lucide", editable = true } + reflex-components-markdown = { path = "../packages/reflex-components-markdown", editable = true } + reflex-components-moment = { path = "../packages/reflex-components-moment", editable = true } + reflex-components-plotly = { path = "../packages/reflex-components-plotly", editable = true } + reflex-components-radix = { path = "../packages/reflex-components-radix", editable = true } + reflex-components-react-player = { path = "../packages/reflex-components-react-player", editable = true } + reflex-components-recharts = { path = "../packages/reflex-components-recharts", editable = true } + reflex-components-sonner = { path = "../packages/reflex-components-sonner", editable = true } + reflex-docgen = { path = "../packages/reflex-docgen", editable = true } + reflex-hosting-cli = { path = "../packages/reflex-hosting-cli", editable = true } + hatch-reflex-pyi = { path = "../packages/hatch-reflex-pyi", editable = true } EOF - name: Install rx-shout dependencies # Re-locks because pyproject.toml changed; --prerelease=allow matches From 1c099de5da3bafad93575709b7965449d70b3852 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 7 May 2026 15:04:12 -0700 Subject: [PATCH 3/9] make sure psutil is installed --- .github/workflows/integration_tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index d1396c32511..3971ed71a8e 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -183,7 +183,7 @@ jobs: - name: Create app directory run: mkdir rx-shout-from-template - - name: Init reflex-web from template + - name: Init rx-shout from template run: uv run reflex init --template https://github.com/masenf/rx_shout working-directory: ./rx-shout-from-template - name: Override reflex sources to local checkout @@ -221,9 +221,10 @@ jobs: # the template's own lock options (rx_shout depends on reflex pre-releases). working-directory: ./rx-shout-from-template run: uv sync --prerelease=allow - - name: Run Website and Check for errors + - name: Run App and Check for errors run: | # Check that npm is home + uv pip install psutil # needed for integration.sh npm -v uv run --project ./rx-shout-from-template --no-sync bash scripts/integration.sh ./rx-shout-from-template prod From 3d88d7a1e085c642a9adac92ce27ac559410687c Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 7 May 2026 15:17:46 -0700 Subject: [PATCH 4/9] install psutil in the venv it will be needed in --- .github/workflows/integration_tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 3971ed71a8e..9f12cbe6796 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -224,8 +224,9 @@ jobs: - name: Run App and Check for errors run: | # Check that npm is home - uv pip install psutil # needed for integration.sh npm -v + # Needed for integration.sh + uv --project ./rx-shout-from-template pip install psutil uv run --project ./rx-shout-from-template --no-sync bash scripts/integration.sh ./rx-shout-from-template prod reflex-docs-macos: From 55b48dd6a1182a33022ff10077262b41f5adb35a Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 7 May 2026 15:20:40 -0700 Subject: [PATCH 5/9] it shouldn't be this hard --- .github/workflows/integration_tests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 9f12cbe6796..460ccf78a70 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -220,13 +220,11 @@ jobs: # Re-locks because pyproject.toml changed; --prerelease=allow matches # the template's own lock options (rx_shout depends on reflex pre-releases). working-directory: ./rx-shout-from-template - run: uv sync --prerelease=allow + run: uv sync --prerelease=allow && uv pip install psutil - name: Run App and Check for errors run: | # Check that npm is home npm -v - # Needed for integration.sh - uv --project ./rx-shout-from-template pip install psutil uv run --project ./rx-shout-from-template --no-sync bash scripts/integration.sh ./rx-shout-from-template prod reflex-docs-macos: From 369cfe26b15eb2b106a834a4ce7edb95240f33ef Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 7 May 2026 15:45:43 -0700 Subject: [PATCH 6/9] avoid psutil dep in wait_for_listening_port on POSIX os.kill(pid, 0) is the stdlib equivalent everywhere except Windows, where psutil is already a transitive runtime dep of reflex. Drops the manual uv pip install psutil from the rx-shout job, which was landing in the wrong venv anyway because setup-uv activates the repo-root venv. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/integration_tests.yml | 2 +- scripts/wait_for_listening_port.py | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 460ccf78a70..248b2e0c129 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -220,7 +220,7 @@ jobs: # Re-locks because pyproject.toml changed; --prerelease=allow matches # the template's own lock options (rx_shout depends on reflex pre-releases). working-directory: ./rx-shout-from-template - run: uv sync --prerelease=allow && uv pip install psutil + run: uv sync --prerelease=allow - name: Run App and Check for errors run: | # Check that npm is home diff --git a/scripts/wait_for_listening_port.py b/scripts/wait_for_listening_port.py index 0781b8c4957..db36dbc660b 100644 --- a/scripts/wait_for_listening_port.py +++ b/scripts/wait_for_listening_port.py @@ -5,16 +5,29 @@ """ import argparse +import os import socket +import sys import time from concurrent.futures import ThreadPoolExecutor, as_completed def _pid_exists(pid: int): - # Note: For windows, the pid here is really the "winpid". - import psutil + # On Windows the pid here is really the "winpid"; os.kill(pid, 0) only + # accepts CTRL_*_EVENT signals on Windows, so fall back to psutil there. + # psutil is a runtime dep of reflex on win32 (see pyproject.toml), so + # any venv with reflex installed already has it. + if sys.platform == "win32": + import psutil - return psutil.pid_exists(pid) + return psutil.pid_exists(pid) + try: + os.kill(pid, 0) + except ProcessLookupError: + return False + except PermissionError: + return True + return True def _wait_for_port(port: int, server_pid: int, timeout: float) -> tuple[bool, str]: From 1eca2d67a65a677fc6bf31cd7787fda2dd006427 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 7 May 2026 16:05:40 -0700 Subject: [PATCH 7/9] turns out these don't need to be explicitly listed because we're installing reflex in an editable way, it will use the local specification's from reflex's pyproject.toml when it installs. --- .github/workflows/integration_tests.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 248b2e0c129..6b835d90823 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -198,23 +198,6 @@ jobs: [tool.uv.sources] reflex = { path = "..", editable = true } - reflex-base = { path = "../packages/reflex-base", editable = true } - reflex-components-code = { path = "../packages/reflex-components-code", editable = true } - reflex-components-core = { path = "../packages/reflex-components-core", editable = true } - reflex-components-dataeditor = { path = "../packages/reflex-components-dataeditor", editable = true } - reflex-components-gridjs = { path = "../packages/reflex-components-gridjs", editable = true } - reflex-components-internal = { path = "../packages/reflex-components-internal", editable = true } - reflex-components-lucide = { path = "../packages/reflex-components-lucide", editable = true } - reflex-components-markdown = { path = "../packages/reflex-components-markdown", editable = true } - reflex-components-moment = { path = "../packages/reflex-components-moment", editable = true } - reflex-components-plotly = { path = "../packages/reflex-components-plotly", editable = true } - reflex-components-radix = { path = "../packages/reflex-components-radix", editable = true } - reflex-components-react-player = { path = "../packages/reflex-components-react-player", editable = true } - reflex-components-recharts = { path = "../packages/reflex-components-recharts", editable = true } - reflex-components-sonner = { path = "../packages/reflex-components-sonner", editable = true } - reflex-docgen = { path = "../packages/reflex-docgen", editable = true } - reflex-hosting-cli = { path = "../packages/reflex-hosting-cli", editable = true } - hatch-reflex-pyi = { path = "../packages/hatch-reflex-pyi", editable = true } EOF - name: Install rx-shout dependencies # Re-locks because pyproject.toml changed; --prerelease=allow matches From 46ebe254f3b0185e8756c566a007c3161fe10411 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 7 May 2026 16:27:21 -0700 Subject: [PATCH 8/9] remove long comment --- .github/workflows/integration_tests.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 6b835d90823..69fbc4c7a45 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -187,11 +187,7 @@ jobs: run: uv run reflex init --template https://github.com/masenf/rx_shout working-directory: ./rx-shout-from-template - name: Override reflex sources to local checkout - # Force reflex AND every reflex-* sub-package to install editable - # from this repo instead of PyPI. Listed explicitly (rather than - # relying on transitive propagation through the parent `reflex` - # path source) so that any direct or transitive dep on a sub-package - # is guaranteed to resolve to the local workspace member. + # Force reflex install editable from this repo instead of PyPI. working-directory: ./rx-shout-from-template run: | cat >> pyproject.toml <<'EOF' From f7d442c78003597ea7839ecffdda27be2a92d192 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 7 May 2026 16:45:07 -0700 Subject: [PATCH 9/9] tabs v. spaces: the showdown --- .github/workflows/integration_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 69fbc4c7a45..1eb0d8130d9 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -187,7 +187,7 @@ jobs: run: uv run reflex init --template https://github.com/masenf/rx_shout working-directory: ./rx-shout-from-template - name: Override reflex sources to local checkout - # Force reflex install editable from this repo instead of PyPI. + # Force reflex install editable from this repo instead of PyPI. working-directory: ./rx-shout-from-template run: | cat >> pyproject.toml <<'EOF'