python-onnx-asr

LOW
maintainer ronb1964 0 votes scanned 2026-11-04 04:05:54.882945
View on AUR
Why flagged

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

Triggered rules

Low Few votes, recently uploaded zero_votes_recent

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

PKGBUILD

1# Maintainer: Ron Brand <ronb1964@gmail.com>
2pkgname=python-onnx-asr
3_name=onnx_asr
4pkgver=0.12.0
5pkgrel=1
6pkgdesc="Speech recognition with ONNX models (Parakeet, Whisper, GigaAM and others)"
7arch=('any')
8url="https://github.com/istupakov/onnx-asr"
9license=('MIT')
10depends=('python' 'python-numpy' 'python-onnxruntime')
11optdepends=('python-huggingface-hub: download models from the Hugging Face Hub')
12# The build hook generates the preprocessors as .onnx files with onnxscript
13# and ml-dtypes, so those two are needed to build but not to run.
14makedepends=('python-build' 'python-installer' 'python-hatchling' 'python-hatch-vcs'
15 'python-onnxscript' 'python-ml-dtypes')
16# Upstream's conftest.py imports huggingface_hub and test_build.py imports onnx.
17checkdepends=('python-pytest' 'python-huggingface-hub' 'python-onnx')
18source=("https://files.pythonhosted.org/packages/source/o/onnx-asr/${_name}-${pkgver}.tar.gz")
19sha256sums=('c1fcacddbced392f9f769ed5c6223f4ce739a6e4549346de33b9b520d4ead713')
20
21build() {
22 cd "${_name}-${pkgver}"
23 # Fixes the version so it never depends on git or the sdist's PKG-INFO.
24 SETUPTOOLS_SCM_PRETEND_VERSION="$pkgver" python -m build --wheel --no-isolation
25}
26
27# Most of upstream's tests download models from the Hugging Face Hub or
28# compare against torch, NeMo and Whisper, which a build has neither. These
29# three need neither, and the heredoc runs the preprocessor Parakeet uses,
30# generated by the build hook, from the wheel just built. The Hub is offline
31# with a cache of its own, so nothing is downloaded: test_file_not_found_error
32# then passes on the Hub's LocalEntryNotFoundError, a FileNotFoundError.
33# test_cli_run transcribes with whisper-base when python-soundfile is
34# installed, a model an offline build doesn't have.
35check() {
36 cd "${_name}-${pkgver}"
37 local site_packages
38 site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
39 rm -rf test_dir
40 python -m installer --destdir=test_dir dist/*.whl
41 # The wheel just built, and the sdist's root for the top-level
42 # preprocessors package test_build.py imports, which the wheel leaves out.
43 export PYTHONPATH="$PWD/test_dir$site_packages:$PWD"
44 export HF_HUB_OFFLINE=1 HF_HOME="$PWD/test_dir/hf-home"
45 python -m pytest -p no:cacheprovider tests/onnx_asr/test_cli.py \
46 tests/onnx_asr/test_manager.py tests/preprocessors/test_build.py \
47 --deselect tests/onnx_asr/test_cli.py::test_cli_run
48 python - <<'EOF'
49import numpy as np
50from onnx_asr.preprocessors.preprocessor import OnnxPreprocessor
51
52features, _ = OnnxPreprocessor("nemo128", {})(np.zeros((1, 16000), np.float32),
53 np.array([16000]))
54assert features.shape[1] == 128, features.shape
55EOF
56}
57
58package() {
59 cd "${_name}-${pkgver}"
60 python -m installer --destdir="$pkgdir" dist/*.whl
61 install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
62}
63

Scan history

Scanned at (UTC)SeverityRules
2026-11-04 04:05:54 Low 1

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion