Skip to content

Commit 26b6b88

Browse files
deps: drop tweepy + migrate remaining requests refs to httpx2
- maths/allocation_number.py: docstring example uses httpx2, not requests - web_programming/get_imdbtop.py.DISABLED: import httpx2 instead of requests - remove web_programming/get_user_tweets.py.DISABLED (a Twitter API how-to, not an algorithm) and drop the tweepy dependency that was its only user and the last high-level dep pulling in requests - uv.lock intentionally untouched (keeper allow-list) Refs #15081
1 parent 1a36dcd commit 26b6b88

4 files changed

Lines changed: 3 additions & 63 deletions

File tree

‎maths/allocation_number.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
each worker thread with a block of non-overlapping bytes to download.
44
For example:
55
for i in allocation_list:
6-
requests.get(url,headers={'Range':f'bytes={i}'})
6+
httpx2.get(url, headers={"Range": f"bytes={i}"})
77
"""
88

99
from __future__ import annotations

‎pyproject.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ dependencies = [
2626
"scipy>=1.18.1",
2727
"statsmodels>=0.14.4",
2828
"sympy>=1.13.3",
29-
"tweepy>=4.14",
3029
"typing-extensions>=4.12.2",
3130
"xgboost>=2.1.3",
3231
]

‎web_programming/get_imdbtop.py.DISABLED‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import bs4
2-
import requests
2+
import httpx2
33

44

55
def get_movie_data_from_soup(soup: bs4.element.ResultSet) -> dict[str, str]:
@@ -35,7 +35,7 @@ def get_imdb_top_movies(num_movies: int = 5) -> tuple:
3535
"https://www.imdb.com/search/title?title_type="
3636
f"feature&sort=num_votes,desc&count={num_movies}"
3737
)
38-
source = bs4.BeautifulSoup(requests.get(base_url).content, "html.parser")
38+
source = bs4.BeautifulSoup(httpx2.get(base_url).content, "html.parser")
3939
return tuple(
4040
get_movie_data_from_soup(movie)
4141
for movie in source.find_all("div", class_="lister-item mode-advanced")

‎web_programming/get_user_tweets.py.DISABLED‎

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)