File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -96,8 +96,14 @@ def get_dist(pkgname):
9696 return None
9797
9898 pytorch_dep = os .getenv ("TORCH_PACKAGE_NAME" , "torch" )
99- if os .getenv ("PYTORCH_VERSION" ):
100- pytorch_dep += "==" + os .getenv ("PYTORCH_VERSION" )
99+ if version_pin := os .getenv ("PYTORCH_VERSION" ):
100+ pytorch_dep += "==" + version_pin
101+ elif (version_pin_ge := os .getenv ("PYTORCH_VERSION_GE" )) and (version_pin_lt := os .getenv ("PYTORCH_VERSION_LT" )):
102+ # This branch and the associated env vars exist to help third-party
103+ # builds like in https://github.com/pytorch/vision/pull/8936. This is
104+ # supported on a best-effort basis, we don't guarantee that this won't
105+ # eventually break (and we don't test it.)
106+ pytorch_dep += f">={ version_pin_ge } ,<{ version_pin_lt } "
101107
102108 requirements = [
103109 "numpy" ,
You can’t perform that action at this time.
0 commit comments