...along with a bunch of incompatible API/ABI changes.
I had to make a few tweaks in the build process as well, and these
couldn't be made (and tested!) with separate commits. The test suite was
failing on OS X 13, so I decided to upgrade, because "why not".
Warning, Context.get_module's API changed, the revision no longer
default to `None` because passing `None` explicitly asks for a module
with no associated revision. Use `Context.get_module_latest` when the
previous behavior is needed. This is a deliberate change from the C++
library; only in C++ a compiler catches this :).
See-also: https://gerrit.cesnet.cz/c/CzechLight/libyang-cpp/+/6732
See-also: https://gerrit.cesnet.cz/c/CzechLight/libyang-cpp/+/6733
There are some failures with `gnpy` on Windows:
================================== FAILURES ===================================
____________ test_lint_yang[ietf-network-topology@2018-02-26.yang] ____________
yang_model = WindowsPath('D:/a/oopt-gnpy/oopt-gnpy/gnpy/yang/ext/ietf-network-topology@2018-02-26.yang')
@pytest.mark.parametrize("yang_model", [x for x in external_path().glob('*.yang')] + [x for x in model_path().glob('*.yang')], ids=_get_basename)
def test_lint_yang(yang_model):
'''Run a linter on each YANG model'''
c = ly.Context(str(external_path()) + os.pathsep + str(model_path()),
ly.ContextOptions.NoYangLibrary | ly.ContextOptions.DisableSearchCwd)
assert c.parse_module(yang_model, ly.SchemaFormat.YANG) is not None
> assert c.errors() == []
E assert <[TypeError("unhashable type: 'instancemethod'") raised in repr()] list object at 0x1880e5958c0> == []
E (pytest_assertion plugin: representation of details failed: C:\hostedtoolcache\windows\Python\3.11.4\x64\Lib\pprint.py:178: TypeError: unhashable type: 'instancemethod'.
E Probably an object has a faulty __repr__.)
tests\test_yang_lint.py:30: AssertionError
---------------------------- Captured stderr call -----------------------------
libyang[1]: File name "D:\a\oopt-gnpy\oopt-gnpy\gnpy\yang\ext\ietf-network-topology@2018-02-26.yang" does not match module name "ietf-network-topology".
________________ test_lint_yang[ietf-network@2018-02-26.yang] _________________
That complaint about __repr__ is an impedance mismatch between pybind11
and Python (pybind/pybind11#2722), but in this case that whole thing is
triggered through a bug in libyang which assumes that the directory
separator is always `/`.
Bug: https://github.com/CESNET/libyang/pull/2093