Skip to content

Commit

Permalink
[BugFix] Fix version parsing in extensions
Browse files Browse the repository at this point in the history
ghstack-source-id: 903f2b01b508b81b1b4f92c4297d390da79fe8a2
Pull Request resolved: #2542
  • Loading branch information
vmoens committed Nov 6, 2024
1 parent 0a13cbd commit 997d90e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion torchrl/_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
import warnings

from packaging.version import parse
from torchrl import __version__

try:
from .version import __version__
except ImportError:
__version__ = None


def is_module_available(*modules: str) -> bool:
Expand All @@ -28,6 +32,8 @@ def _init_extension():


def _is_nightly(version):
if version is None:
return True
parsed_version = parse(version)
return parsed_version.local is not None

Expand Down

0 comments on commit 997d90e

Please sign in to comment.