Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Active development, making library async compatible, client agnostic etc.

未关闭
#248 0 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
15/100
Issue 类型
重构
描述清晰度
需要澄清
活跃度
停滞
技术栈
python
领域
backend

调研方向

首先,结合现有的完整测试套件,查看链接的 httpx-caching fork,以及所引用的 pull requests 240 和 225,还有 issue 232。建议的方向是一个与客户端无关、支持 sync/async 的缓存库,并配备 sans-IO 测试;要视为完成,需要达成一致的设计和实现计划,而不是进行一次单独的局部修改。

由索引模型根据 Issue 内容生成。

描述

Just wanted to create a bit of a point of discussion regarding "the big picture".

It would seem that @ionrock doesn't have masses of time to spend on this project at the moment. It works great, and a lot of people use it. Smaller changes are being merged but the occasional burst of more extensive input / PRs by contributors tend to fizzle out. This is totally understandable. But would be great if this energy could be put to use!

At the end of last year I got excited about httpx and decided I wanted to try and port this library to work with it. I then got larger aspirations and decided to try and separate the caching logic from the IO following the sans-io philosophy (and therefor also the requests specific stuff). This would mean it could have a transport for requests and a transport for httpx, and would also be fully asyncio compatible.

To be honest it was more a bit of fun than anything, but I had a bee in my bonnet and got it working, with the full test suite passing, sync and async. The caching policy is implemented as a coroutine, which seemed a pretty neat abstraction at the time. It works with async, but there's only an in-memory cache backend at the moment. Other backends could be added with full asyncio compatibility which would be cool!

I guess the big question is, is there enough interest / energy out there to make something happen.

My vision would be a httpx/requests agnostic, sync async compatible library. The test suite would be all data in and out of the sans-io protocol, no need for mocking requests etc. (this isn't something I got round to doing but shouldn't be hard to do with the existing test suite).

My fork may or may not be a good starting point! I'm quite happy with it..

I wish I could say I had loads of time and energy to put into something like this, but health issues mean I might not be able to offer much more than discussion and code reviews, and my fork if someone wanted to use it as a starting point. I also hope I'm not treading on any toes, just don't want to see good intentions and code go to waste.

https://github.com/ionrock/cachecontrol/pull/240
@Flameeyes's large refactor PR (would have based my fork on this if I'd known about it)
https://github.com/ionrock/cachecontrol/pull/225
https://github.com/ionrock/cachecontrol/issues/232

@Flameeyes @hexagonrecursion

主要语言
Python
星标
505
派生
153
平均合并
5 天 6 小时
30 天内合并 PR
5

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

psf/cachecontrol 的其他 Issue

查看 psf/cachecontrol 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。