diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 8db72900f23..1eb0d8130d9 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -183,20 +183,28 @@ 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: ignore reflex pin in requirements - run: sed -i -e '/reflex==/d' requirements.txt + - name: Override reflex sources to local checkout + # Force reflex install editable from this repo instead of 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 - - name: Run Website and Check for errors + run: uv sync --prerelease=allow + - name: Run App 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' 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]: