Package Details: python-onnxoptimizer 0.4.2-2

Git Clone URL: https://aur.archlinux.org/python-onnxoptimizer.git (read-only, click to copy)
Package Base: python-onnxoptimizer
Description: ONNX model optimizer
Upstream URL: https://github.com/onnx/optimizer
Licenses: Apache-2.0
Submitter: yan12125
Maintainer: Smoolak
Last Packager: Smoolak
Votes: 3
Popularity: 0.000000
First Submitted: 2021-04-10 15:29 (UTC)
Last Updated: 2026-02-16 22:26 (UTC)

Latest Comments

micwoj92 commented on 2026-02-17 05:23 (UTC)

Thanks for quick fix. Fyi it should not be necessary to add numpy to checkdeps as it is (implicitly) pulled in via python-onnx.

Smoolak commented on 2026-02-16 22:45 (UTC)

@micwoj92 The test suite was inadvertently dropped when updating to 0.4.2 due to switching the PKGBUILD to the PEP 517 build method (python -m build --wheel), which doesn't leave the C++ extension in the build tree where pytest could find it. The check() wasn't adapted for that change, and as you noted, the fallback import test had the same problem since it could only succeed if the package was already installed. Fixed in 0.4.2-2 by installing the built wheel to a temporary directory and running the full test suite against it. Sorry for the inconvenience, and thanks for reporting.

micwoj92 commented on 2026-02-16 21:51 (UTC)

Why was running test suite replaced by just import test? It also fails without onnxoptimizer already installed:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import onnxoptimizer; print(onnxoptimizer.__version__)
    ^^^^^^^^^^^^^^^^^^^^
  File "/build/python-onnxoptimizer/src/onnx-optimizer/onnxoptimizer/__init__.py", line 14, in <module>
    import onnxoptimizer.onnx_opt_cpp2py_export as C
ModuleNotFoundError: No module named 'onnxoptimizer.onnx_opt_cpp2py_export'
Warning: Import test failed

micwoj92 commented on 2025-12-11 20:27 (UTC)

Check fails:

============================= test session starts ==============================
platform linux -- Python 3.13.11, pytest-8.4.2, pluggy-1.6.0
rootdir: /build/python-onnxoptimizer/src/onnx-optimizer
configfile: setup.cfg
testpaths: onnxoptimizer/test/
plugins: nbval-0.11.0
collected 0 items / 1 error

==================================== ERRORS ====================================
____________ ERROR collecting onnxoptimizer/test/optimizer_test.py _____________
ImportError while importing test module '/build/python-onnxoptimizer/src/onnx-optimizer/onnxoptimizer/test/optimizer_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
onnxoptimizer/test/optimizer_test.py:19: in <module>
    import onnx
/usr/lib/python3.13/site-packages/onnx/__init__.py:131: in <module>
    from onnx import (
/usr/lib/python3.13/site-packages/onnx/compose.py:8: in <module>
    from onnx import (
/usr/lib/python3.13/site-packages/onnx/helper.py:21: in <module>
    from onnx import _mapping, defs, subbyte
/usr/lib/python3.13/site-packages/onnx/_mapping.py:8: in <module>
    import ml_dtypes
E   ModuleNotFoundError: No module named 'ml_dtypes'
=========================== short test summary info ============================
ERROR onnxoptimizer/test/optimizer_test.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 1.96s ===============================