Skip to content

Commit

Permalink
Add handling of <= version operator in install.py (#2925)
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei authored May 22, 2024
1 parent 7ed5cf6 commit 92e4b12
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ def install_requirements(req_file):
f"install -U {package}",
f"sd-webui-controlnet requirement: changing {package_name} version from {installed_version} to {package_version}",
)
elif "<=" in package:
package_name, package_version = package.split("<=")
installed_version = get_installed_version(package_name)
if not installed_version or comparable_version(
installed_version
) > comparable_version(package_version):
launch.run_pip(
f"install {package_name}=={package_version}",
f"sd-webui-controlnet requirement: changing {package_name} version from {installed_version} to {package_version}",
)
elif not launch.is_installed(extract_base_package(package)):
launch.run_pip(
f"install {package}",
Expand Down

0 comments on commit 92e4b12

Please sign in to comment.