build with uv, and preview locally instead of a second dataflow
validate / validate (push) Successful in 59m16s

The build command was `pip install .`, which is what upstream and the dora docs
use because `--uv` rewrites it. Spelling it `uv pip install .` means the
dataflow never installs through pip at all, whether or not `--uv` was passed.
The cost is that the node then needs a virtualenv to install into, so it must
be run with `--uv`; the README says so.

The second dataflow is gone. It existed to wire this node into dora-image-view
just to see the frames, which pulled another repository over the network and
needed a tag there. PREVIEW=true now opens a local window of the frames as they
are published, so checking a camera, an encoding or a flip needs this
repository alone. It shows the frame after the flip and the resize, so what is
on screen is what is sent, and it never opens under CI, where there is no
display.

That a source node can display its own output overlaps with what a viewer node
does. The overlap is the point: the alternative was a second repository in the
loop before you can tell whether a camera works.
This commit is contained in:
2026-09-15 06:09:12 -03:00
parent 3c0e0f327d
commit dc3960809a
6 changed files with 87 additions and 50 deletions
+11 -5
View File
@@ -13,10 +13,10 @@ keywords: [opencv, camera, webcam, video, capture, image, v4l2]
runtime: python
entrypoint: dora-webcam
# `dora build --uv` / `dora run --uv` rewrites this to `uv pip install .` and
# gives the node its own managed venv under `.dora/python-envs/`, so the
# dependencies it sees at runtime are the ones installed here.
build: pip install .
# Run the dataflow with --uv, which gives the node its own managed venv under
# `.dora/python-envs/`, so what it imports at runtime is what was installed
# here. Without --uv this needs a virtualenv to install into.
build: uv pip install .
dora: ">=1.0"
inputs:
@@ -59,6 +59,12 @@ env:
description: Quality 0-100, used only by the JPEG encodings.
FLIP:
description: Flip the frame. One of VERTICAL, HORIZONTAL or BOTH. Unset means no flip.
PREVIEW:
type: bool
description: >-
Open a local window showing the frames as they are published, so a camera
can be checked without wiring a viewer. Press q to stop the node. Ignored
under CI, where there is no display.
CAPTURE_FRAMES:
type: int
default: 0
@@ -76,7 +82,7 @@ example: |
- id: camera
git: ssh://git@gitea.liria.cl:5001/liria/dora-webcam.git
tag: v0.1.0
build: pip install .
build: uv pip install .
path: dora-webcam
inputs:
tick: dora/timer/millis/33