Skip to content

Commit a10252b

Browse files
masenfclaude
andauthored
fix rx-shout integration test for new uv project structure (#6470)
* fix rx-shout integration test for new uv project structure * name all reflex subpackages avoid case of mixed installation from local/pypi for reflex subpackages * make sure psutil is installed * install psutil in the venv it will be needed in * it shouldn't be this hard * 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) <noreply@anthropic.com> * 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. * remove long comment * tabs v. spaces: the showdown --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2df5344 commit a10252b

2 files changed

Lines changed: 31 additions & 10 deletions

File tree

.github/workflows/integration_tests.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,20 +183,28 @@ jobs:
183183

184184
- name: Create app directory
185185
run: mkdir rx-shout-from-template
186-
- name: Init reflex-web from template
186+
- name: Init rx-shout from template
187187
run: uv run reflex init --template https://github.com/masenf/rx_shout
188188
working-directory: ./rx-shout-from-template
189-
- name: ignore reflex pin in requirements
190-
run: sed -i -e '/reflex==/d' requirements.txt
189+
- name: Override reflex sources to local checkout
190+
# Force reflex install editable from this repo instead of PyPI.
191191
working-directory: ./rx-shout-from-template
192-
- name: Install additional dependencies
193-
run: uv pip install -r requirements.txt
192+
run: |
193+
cat >> pyproject.toml <<'EOF'
194+
195+
[tool.uv.sources]
196+
reflex = { path = "..", editable = true }
197+
EOF
198+
- name: Install rx-shout dependencies
199+
# Re-locks because pyproject.toml changed; --prerelease=allow matches
200+
# the template's own lock options (rx_shout depends on reflex pre-releases).
194201
working-directory: ./rx-shout-from-template
195-
- name: Run Website and Check for errors
202+
run: uv sync --prerelease=allow
203+
- name: Run App and Check for errors
196204
run: |
197205
# Check that npm is home
198206
npm -v
199-
uv run bash scripts/integration.sh ./rx-shout-from-template prod
207+
uv run --project ./rx-shout-from-template --no-sync bash scripts/integration.sh ./rx-shout-from-template prod
200208
201209
reflex-docs-macos:
202210
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

scripts/wait_for_listening_port.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,29 @@
55
"""
66

77
import argparse
8+
import os
89
import socket
10+
import sys
911
import time
1012
from concurrent.futures import ThreadPoolExecutor, as_completed
1113

1214

1315
def _pid_exists(pid: int):
14-
# Note: For windows, the pid here is really the "winpid".
15-
import psutil
16+
# On Windows the pid here is really the "winpid"; os.kill(pid, 0) only
17+
# accepts CTRL_*_EVENT signals on Windows, so fall back to psutil there.
18+
# psutil is a runtime dep of reflex on win32 (see pyproject.toml), so
19+
# any venv with reflex installed already has it.
20+
if sys.platform == "win32":
21+
import psutil
1622

17-
return psutil.pid_exists(pid)
23+
return psutil.pid_exists(pid)
24+
try:
25+
os.kill(pid, 0)
26+
except ProcessLookupError:
27+
return False
28+
except PermissionError:
29+
return True
30+
return True
1831

1932

2033
def _wait_for_port(port: int, server_pid: int, timeout: float) -> tuple[bool, str]:

0 commit comments

Comments
 (0)