Repository navigation
Description
I know that Requests compatibility is an important feature that HTTPX aims at providing. I was thinking about this and had a couple of ideas relative to having people migrating from Requests to HTTPX.
1 - Migration guide. If I was a user thinking of doing the migration, I'd be looking for a migration guide. It should be prominently placed on the project home page, explain the various steps to follow, and highlight key points to pay attention to (e.g. API differences and missing/replaced features). I think we already capture part of this here.
2 - Migration QA. To ensure that our API is actually Requests-compatible (at least on a basic level), we could just test it. For example, ensure that a simple requests-based test suite keeps passing if we search/replace requests with httpx.
3 - Automated migration. Pushing the idea further, we could provide some kind of tool to automatically upgrade code from Requests to HTTPX. (Being familiar with the Angular ecosystem, I remember that rxjs-5-to-6-migrate has made the switch from RxJS v5 to RxJS v6 much easier, and I'm sure it resulted in increased adoption overall.) I'm not sure how relevant and how much impact this will have, but I'd be interested in experimenting with this (seems like an interesting opportunity to play with the AST module or a tool like Bowler? 😄).
Mostly opening this to capture these ideas, not sure where this will go. Any thoughts much welcome!
Activity
florimondmanca commentedon Sep 18, 2019
Lemme drop this here @sethmlarson 🙃 https://twitter.com/sethmlarson/status/1174396408276955137?s=21
sethmlarson commentedon Sep 18, 2019
That'd be a true 💪 flex if I ever saw one.
yeraydiazdiaz commentedon Sep 19, 2019
Big 👍 from me.
I'm still unclear on how
httpxwould work on multithreading/multiprocessing situations though given that we userun_in_executorfor our sync story. If I recall correctly libraries like elasticsearch-py are heavily based on threading/processing solutions. Maybe it's worth investigating separately?florimondmanca commentedon Mar 5, 2020
Closing this as I think we've got a fairly comprehensive Requests compatibility guide now, and anything more definitely won't fit in anyone's time table I believe. :-)