Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: LabNConsulting/libyang-python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3072af0
Choose a base ref
...
head repository: CESNET/libyang-python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2cae616
Choose a head ref
  • 16 commits
  • 14 files changed
  • 4 contributors

Commits on Oct 16, 2025

  1. data: option to allow json int/bool as strings

    Depends on CESNET/libyang#2344
    
    Add support for new option to python bindings.
    
    Signed-off-by: Brad House <[email protected]>
    bradh352 authored and rjarry committed Oct 16, 2025
    Configuration menu
    Copy the full SHA
    18faa1e View commit details
    Browse the repository at this point in the history
  2. schema/context: restore some backlinks support

    In libyang v1 the schema nodes had a backlinks member to be able to
    look up dependents of the node.  SONiC depends on this to provide
    functionality it uses and it needs to be exposed via the python
    module.
    
    In theory, exposing the 'dfs' functions could make this work, but
    it would likely be cost prohibitive since walking the tree would
    be expensive to create a python node for evaluation in native
    python.
    
    Instead this PR depends on the this libyang PR:
    CESNET/libyang#2352
    And adds thin wrappers.
    
    This implementation provides 2 python functions:
     * Context.find_backlinks_paths() - This function can
       take the path of the base node and find all dependents.  If
       no path is specified, then it will return all nodes that contain
       a leafref reference.
     * Context.find_leafref_path_target_paths() - This function takes
       an xpath, then returns all target nodes the xpath may reference.
       Typically only one will be returned, but multiples may be in the
       case of a union.
    
    A user can build a cache by combining Context.find_backlinks_paths()
    with no path set and building a reverse table using
    Context.find_leafref_path_target_paths()
    
    Signed-off-by: Brad House <[email protected]>
    bradh352 authored and rjarry committed Oct 16, 2025
    Configuration menu
    Copy the full SHA
    c8313b7 View commit details
    Browse the repository at this point in the history
  3. context: use normal type hint rather than forward reference

    SNode is imported and available so there's no need to use the "libyang.SNode"
    forward reference form. (based)pyright complains about this as it considers
    these forward references as `Unknown` -- perhaps it should be smarter, but
    that's a different issue.
    
    Signed-off-by: Christian Hopps <[email protected]>
    choppsv1 authored and rjarry committed Oct 16, 2025
    Configuration menu
    Copy the full SHA
    91067eb View commit details
    Browse the repository at this point in the history
  4. tests: test_iffeature_state crash fix

    As observed on Debian Trixie RC2, test_iffeature_state crashes due
    to an internal pointer being invalidated.  This invalidation appears
    to be due to a call to lys_set_implemented() possibly causing a
    full recompile of the ctx.
    
    This simply reorders the caching of the path pointers so they are
    not invalidated when used.
    
    Signed-off-by: Brad House <[email protected]>
    bradh352 authored and rjarry committed Oct 16, 2025
    Configuration menu
    Copy the full SHA
    1714370 View commit details
    Browse the repository at this point in the history
  5. data: add missing DNode.is_default API

    Add access to libyang lyd_is_default() API.
    
    Signed-off-by: Christian Hopps <[email protected]>
    choppsv1 authored and rjarry committed Oct 16, 2025
    Configuration menu
    Copy the full SHA
    aa3f506 View commit details
    Browse the repository at this point in the history
  6. data: add missing DataType's

    Simplify the code to using python enum functionality.
    
    Signed-off-by: Christian Hopps <[email protected]>
    choppsv1 authored and rjarry committed Oct 16, 2025
    Configuration menu
    Copy the full SHA
    e977f94 View commit details
    Browse the repository at this point in the history
  7. data: adding ability to get target_nodes

    This patch introduces target_nodes API, which allows user
    to get all target data nodes that current leafref node is pointing
    to
    
    Signed-off-by: Stefan Gula <[email protected]>
    steweg authored and rjarry committed Oct 16, 2025
    Configuration menu
    Copy the full SHA
    2740fa2 View commit details
    Browse the repository at this point in the history
  8. data: adding dep_tree option for RPC validation

    This patch introduces dep_tree option to provide config
    data to which the RPC can referenced to during validation
    
    Signed-off-by: Stefan Gula <[email protected]>
    steweg authored and rjarry committed Oct 16, 2025
    Configuration menu
    Copy the full SHA
    39afe5e View commit details
    Browse the repository at this point in the history
  9. schema: adds ability to use with_choice option in children calls

    This patch adds ability to use with_choice within RPC and Notification
    
    Signed-off-by: Stefan Gula <[email protected]>
    steweg authored and rjarry committed Oct 16, 2025
    Configuration menu
    Copy the full SHA
    4147016 View commit details
    Browse the repository at this point in the history
  10. schema: adds ability to get various outputs as extension parent_node

    This patch adds ability to get also PRefine, PType and PEnum as a valid
    output using extension parent_node function
    
    Signed-off-by: Stefan Gula <[email protected]>
    steweg authored and rjarry committed Oct 16, 2025
    Configuration menu
    Copy the full SHA
    d3dd5f0 View commit details
    Browse the repository at this point in the history
  11. data: add structured error in exception

    Refactor LibyangError exception handling with structured details
    
    Signed-off-by: Pepa Hajek <[email protected]>
    Pepa Hajek authored and rjarry committed Oct 16, 2025
    Configuration menu
    Copy the full SHA
    90dad07 View commit details
    Browse the repository at this point in the history
  12. schema: add missing extensions() for access to module level

    Currently only have access to the extensions used under schema nodes, need
    access to extensions used at the module level.
    
    Add a test case for the functionality as well.
    
    Signed-off-by: Christian Hopps <[email protected]>
    choppsv1 authored and rjarry committed Oct 16, 2025
    Configuration menu
    Copy the full SHA
    b78cdce View commit details
    Browse the repository at this point in the history
  13. schema: adds extensions and get_extension for Enum class

    This patch allows to get extensions on Enum type
    
    Signed-off-by: Stefan Gula <[email protected]>
    steweg authored and rjarry committed Oct 16, 2025
    Configuration menu
    Copy the full SHA
    2ff17b4 View commit details
    Browse the repository at this point in the history
  14. context: adds find_xpath_atoms function

    This patch is adding find_xpath_atoms on context level to allow users to
    get all nodes needed for xpath evaluation
    
    Signed-off-by: Stefan Gula <[email protected]>
    steweg authored and rjarry committed Oct 16, 2025
    Configuration menu
    Copy the full SHA
    b35336b View commit details
    Browse the repository at this point in the history
  15. schema: adds ability to get when context nodes

    This patch adds ability to get context schema node from which when
    contition is evaluated. It also fixes memory leak of original
    when_conditions
    
    Signed-off-by: Stefan Gula <[email protected]>
    steweg authored and rjarry committed Oct 16, 2025
    Configuration menu
    Copy the full SHA
    74b7d1d View commit details
    Browse the repository at this point in the history
  16. schema: adds libyang.Enum to package

    This patch adds missing Enum class to __init__.py to allow imports by
    library users
    
    Signed-off-by: Stefan Gula <[email protected]>
    steweg authored and rjarry committed Oct 16, 2025
    Configuration menu
    Copy the full SHA
    2cae616 View commit details
    Browse the repository at this point in the history
Loading