Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YAML consolidation prelude: High-level libnetplan bindings (FR-702) #250

Merged
merged 3 commits into from
Jan 13, 2022

Conversation

schopin-pro
Copy link
Contributor

Description

This PR introduces some high-level Python bindings. This is mostly a skeleton that will be populated with the needed elements in later PRs, which will remain in draft state until this one is merged.

Checklist

  • Runs make check successfully.
  • Retains 100% code coverage (make check-coverage).
  • New/changed keys in YAML format are documented.
  • (Optional) Adds example YAML for new feature.
  • (Optional) Closes an open bug in Launchpad.

@schopin-pro schopin-pro requested a review from slyon January 5, 2022 18:34
@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2022

Codecov Report

Merging #250 (60862fd) into main (095710a) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head 60862fd differs from pull request most recent head f55b847. Consider uploading reports for the commit f55b847 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #250      +/-   ##
==========================================
+ Coverage   99.10%   99.11%   +0.01%     
==========================================
  Files          58       60       +2     
  Lines       10078    10206     +128     
==========================================
+ Hits         9988    10116     +128     
  Misses         90       90              
Impacted Files Coverage Δ
tests/test_utils.py 100.00% <ø> (ø)
netplan/cli/commands/set.py 100.00% <100.00%> (ø)
netplan/cli/utils.py 100.00% <100.00%> (ø)
netplan/libnetplan.py 100.00% <100.00%> (ø)
src/abi_compat.c 100.00% <100.00%> (ø)
src/types.c 100.00% <100.00%> (ø)
src/util.c 100.00% <100.00%> (ø)
tests/parser/base.py 100.00% <100.00%> (ø)
tests/test_libnetplan.py 100.00% <100.00%> (ø)
tests/utils.py 100.00% <100.00%> (ø)
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 095710a...f55b847. Read the comment docs.

@schopin-pro schopin-pro changed the title YAML consolidation prelude: High-level libnetplan bindings YAML consolidation prelude: High-level libnetplan bindings (FR-702) Jan 5, 2022
Copy link
Collaborator

@slyon slyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the way you're setting up the python bindings for libnetplan here.
I left a few comments inline that we should improve upon, but nothing big or critical.

This is another really sleek PR, thanks for that!

src/types.c Show resolved Hide resolved
src/types.c Show resolved Hide resolved
tests/test_libnetplan.py Show resolved Hide resolved
src/abi_compat.c Outdated Show resolved Hide resolved
src/util.c Outdated Show resolved Hide resolved
src/util.c Outdated Show resolved Hide resolved
netplan/libnetplan.py Outdated Show resolved Hide resolved
netplan/libnetplan.py Show resolved Hide resolved
netplan/libnetplan.py Outdated Show resolved Hide resolved
netplan/libnetplan.py Show resolved Hide resolved
@schopin-pro schopin-pro force-pushed the yaml-consolidation-bindings-prelude branch 4 times, most recently from 60862fd to fc4b8fa Compare January 10, 2022 11:40
schopin-pro and others added 3 commits January 11, 2022 10:31
The utils module was getting kind of crowded.
We're using the iterator as the introduction point of the transition,
but the idea is to use these classes as the main way to interact with
the C library.

Note the temporary GlobalState class that has been introduced as a
temporary measure. It should be gone by the end of the patchset.
:)

V2:
* rename struct devtype_def_iter to netdef_pertype_iter
Co-authored-by: Lukas Märdian <slyon@ubuntu.com>
Copy link
Collaborator

@slyon slyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! All remarks have been addressed, LGTM!

Merging.

@slyon slyon merged commit d3f81b3 into canonical:main Jan 13, 2022
@schopin-pro schopin-pro deleted the yaml-consolidation-bindings-prelude branch January 13, 2022 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants