@@ -44,8 +44,8 @@ def parse_args(argv: List[str]) -> argparse.Namespace:
44
44
45
45
def get_version ():
46
46
version = (ROOT_DIR / "version.txt" ).read_text ().strip ()
47
- if os .getenv ("BUILD_VERSION " ):
48
- version = os .getenv ("BUILD_VERSION " )
47
+ if os .getenv ("TENSORDICT_BUILD_VERSION " ):
48
+ version = os .getenv ("TENSORDICT_BUILD_VERSION " )
49
49
elif sha != "Unknown" :
50
50
version += "+" + sha [:7 ]
51
51
return version
@@ -62,11 +62,13 @@ def write_version_file(version):
62
62
f .write (f"git_version = { repr (sha )} \n " )
63
63
64
64
65
- def _get_pytorch_version (is_nightly ):
65
+ def _get_pytorch_version (is_nightly , is_local ):
66
66
# if "PYTORCH_VERSION" in os.environ:
67
67
# return f"torch=={os.environ['PYTORCH_VERSION']}"
68
68
if is_nightly :
69
69
return "torch>=2.4.0.dev"
70
+ if is_local :
71
+ return "torch"
70
72
return "torch>=2.3.0"
71
73
72
74
@@ -153,9 +155,11 @@ def _main(argv):
153
155
154
156
write_version_file (version )
155
157
logging .info (f"Building wheel { package_name } -{ version } " )
156
- logging .info (f"BUILD_VERSION is { os .getenv ('BUILD_VERSION' )} " )
158
+ BUILD_VERSION = os .getenv ("TENSORDICT_BUILD_VERSION" )
159
+ logging .info (f"TENSORDICT_BUILD_VERSION is { BUILD_VERSION } " )
160
+ local_build = BUILD_VERSION is None
157
161
158
- pytorch_package_dep = _get_pytorch_version (is_nightly )
162
+ pytorch_package_dep = _get_pytorch_version (is_nightly , local_build )
159
163
logging .info ("-- PyTorch dependency:" , pytorch_package_dep )
160
164
161
165
long_description = (ROOT_DIR / "README.md" ).read_text ()
0 commit comments