mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Support socks proxies when fetching versions
This commit is contained in:
parent
68bc4c02cf
commit
8c7cd80245
2 changed files with 19 additions and 18 deletions
|
@ -661,7 +661,7 @@ fn fetch_versions(state: &State) -> Result<Vec<String>> {
|
|||
let mut cmd = Command::new(&state.uv_path);
|
||||
cmd.current_dir(&state.uv_install_root)
|
||||
.args(["run", "--no-project", "--no-config", "--managed-python"])
|
||||
.args(["--with", "pip-system-certs"]);
|
||||
.args(["--with", "pip-system-certs,requests[socks]"]);
|
||||
|
||||
let python_version = read_file(&state.dist_python_version_path)?;
|
||||
let python_version_str =
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|
||||
import json
|
||||
import sys
|
||||
import urllib.request
|
||||
|
||||
import pip_system_certs.wrapt_requests
|
||||
import requests
|
||||
|
||||
pip_system_certs.wrapt_requests.inject_truststore()
|
||||
|
||||
|
@ -15,8 +15,9 @@ def main():
|
|||
url = "https://pypi.org/pypi/aqt/json"
|
||||
|
||||
try:
|
||||
with urllib.request.urlopen(url, timeout=30) as response:
|
||||
data = json.loads(response.read().decode("utf-8"))
|
||||
response = requests.get(url, timeout=30)
|
||||
response.raise_for_status()
|
||||
data = response.json()
|
||||
releases = data.get("releases", {})
|
||||
|
||||
# Create list of (version, upload_time) tuples
|
||||
|
|
Loading…
Reference in a new issue