From a516e731cf7b9742cf907bf3abdb6228e02e6676 Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Mon, 24 Feb 2025 14:42:04 +0100 Subject: [PATCH] Migrate the CI to --uv --- .github/workflows/ci.yml | 32 ++++++++++++------------------ apis/python/node/README.md | 6 ++---- examples/python-dataflow/README.md | 6 ++---- 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1272f12a..b3be3cec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -307,14 +307,8 @@ jobs: shell: bash run: | # Test Python template Project - python3 -m venv .venv - if [ ! -d ".venv/bin" ]; then - mv .venv/Scripts .venv/bin # venv is placed under `Scripts` on Windows - fi - source .venv/bin/activate - pip3 install maturin ruff pytest - maturin build -m apis/python/node/Cargo.toml - pip3 install target/wheels/* + uv venv --seed -p 3.11 + uv run pip install -e apis/python/node dora new test_python_project --lang python --internal-create-with-path-dependencies cd test_python_project @@ -326,43 +320,43 @@ jobs: export OPERATING_MODE=SAVE dora up dora list - dora build dataflow.yml - dora start dataflow.yml --name ci-python-test --detach + dora build dataflow.yml --uv + dora start dataflow.yml --name ci-python-test --detach --uv sleep 10 dora stop --name ci-python-test --grace-duration 5s cd .. # Run Python Node Example - dora build examples/python-dataflow/dataflow.yml - dora start examples/python-dataflow/dataflow.yml --name ci-python --detach + dora build examples/python-dataflow/dataflow.yml --uv + dora start examples/python-dataflow/dataflow.yml --name ci-python --detach --uv sleep 10 dora stop --name ci-python --grace-duration 10s # Run Python Dynamic Node Example - dora start examples/python-dataflow/dataflow_dynamic.yml --name ci-python-dynamic --detach - opencv-plot --name plot + dora start examples/python-dataflow/dataflow_dynamic.yml --name ci-python-dynamic --detach --uv + uv run opencv-plot --name plot sleep 10 dora stop --name ci-python-dynamic --grace-duration 10s # Run Python Operator Example - dora start examples/python-operator-dataflow/dataflow.yml --name ci-python-operator --detach + dora start examples/python-operator-dataflow/dataflow.yml --name ci-python-operator --detach --uv sleep 10 dora stop --name ci-python-operator --grace-duration 10s dora destroy # Run Python queue latency test - dora run tests/queue_size_latest_data_python/dataflow.yaml + dora run tests/queue_size_latest_data_python/dataflow.yaml --uv # Run Python queue latency test + timeout - dora run tests/queue_size_and_timeout_python/dataflow.yaml + dora run tests/queue_size_and_timeout_python/dataflow.yaml --uv # Run Rust queue latency test - dora build tests/queue_size_latest_data_rust/dataflow.yaml - dora run tests/queue_size_latest_data_rust/dataflow.yaml + dora build tests/queue_size_latest_data_rust/dataflow.yaml --uv + dora run tests/queue_size_latest_data_rust/dataflow.yaml --uv - name: "Test CLI (C)" timeout-minutes: 30 diff --git a/apis/python/node/README.md b/apis/python/node/README.md index 1faffc77..3f47b818 100644 --- a/apis/python/node/README.md +++ b/apis/python/node/README.md @@ -5,10 +5,8 @@ This crate corresponds to the Node API for Dora. To build the Python module for development: ```bash -python -m venv .env -source .env/bin/activate -pip install maturin -maturin develop +uv venv --seed -p 3.11 +uv run pip install -e . ``` ## Type hinting diff --git a/examples/python-dataflow/README.md b/examples/python-dataflow/README.md index 9e16d6a0..cd36d220 100644 --- a/examples/python-dataflow/README.md +++ b/examples/python-dataflow/README.md @@ -15,9 +15,7 @@ information on how to start such a dataflow. ## Getting started -After installing Rust, `dora-cli` and `Python >3.11`, you will need to **activate** (or create and **activate**) a -[Python virtual environment](https://docs.python.org/3/library/venv.html). -Then, you will need to install the dependencies: +After installing Rust, `dora-cli` and `uv` (if you installed the cli without pip), you will need to install the dependencies: ```bash cd examples/python-dataflow @@ -36,5 +34,5 @@ dora run ./dataflow.yml --uv (or dora start ./dataflow_dynamic.yml --uv) ```bash # activate your virtual environment in another terminal -python opencv-plot --name plot +python opencv-plot --name plot --uv ```