yanyongyu / githubkit

The modern, all-batteries-included GitHub SDK for Python, including rest api, graphql, webhooks, like octokit!
MIT License
176 stars 25 forks source link

Bug: fix cache and cycle ref issue #81

Closed yanyongyu closed 9 months ago

yanyongyu commented 9 months ago

Use weakref to avoid cycle ref. This can improve the gc collection. Instance can be collected immediately after var release now.

Also fix #79 . Cache now depends on github instance weakref.

codecov[bot] commented 9 months ago

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (8a381cb) 75.60% compared to head (f5612df) 75.60%.

Files Patch % Lines
githubkit/versions/rest.py 92.85% 1 Missing :warning:
githubkit/versions/v2022_11_28/rest/__init__.py 85.71% 1 Missing :warning:
githubkit/versions/v2022_11_28/rest/repos.py 85.71% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #81 +/- ## ======================================= Coverage 75.60% 75.60% ======================================= Files 541 541 Lines 59462 59482 +20 ======================================= + Hits 44957 44974 +17 - Misses 14505 14508 +3 ``` | [Flag](https://app.codecov.io/gh/yanyongyu/githubkit/pull/81/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ju4tCode) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/yanyongyu/githubkit/pull/81/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ju4tCode) | `75.60% <89.28%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ju4tCode#carryforward-flags-in-the-pull-request-comment) to find out more.

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