Skip to content

Commit

Permalink
[CI] Fix nightly build dependency on tensordict (pytorch#1300)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmoens authored Jun 20, 2023
1 parent fa92624 commit 63fb59b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ def write_version_file(version):
f.write("git_version = {}\n".format(repr(sha)))


def _get_pytorch_version():
def _get_pytorch_version(is_nightly):
# if "PYTORCH_VERSION" in os.environ:
# return f"torch=={os.environ['PYTORCH_VERSION']}"
if is_nightly:
return "torch>=2.1.0.dev"
return "torch"


Expand Down Expand Up @@ -164,6 +166,10 @@ def _main(argv):
args, unknown = parse_args(argv)
name = args.package_name
is_nightly = "nightly" in name
if is_nightly:
tensordict_dep = "tensordict>=0.1.1"
else:
tensordict_dep = "tensordict-nightly"

if is_nightly:
version = get_nightly_version()
Expand All @@ -173,7 +179,7 @@ def _main(argv):
else:
version = get_version()

pytorch_package_dep = _get_pytorch_version()
pytorch_package_dep = _get_pytorch_version(is_nightly)
print("-- PyTorch dependency:", pytorch_package_dep)
# branch = _run_cmd(["git", "rev-parse", "--abbrev-ref", "HEAD"])
# tag = _run_cmd(["git", "describe", "--tags", "--exact-match", "@"])
Expand Down Expand Up @@ -204,7 +210,7 @@ def _main(argv):
"numpy",
"packaging",
"cloudpickle",
"tensordict>=0.1.1",
tensordict_dep,
],
extras_require={
"atari": [
Expand Down

0 comments on commit 63fb59b

Please sign in to comment.