mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
Lukazlim: Replace dependency requests
with httpx
(#12744)
* Replace dependency `requests` with `httpx` Fixes #12742 Signed-off-by: Lim, Lukaz Wei Hwang <lukaz.wei.hwang.lim@intel.com> * updating DIRECTORY.md * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: Lim, Lukaz Wei Hwang <lukaz.wei.hwang.lim@intel.com> Co-authored-by: Lim, Lukaz Wei Hwang <lukaz.wei.hwang.lim@intel.com> Co-authored-by: cclauss <cclauss@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -3,8 +3,8 @@
|
||||
# /// script
|
||||
# requires-python = ">=3.13"
|
||||
# dependencies = [
|
||||
# "httpx",
|
||||
# "pytest",
|
||||
# "requests",
|
||||
# ]
|
||||
# ///
|
||||
|
||||
@ -15,8 +15,8 @@ import os
|
||||
import pathlib
|
||||
from types import ModuleType
|
||||
|
||||
import httpx
|
||||
import pytest
|
||||
import requests
|
||||
|
||||
PROJECT_EULER_DIR_PATH = pathlib.Path.cwd().joinpath("project_euler")
|
||||
PROJECT_EULER_ANSWERS_PATH = pathlib.Path.cwd().joinpath(
|
||||
@ -66,7 +66,7 @@ def added_solution_file_path() -> list[pathlib.Path]:
|
||||
"Accept": "application/vnd.github.v3+json",
|
||||
"Authorization": "token " + os.environ["GITHUB_TOKEN"],
|
||||
}
|
||||
files = requests.get(get_files_url(), headers=headers, timeout=10).json()
|
||||
files = httpx.get(get_files_url(), headers=headers, timeout=10).json()
|
||||
for file in files:
|
||||
filepath = pathlib.Path.cwd().joinpath(file["filename"])
|
||||
if (
|
||||
|
Reference in New Issue
Block a user