From 112dd68f169d6a8ea64cc2619c59a80bac6761ca Mon Sep 17 00:00:00 2001 From: Mayank Mittal Date: Thu, 9 Nov 2023 12:40:07 +0100 Subject: [PATCH] fixes git repo issue --- rsl_rl/__init__.py | 2 +- rsl_rl/utils/utils.py | 6 +++++- setup.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/rsl_rl/__init__.py b/rsl_rl/__init__.py index 864c12a..8b1a072 100644 --- a/rsl_rl/__init__.py +++ b/rsl_rl/__init__.py @@ -3,5 +3,5 @@ """Main module for the rsl_rl package.""" -__version__ = "2.0.0" +__version__ = "2.0.1" __license__ = "BSD-3" diff --git a/rsl_rl/utils/utils.py b/rsl_rl/utils/utils.py index 1524916..3c1dcae 100644 --- a/rsl_rl/utils/utils.py +++ b/rsl_rl/utils/utils.py @@ -60,7 +60,11 @@ def unpad_trajectories(trajectories, masks): def store_code_state(logdir, repositories): for repository_file_path in repositories: - repo = git.Repo(repository_file_path, search_parent_directories=True) + try: + repo = git.Repo(repository_file_path, search_parent_directories=True) + except git.InvalidGitRepositoryError: + # skip if not a git repository + continue repo_name = pathlib.Path(repo.working_dir).name t = repo.head.commit.tree content = f"--- git status ---\n{repo.git.status()} \n\n\n--- git diff ---\n{repo.git.diff(t)}" diff --git a/setup.py b/setup.py index e077635..d9f07fb 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from setuptools import find_packages, setup setup( name="rsl_rl", - version="2.0.0", + version="2.0.1", packages=find_packages(), license="BSD-3", description="Fast and simple RL algorithms implemented in pytorch",