Skip to content
Merged
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
13 changes: 8 additions & 5 deletions .mise/config.coverage.toml
Original file line number Diff line number Diff line change
Expand Up @@ -142,20 +142,23 @@ shell = "bash -euo pipefail -c"
[tasks.pytest-cov]
description = "Combined Python coverage (pytest + web-runner Pyodide runs) -> Cobertura for Codecov/DeepSource"
# One Python report is combined from several data sources: the pytest runs plus the web-runner Pyodide runs.
# The pyface1 + pyeye1 pytest runs and the web-runner integration test (which drops the modules' .coverage files
# into target/pycov/ when ET_TEST_COVERAGE is set) all feed `coverage combine`, which merges them via
# config/coverage.toml's `[paths]` remap into a single Cobertura file. pytest-cov is a plugin, so it rides in
# each module's uv `dev` group -- the same venv as pytest -- and `uv run` (a mise-managed tool) installs both
# into the one project venv. UV_PYTHON mirrors test-pyface1's mise-CPython pin.
# The pyface1 + pyeye1 + pyspeech1 pytest runs and the web-runner integration test (which drops the modules'
# .coverage files into target/pycov/ when ET_TEST_COVERAGE is set) all feed `coverage combine`, which merges
# them via config/coverage.toml's `[paths]` remap into a single Cobertura file. pytest-cov is a plugin, so it
# rides in each module's uv `dev` group -- the same venv as pytest -- and `uv run` (a mise-managed tool) installs
# both into the one project venv. UV_PYTHON mirrors test-pyface1's mise-CPython pin.
Comment on lines +145 to +149

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Correct the coverage configuration section name.

The comment refers to config/coverage.toml's [paths] section, but the actual section is [tool.coverage.paths]. Update the reference to avoid sending maintainers to a nonexistent section.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.mise/config.coverage.toml around lines 145 - 149, Update the coverage
configuration reference in the comment near the pytest coverage description to
use the actual [tool.coverage.paths] section name instead of [paths].

run = """
pyface=services/ws-modules/pyface1
pyeye=services/ws-modules/pyeye1
pyspeech=services/ws-modules/pyspeech1
pycov=target/pycov
mkdir -p "$pycov"
uv run --directory "$pyface" pytest --cov=pyface1 --cov-report=
cp "$pyface/.coverage" "$pycov/.coverage.pyface1_pytest"
uv run --directory "$pyeye" pytest --cov=pyeye1 --cov-report=
cp "$pyeye/.coverage" "$pycov/.coverage.pyeye1_pytest"
uv run --directory "$pyspeech" pytest --cov=pyspeech1 --cov-report=
cp "$pyspeech/.coverage" "$pycov/.coverage.pyspeech1_pytest"
uv run --project "$pyface" coverage combine "$pycov"
uv run --project "$pyface" coverage xml -o coverage-python.xml
"""
Expand Down
19 changes: 18 additions & 1 deletion .mise/config.python.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ depends = ["ruff-fix"]
description = "Apply Python lint-fix passes"

[tasks."test:python"]
depends = ["test-pyeye1", "test-pyface1"]
depends = ["test-pyeye1", "test-pyface1", "test-pyspeech1"]
description = "Run Python tests"

[tasks.test-pyeye1]
Expand All @@ -76,6 +76,11 @@ dir = "services/ws-modules/pyface1"
env = { UV_PYTHON = "{% if os() == 'windows' %}{{ vars.py3_win }}{% else %}{{ vars.py3_unix }}{% endif %}" }
run = "uv run pytest"

[tasks.test-pyspeech1]
dir = "services/ws-modules/pyspeech1"
env = { UV_PYTHON = "{% if os() == 'windows' %}{{ vars.py3_win }}{% else %}{{ vars.py3_unix }}{% endif %}" }
run = "uv run pytest"

