Skip to content

Commit 4d8ccde

Browse files
Reverted httpx to version 0.24.1 to address the ‘socket_options’ issue.
1 parent 209eaea commit 4d8ccde

File tree

1 file changed

+41
-20
lines changed

1 file changed

+41
-20
lines changed

install.py

+41-20
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,27 @@
1919
print("[Auto-Photoshop-SD] Attempting auto-update...")
2020

2121
try:
22+
checkout_result = run(
23+
f'"{git}" -C "{REPO_LOCATION}" checkout {extension_branch}',
24+
"[Auto-Photoshop-SD] switch branch to extension branch.",
25+
)
26+
print("checkout_result:", checkout_result)
2227

23-
checkout_result = run(f'"{git}" -C "{REPO_LOCATION}" checkout {extension_branch}', "[Auto-Photoshop-SD] switch branch to extension branch.")
24-
print("checkout_result:",checkout_result)
28+
branch_result = run(
29+
f'"{git}" -C "{REPO_LOCATION}" branch',
30+
"[Auto-Photoshop-SD] Current Branch.",
31+
)
32+
print("branch_result:", branch_result)
2533

26-
branch_result = run(f'"{git}" -C "{REPO_LOCATION}" branch', "[Auto-Photoshop-SD] Current Branch.")
27-
print("branch_result:",branch_result)
34+
fetch_result = run(
35+
f'"{git}" -C "{REPO_LOCATION}" fetch', "[Auto-Photoshop-SD] Fetch upstream."
36+
)
37+
print("fetch_result:", fetch_result)
2838

29-
fetch_result = run(f'"{git}" -C "{REPO_LOCATION}" fetch', "[Auto-Photoshop-SD] Fetch upstream.")
30-
print("fetch_result:",fetch_result)
31-
32-
pull_result = run(f'"{git}" -C "{REPO_LOCATION}" pull', "[Auto-Photoshop-SD] Pull upstream.")
33-
print("pull_result:",pull_result)
39+
pull_result = run(
40+
f'"{git}" -C "{REPO_LOCATION}" pull', "[Auto-Photoshop-SD] Pull upstream."
41+
)
42+
print("pull_result:", pull_result)
3443

3544
except Exception as e:
3645
print("[Auto-Photoshop-SD] Auto-update failed:")
@@ -39,15 +48,27 @@
3948

4049

4150
# print("Auto-Photoshop-SD plugin is installing")
51+
import pkg_resources
52+
53+
54+
def install_or_update_package(package_name, package_version):
55+
if not launch.is_installed(package_name):
56+
launch.run_pip(
57+
f"install {package_name}=={package_version}",
58+
"requirements for Auto-Photoshop Image Search",
59+
)
60+
else: # it's installed but we need to check for update
61+
version = pkg_resources.get_distribution(package_name).version
62+
if version != package_version:
63+
print(
64+
f"{package_name} version: {version} will update to version: {package_version}"
65+
)
66+
launch.run_pip(
67+
f"install {package_name}=={package_version}",
68+
"update requirements for Auto-Photoshop Image Search",
69+
)
70+
4271

43-
package_name = 'duckduckgo_search'
44-
package_version= '3.9.9'
45-
if not launch.is_installed(package_name):
46-
launch.run_pip(f"install {package_name}=={package_version}", "requirements for Auto-Photoshop Image Search")
47-
else:# it's installed but we need to check for update
48-
import pkg_resources
49-
50-
version = pkg_resources.get_distribution(package_name).version
51-
if(version != package_version):
52-
print(f'{package_name} version: {version} will update to version: {package_version}')
53-
launch.run_pip(f"install {package_name}=={package_version}", "update requirements for Auto-Photoshop Image Search")
72+
# Now we can use this function to install or update the packages
73+
install_or_update_package("duckduckgo_search", "3.9.9")
74+
install_or_update_package("httpx", "0.24.1")

0 commit comments

Comments
 (0)