kr8s-org / kr8s

A batteries-included Python client library for Kubernetes that feels familiar for folks who already know how to use kubectl
https://kr8s.org
BSD 3-Clause "New" or "Revised" License
799 stars 43 forks source link

Experiment with type stubs for the sync API #493

Open jacobtomlinson opened 1 week ago

jacobtomlinson commented 1 week ago

I spent some time today experimenting with type stubs for the sync API (see #491).

This PR adds type stubs for the sync objects API. Right now it only implements the list() method on each object.

I then confirmed in kr8s/tests/test_objects.py::test_sync_pod_list that mypy is happy with these annotations.

The next step it to make a script that autogenerates these stubs based on the source files.

cc @florianvazelle for visibility

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.19%. Comparing base (87063fc) to head (3b9e3c9). Report is 114 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #493 +/- ## ========================================== + Coverage 94.61% 95.19% +0.57% ========================================== Files 29 30 +1 Lines 3141 3977 +836 ========================================== + Hits 2972 3786 +814 - Misses 169 191 +22 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.