Skip to content

Requests migration story #293

Closed
Closed

Description

@florimondmanca

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

  1. added
    questionFurther information is requested
    user-experienceEnsuring that users have a good experience using the library
    and removed
    questionFurther information is requested
    on Aug 29, 2019
  2. florimondmanca commented on Sep 18, 2019

    @florimondmanca
    ContributorAuthor

    Lemme drop this here @sethmlarson 🙃 https://twitter.com/sethmlarson/status/1174396408276955137?s=21

    files.pythonhosted.org presents "h2" via ALPN, wonder how tough it'd be to make a fork of pip to use #HTTPX instead of Requests to take advantage of that. :)

  3. sethmlarson commented on Sep 18, 2019

    @sethmlarson
    Contributor

    That'd be a true 💪 flex if I ever saw one.

  4. yeraydiazdiaz commented on Sep 19, 2019

    @yeraydiazdiaz
    Contributor

    Big 👍 from me.

    I'm still unclear on how httpx would work on multithreading/multiprocessing situations though given that we use run_in_executor for our sync story. If I recall correctly libraries like elasticsearch-py are heavily based on threading/processing solutions. Maybe it's worth investigating separately?

  5. florimondmanca commented on Mar 5, 2020

    @florimondmanca
    ContributorAuthor

    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. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    requests-compatIssues related to Requests backwards compatibilityuser-experienceEnsuring that users have a good experience using the library

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions