Repository navigation
Conversation
|
I'd consider this a new feature adding support for hishel v2, rather than a githubkit installation fix. |
|
@yanyongyu sure, the fix is here #339. All that to say, currently installation from pypi is broken. |
|
Reviewing this as a migration checklist, since I checked the new signature directly: CacheTransport(next_transport, storage: BaseStorage | None = None, rfc: bool | CacheOptions = False)
AsyncCacheTransport(next_transport, storage: AsyncBaseStorage | None = None, rfc: bool | CacheOptions = False)The One thing I would change before this lands: The default flipped from Two smaller notes:
If it is useful, I can test the caching path against a real conditional request, since the default question is the only part I cannot settle from the diff alone. |
|
@mgkvibez I addressed your smaller notes but I disagree that prints |
|
You're right and I was wrong. I checked it against hishel 1.4.0 rather than trusting my reading: which is the same object the no-argument constructor gives. So Looking closer, the mapping you chose is the right one, and for a reason worth recording in the migration note: 2.0's own default is not the spec path. In One residual difference, which I am flagging as an observation rather than a defect since I have already been wrong once in this thread: 2.0's |
|
@mgkvibez I suspect that you're a bot or are just using an LLM to review the code so I will disregard your comments from now on. |
1 similar comment
|
@mgkvibez I suspect that you're a bot or are just using an LLM to review the code so I will disregard your comments from now on. |
|
None of that tbh.. I just don't do much of composing and typing a lot so I have an llm at hand who always restructure my reviews but if you want to take it like that it's fine you can do what you want @gigeresk |
yanyongyu
left a comment
There was a problem hiding this comment.
good work! some small suggestions
| raise NotImplementedError | ||
|
|
||
| def get_hishel_policy(self) -> CachePolicy: | ||
| def get_hishel_policy(self) -> CacheOptions: |
There was a problem hiding this comment.
This method is still called policy. We may add a new method get_hishel_options with get_hishel_policy backport or just remove it.
| BaseStorage, | ||
| CacheOptions, |
There was a problem hiding this comment.
Seems need reformat, remove the comma
| self.storage: SyncBaseStorage | None = kwargs.pop("storage", None) | ||
| self.policy: CachePolicy | None = kwargs.pop("policy", None) | ||
| self.storage: BaseStorage | None = kwargs.pop("storage", None) | ||
| policy = kwargs.pop("policy", True) |
There was a problem hiding this comment.
the arg name policy is outdated. this should be rfc, align with hishel v2.
| self.policy: CachePolicy | None = kwargs.pop("policy", None) | ||
| self.storage: BaseStorage | None = kwargs.pop("storage", None) | ||
| policy = kwargs.pop("policy", True) | ||
| _check_policy(policy) |
| ) -> None: | ||
| super().__init__( | ||
| default_ttl=default_ttl, refresh_ttl_on_access=refresh_ttl_on_access | ||
| default_ttl=default_ttl, |
#339 added a version lock to hishel<2.0 because hishel 2.0 was released today and this breaks githubkit installation. This PR attempts to update the source to reflect hishel's 2.0 API changes.