Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,15 @@ jobs:
run: |
uv sync --locked --extra reflex --group dev

# The Chromium installed above belongs to the *npm* playwright, which xy's
# own probes only use for an executable path. The Reflex channel browser
# test drives the Python bindings, and those pin their own browser
# revision — so install through them too, or the one test that proves the
# chart shares the app's websocket fails to launch.
- name: Install Chromium (Playwright, Python bindings)
run: |
.venv/bin/playwright install --with-deps chromium chromium-headless-shell

- name: Verify bundled Reflex integration import
run: |
.venv/bin/python -c "import importlib.metadata as m, reflex_xy; assert reflex_xy.__version__ == m.version('xy')"
Expand Down Expand Up @@ -191,8 +200,19 @@ jobs:
# defect: fail rather than skip, so the browser layer cannot pass by
# absence. (A crash or non-zero exit already fails unconditionally.)
export XY_REQUIRE_BROWSER=1
# Keep the painted-chart screenshot from the Reflex channel browser
# test; it is uploaded below as the visual evidence for that run.
export XY_BROWSER_EVIDENCE="$PWD/browser-evidence"
.venv/bin/pytest -q

- name: Upload browser evidence
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: browser-evidence
if-no-files-found: warn
path: browser-evidence/

# End-to-end: a real Figure (line decimation + scatter) through to_html's
# exact payload path, rendered in Chromium, pixels read back. Complements
# the stdlib smoke, which hand-builds payloads. (Was dead code — audit
Expand Down Expand Up @@ -645,7 +665,12 @@ jobs:
XY_REQUIRE_CARGO: "1"
run: |
uv venv smoke-native
uv pip install --no-cache -p smoke-native dist/*.tar.gz numpy anywidget "reflex>=0.9.6"
# The adapter needs Reflex's channel transport, unreleased today, so
# there is no version floor to name here — and these smokes only
# `import reflex_xy` (which pulls no Reflex), so installing the
# framework at all would be theatre. Add `[reflex]` back once
# channels ship and the extra names a real floor again.
uv pip install --no-cache -p smoke-native dist/*.tar.gz numpy anywidget
./smoke-native/bin/python - <<'PY'
import importlib.metadata as metadata

Expand All @@ -666,7 +691,7 @@ jobs:
XY_SKIP_CARGO: "1"
run: |
uv venv smoke-no-rust
uv pip install --no-cache -p smoke-no-rust dist/*.tar.gz numpy anywidget "reflex>=0.9.6"
uv pip install --no-cache -p smoke-no-rust dist/*.tar.gz numpy anywidget
./smoke-no-rust/bin/python - <<'PY'
import importlib.metadata as metadata

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ node_modules/
python/xy/static/index.js
python/xy/static/standalone.js
**/assets/external/

# Browser evidence kept by the Reflex channel test when XY_BROWSER_EVIDENCE is
# set (CI uploads it as an artifact); local runs default to pytest's tmp_path.
/browser-evidence/
9 changes: 5 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ control.
`tests/pyplot/corpus/` + `spec/matplotlib/compat.md`.
- `python/reflex_xy/` — the bundled Reflex integration (import namespace
`reflex_xy`; design: `spec/design/reflex-integration.md`). Chart
data rides the app's own websocket as a second socket.io namespace;
figures live in a per-process registry rebuilt from Reflex state on miss.
The source ships in every `xy` artifact; the `xy[reflex]` extra selects the
supported Reflex floor while plain `xy` keeps no Reflex runtime dependency.
data rides the app's own websocket as a dedicated Reflex channel (`/_xy`,
`data_plane.py`); figures live in a per-process registry rebuilt from Reflex
state on miss. The source ships in every `xy` artifact; the `xy[reflex]`
extra selects the supported Reflex while plain `xy` keeps no Reflex runtime
dependency.
The core `python/xy` package must never import Reflex. The render client is
linked out of that package at app compile (no second copy to drift).
Tests: `tests/reflex_adapter/` (skip unless Reflex is installed).
Expand Down
14 changes: 10 additions & 4 deletions docs/app/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ name = "xy-docs-app"
version = "0.1.0"
description = "Documentation site for XY."
requires-python = ">=3.11"
# TEMPORARY: these four normally track reflex-dev/reflex@main, but `xy[reflex]`
# requires the unreleased channel transport (reflex-dev/reflex#6932) and uv
# refuses two URLs for one package. They therefore pin the same immutable
# commit the root pyproject does — all from one repo, so the framework is never
# half fork and half main, and no install can pick up unreviewed framework
# code. Restore `@main` when channels land there.
dependencies = [
"numpy",
"pillow",
"reflex @ git+https://github.com/reflex-dev/reflex@main",
"reflex-components-internal @ git+https://github.com/reflex-dev/reflex@main#subdirectory=packages/reflex-components-internal",
"reflex-docgen @ git+https://github.com/reflex-dev/reflex@main#subdirectory=packages/reflex-docgen",
"reflex-site-shared @ git+https://github.com/reflex-dev/reflex@main#subdirectory=packages/reflex-site-shared",
"reflex @ git+https://github.com/benedikt-bartscher/reflex.git@609b2f515fc9d00e9a63a056d00a7782c77323b0",
"reflex-components-internal @ git+https://github.com/benedikt-bartscher/reflex.git@609b2f515fc9d00e9a63a056d00a7782c77323b0#subdirectory=packages/reflex-components-internal",
"reflex-docgen @ git+https://github.com/benedikt-bartscher/reflex.git@609b2f515fc9d00e9a63a056d00a7782c77323b0#subdirectory=packages/reflex-docgen",
"reflex-site-shared @ git+https://github.com/benedikt-bartscher/reflex.git@609b2f515fc9d00e9a63a056d00a7782c77323b0#subdirectory=packages/reflex-site-shared",
"xy[reflex]",
]

Expand Down
Loading