Skip to content

Replace dependency requests with httpx #12732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cclauss opened this issue May 12, 2025 · 3 comments · Fixed by #12744 · May be fixed by #12745
Closed

Replace dependency requests with httpx #12732

cclauss opened this issue May 12, 2025 · 3 comments · Fixed by #12744 · May be fixed by #12745
Labels
dependencies Pull requests that update a dependency file enhancement This PR modified some existing files good first issue help wanted

Comments

@cclauss
Copy link
Member

cclauss commented May 12, 2025

Feature description

https://pypi.org/project/requests is becoming less popular.
https://pypi.org/project/httpx is a next-generation HTTP client for Python.

Edit the file requirements.txt to remove requests and add httpx. Keep the file sorted alphabetically.

requests

Edit the file .pre-commit-config.yaml to remove additional_dependencies: [types-requests]

additional_dependencies: [types-requests]

Modify the 36 Python files that import requests to use httpx instead.

If an algorithm does multiple httpx calls, consider if the AsyncClient should be used.

Add PEP723 headers to allow the scripts to be run standalone.

+ # /// script
+ # requires-python = ">=3.13"
+ # dependencies = [
+ #     "httpx",
+ # ]
+ # ///
@cclauss cclauss added enhancement This PR modified some existing files help wanted good first issue dependencies Pull requests that update a dependency file labels May 12, 2025
@cclauss cclauss changed the title Replace dependency requests with httpx Replace dependency requests with httpx May 12, 2025
@cclauss cclauss pinned this issue May 12, 2025
@lukazlim
Copy link
Contributor

Hi, I would like to take this issue, by when would you like the change to be completed?

@cclauss
Copy link
Member Author

cclauss commented May 13, 2025

No rush. Take your time to do it right. We do not assign issues, so someone else might deliver a PR before yours.

@lukazlim
Copy link
Contributor

lukazlim commented May 13, 2025

Submitted a PR, the changes don't include web_programming/get_imdbtop.py.DISABLED which triggers algorithms-keeper to automatically close the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement This PR modified some existing files good first issue help wanted
Projects
None yet
2 participants