@@ -32,8 +32,8 @@ def get_version():
32
32
version_txt = os .path .join (cwd , "version.txt" )
33
33
with open (version_txt , "r" ) as f :
34
34
version = f .readline ().strip ()
35
- if os .getenv ("BUILD_VERSION " ):
36
- version = os .getenv ("BUILD_VERSION " )
35
+ if os .getenv ("TORCHRL_BUILD_VERSION " ):
36
+ version = os .getenv ("TORCHRL_BUILD_VERSION " )
37
37
elif sha != "Unknown" :
38
38
version += "+" + sha [:7 ]
39
39
return version
@@ -68,11 +68,13 @@ def write_version_file(version):
68
68
f .write ("git_version = {}\n " .format (repr (sha )))
69
69
70
70
71
- def _get_pytorch_version (is_nightly ):
71
+ def _get_pytorch_version (is_nightly , is_local ):
72
72
# if "PYTORCH_VERSION" in os.environ:
73
73
# return f"torch=={os.environ['PYTORCH_VERSION']}"
74
74
if is_nightly :
75
75
return "torch>=2.4.0.dev"
76
+ elif is_local :
77
+ return "torch"
76
78
return "torch>=2.3.0"
77
79
78
80
@@ -178,10 +180,12 @@ def _main(argv):
178
180
else :
179
181
version = get_version ()
180
182
write_version_file (version )
183
+ TORCHRL_BUILD_VERSION = os .getenv ("TORCHRL_BUILD_VERSION" )
181
184
logging .info ("Building wheel {}-{}" .format (package_name , version ))
182
- logging .info (f"BUILD_VERSION is { os . getenv ( 'BUILD_VERSION' ) } " )
185
+ logging .info (f"TORCHRL_BUILD_VERSION is { TORCHRL_BUILD_VERSION } " )
183
186
184
- pytorch_package_dep = _get_pytorch_version (is_nightly )
187
+ is_local = TORCHRL_BUILD_VERSION is None
188
+ pytorch_package_dep = _get_pytorch_version (is_nightly , is_local )
185
189
logging .info ("-- PyTorch dependency:" , pytorch_package_dep )
186
190
# branch = _run_cmd(["git", "rev-parse", "--abbrev-ref", "HEAD"])
187
191
# tag = _run_cmd(["git", "describe", "--tags", "--exact-match", "@"])
0 commit comments