Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Investigate linking issue in test in CI pipeline under certain conditions #1200

Description

@JCGoran

Currently the __init__.py of the Python bindings contains the following peculiar try..except block:

nmodl/nmodl/__init__.py

Lines 34 to 41 in f930357

try:
# Try importing but catch exception in case bindings are not available
from ._nmodl import NmodlDriver, to_json, to_nmodl # noqa
from ._nmodl import __version__
__all__ = ["NmodlDriver", "to_json", "to_nmodl"]
except ImportError:
print("[NMODL] [warning] :: Python bindings are not available")

Without it, it seems that the Ode test fails with a linking error:

106/111 Test #106: Ode .................................................................................................***Failed    0.67 sec
============================= test session starts ==============================
platform linux -- Python 3.8.18, pytest-8.1.0, pluggy-1.4.0
rootdir: /home/runner/work/nmodl/nmodl
configfile: pyproject.toml
plugins: anyio-4.3.0, cov-4.1.0
collected 0 items / 1 error

==================================== ERRORS ====================================
__________________ ERROR collecting test/unit/ode/test_ode.py __________________
ImportError while importing test module '/home/runner/work/nmodl/nmodl/test/unit/ode/test_ode.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
../../../test/unit/ode/test_ode.py:6: in <module>
    from nmodl.ode import differentiate2c, integrate2c
../../lib/nmodl/__init__.py:34: in <module>
    from ._nmodl import NmodlDriver, to_json, to_nmodl, __version__  # noqa
E   ImportError: libclang_rt.ubsan_standalone-x86_64.so: cannot open shared object file: No such file or directory
=========================== short test summary info ============================
ERROR ../../../test/unit/ode/test_ode.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.14s ===============================

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions