-
Notifications
You must be signed in to change notification settings - Fork 47
refactor: split top level client from base client #534
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
Conversation
b2dbe67 to
90638b1
Compare
Split the top level client used to gather all resource client in a single class, from the base client actually doing the requests to the API. This allows us for example to swap or modify the base client in a resource client, that might need a different base client (session, endpoint, headers, ...).
90638b1 to
13f7c0b
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #534 +/- ##
==========================================
+ Coverage 96.01% 96.14% +0.12%
==========================================
Files 64 64
Lines 2938 2928 -10
==========================================
- Hits 2821 2815 -6
+ Misses 117 113 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Ready for a review, but still need to be tested with the Storage Box Actions implementations. |
Squashed commit of the following: commit 4ff9fbc Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:54:47 2025 +0200 test: timeout handling commit 13f7c0b Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:33:26 2025 +0200 test: fix speed optimization commit 458631d Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:29:50 2025 +0200 test: use parent to access other resources clients commit f69a609 Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:28:13 2025 +0200 test: update request_mock fixture commit d565239 Author: jo <ljonas@riseup.net> Date: Tue Aug 12 15:57:25 2025 +0200 refactor: use parent to access other resources clients (2) commit 1703985 Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:25:51 2025 +0200 refactor: use parent to access other resources clients (1) commit adb9232 Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:24:50 2025 +0200 refactor: use type from inherited resource client property commit 3b6c712 Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:18:29 2025 +0200 refactor: split top level client from base client Split the top level client used to gather all resource client in a single class, from the base client actually doing the requests to the API. This allows us for example to swap or modify the base client in a resource client, that might need a different base client (session, endpoint, headers, ...).
Squashed commit of the following: commit 4ff9fbc Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:54:47 2025 +0200 test: timeout handling commit 13f7c0b Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:33:26 2025 +0200 test: fix speed optimization commit 458631d Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:29:50 2025 +0200 test: use parent to access other resources clients commit f69a609 Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:28:13 2025 +0200 test: update request_mock fixture commit d565239 Author: jo <ljonas@riseup.net> Date: Tue Aug 12 15:57:25 2025 +0200 refactor: use parent to access other resources clients (2) commit 1703985 Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:25:51 2025 +0200 refactor: use parent to access other resources clients (1) commit adb9232 Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:24:50 2025 +0200 refactor: use type from inherited resource client property commit 3b6c712 Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:18:29 2025 +0200 refactor: split top level client from base client Split the top level client used to gather all resource client in a single class, from the base client actually doing the requests to the API. This allows us for example to swap or modify the base client in a resource client, that might need a different base client (session, endpoint, headers, ...).
|
I have tested this in https://github.com/hetznercloud/hcloud-python/pull/541/files#r2278661516 Seems to be working just fine. |
Split the top level client used to gather all resource client in a single class, from the base client actually doing the requests to the API.
This allows us for example to swap or modify the base client in a resource client, that might need a different base client (session, endpoint, headers, ...).