tools: ynl: pyynl: re-export the library API from the package root

The public classes live in pyynl.lib, so users had to spell out

  from pyynl.lib import YnlFamily

which I forget at least once a month. Re-export lib's API from
the package __init__ so that

  from pyynl import YnlFamily

works as well. I don't think there was a real reason not to do
this?

Acked-by: Jan Stancek <jstancek@redhat.com>
Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://patch.msgid.link/20260701021751.3234681-2-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Jakub Kicinski 2026-06-30 19:17:50 -07:00 committed by Paolo Abeni
parent 8d96107b58
commit df87e5c4e9

View File

@ -0,0 +1,9 @@
# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
""" Python YNL (YAML Netlink) library. """
# Re-export the public library API so it can be imported straight from the
# package, e.g. `from pyynl import YnlFamily`.
# pylint: disable=wildcard-import,unused-wildcard-import
from .lib import *
from .lib import __all__