[tasks.build-et-ws-wheel]
depends = ["build-et-cli"]
description = "Build the generated et-ws Python package as a wheel + ws-module pkg/"
Expand Down Expand Up @@ -143,6 +148,17 @@ uv build --wheel --out-dir pkg
"""
shell = "bash -euo pipefail -c"

[tasks.build-ws-pyspeech1-module]
depends = ["build-et-ws-wheel"]
description = "Build the pyspeech1 Python Silero VAD workflow module"
dir = "services/ws-modules/pyspeech1"
run = """
rm -f pkg/*.whl

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Use the mise-managed coreutils for wheel cleanup.

Line 156 invokes an unqualified rm in a new mise task. Use the repository's managed coreutils command or helper so tool resolution remains consistent across supported environments.

As per path instructions, mise task bodies must use mise-managed tools rather than assuming host utilities; use coreutils, rg, find/xargs, and goawk as prescribed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.mise/config.python.toml at line 156, Update the wheel cleanup command in
the mise task to invoke the repository’s mise-managed coreutils `rm` command or
established helper instead of unqualified `rm`, while preserving removal of
matching files under pkg.

Source: Path instructions

uv build --wheel --out-dir pkg
{{ vars.et_cli }} module-package-json
"""
shell = "bash -euo pipefail -c"

[tasks.build-ws-wasi-graphics-info-module]
depends = ["build-et-cli"]
description = "Build the WASI graphics-info Python module as a WASI Preview 2 component"
Expand Down Expand Up @@ -175,6 +191,7 @@ run = """
uv sync --directory services/ws-modules/pydata1
uv sync --directory services/ws-modules/pyeye1
uv sync --directory services/ws-modules/pyface1
uv sync --directory services/ws-modules/pyspeech1
"""
shell = "bash -euo pipefail -c"

Expand Down
23 changes: 22 additions & 1 deletion .mise/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,9 @@ har_repo = ":http:acd17sk/MET-Metabolic-Equivalent-of-Task-AI-Android-APP"
har_src = "{{ vars.har_repo }}/raw/refs/heads/main/Models/onnx/hybrid_met.onnx"
mnist_dst = "services/ws-modules/wasi-graphics-info/pkg/mnist-12.onnx"
mnist_src = ":http:onnx/models/raw/main/validated/vision/classification/mnist/model/mnist-12.onnx"
speech1_asset = "speech1-84f0d86.onnx"
speech1_dst = "data/model-modules/model-speech1/pkg/speech1.onnx"
speech1_src = ":http:onnx-community/silero-vad/resolve/84f0d86/onnx/model_fp16.onnx"
# Pip 26.0.1 wheel via PyPI, pinned to stay compatible with RustPython.
# Pinned because pip 26.1.1+ calls
# `sys.addaudithook` in `_prevent_further_imports`, which RustPython 0.5.0
Expand Down Expand Up @@ -1431,8 +1434,26 @@ shell = "bash -euo pipefail -c"
run = "rclone copyto {{ vars.mnist_src }} {{ vars.mnist_dst }} {{ vars.gh_http }}"
shell = "bash -euo pipefail -c"

[tasks.fetch-speech1-rclone]
run = """
opts="--http-url https://huggingface.co --progress --ignore-existing"
# shellcheck disable=SC2086
rclone copyto {{ vars.speech1_src }} {{ vars.speech1_dst }} $opts
export asset='{{ vars.speech1_asset }}'
sha=$(mise exec -- yq -p toml -oy '.asset[strenv(asset)].sha256' config/upstream-cache/data.toml)
actual=$(mise exec -- coreutils sha256sum -b "{{ vars.speech1_dst }}" | mise exec -- coreutils cut -c1-64)
[ "$actual" = "$sha" ] || { echo "speech1 checksum mismatch: expected=$sha actual=$actual" >&2; exit 1; }
"""
shell = "bash -euo pipefail -c"

[tasks.download-models]
depends = ["fetch-eye1-rclone", "fetch-face1-rclone", "fetch-har-motion1-rclone", "fetch-mnist-rclone"]
depends = [
"fetch-eye1-rclone",
"fetch-face1-rclone",
"fetch-har-motion1-rclone",
"fetch-mnist-rclone",
"fetch-speech1-rclone",
]

[tasks.cargo-test]
description = "Run every Rust test via nextest (web-runner excluded on gnullvm)"
Expand Down
1 change: 1 addition & 0 deletions config/coverage.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ relative_files = true
pydata1 = ["services/ws-modules/pydata1/pydata1", "pydata1", "**/pydata1"]
pyeye1 = ["services/ws-modules/pyeye1/pyeye1", "pyeye1", "**/pyeye1"]
pyface1 = ["services/ws-modules/pyface1/pyface1", "pyface1", "**/pyface1"]
pyspeech1 = ["services/ws-modules/pyspeech1/pyspeech1", "pyspeech1", "**/pyspeech1"]
Comment thread
coderabbitai[bot] marked this conversation as resolved.
1 change: 1 addition & 0 deletions config/pyrefly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ search-path = [
"../services/ws-modules/pydata1",
"../services/ws-modules/pyeye1",
"../services/ws-modules/pyface1",
"../services/ws-modules/pyspeech1",
"../services/ws-pyo3-runner/python",
]

Expand Down
6 changes: 6 additions & 0 deletions config/upstream-cache/data.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ sha256 = "64184e229b263107bc2b804c6625db1341ff2bb731874b0bcc2fe6544e0bc9ff"
upstream = "https://ai.google.dev/edge/mediapipe/solutions/vision/face_landmarker"
url = "https://github.com/edge-toolkit/core/releases/download/hf-cache-v1/face_landmarker.task"

[asset."speech1-84f0d86.onnx"]
license = "MIT"
sha256 = "7ed49c2c170aefe81e7e91b472a761d922ef3c064b6051068c2dc0ccc98bd53b"
upstream = "https://huggingface.co/onnx-community/silero-vad"
url = "https://huggingface.co/onnx-community/silero-vad/resolve/84f0d86/onnx/model_fp16.onnx"

[asset."rustpython-wasm-08a1d6f.tar.gz"]
license = "MIT"
sha256 = "7b81d53f5b3a63c60fc2bc1717e87466026d796ec522b925f009532c7b0291f3"
Expand Down
7 changes: 7 additions & 0 deletions data/model-modules/model-speech1/pkg/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"description": "FP16 ONNX speech detection model",
"license": "MIT",
"name": "et-model-speech1",
"version": "0.1.0",
"files": ["speech1.onnx"]
}
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ members = [
"services/ws-modules/pydata1",
"services/ws-modules/pyeye1",
"services/ws-modules/pyface1",
"services/ws-modules/pyspeech1",
"services/ws-modules/wasi-graphics-info",
]
1 change: 1 addition & 0 deletions services/ws-modules/pyspeech1/pkg/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.whl
Loading
Loading