Skip to navigation

nemo_gym.utils.gym_commit

View as MarkdownOpen in Claude

The git commit of the nemo-gym that is running.

Module Contents

Functions

NameDescription
_git-
_git_install_commitThe commit recorded in the distribution’s PEP 610 direct_url.json, or None.
_source_checkout_commitHEAD of the git checkout package_dir is tracked in, -dirty when it has uncommitted changes.
_unknown_commit-
installed_gym_commitReturn the git commit of the nemo-gym that is running, or None when it cannot be determined.

Data

_PACKAGE_DIR

logger

API

nemo_gym.utils.gym_commit._git(
directory: pathlib.Path,
args: str = ()
) -> subprocess.CompletedProcess
nemo_gym.utils.gym_commit._git_install_commit() -> str | None

The commit recorded in the distribution’s PEP 610 direct_url.json, or None.

nemo_gym.utils.gym_commit._source_checkout_commit(
package_dir: pathlib.Path
) -> str | None

HEAD of the git checkout package_dir is tracked in, -dirty when it has uncommitted changes.

nemo_gym.utils.gym_commit._unknown_commit(
reason: str,
args: object = ()
) -> None
nemo_gym.utils.gym_commit.installed_gym_commit() -> str | None

Return the git commit of the nemo-gym that is running, or None when it cannot be determined.

A git install (pip install git+...) records its commit in the distribution metadata. Otherwise the running package’s own source tree is asked: a git checkout reports its HEAD, suffixed -dirty when it has uncommitted changes.

nemo_gym.utils.gym_commit._PACKAGE_DIR = Path(__file__).resolve().parents[1]
nemo_gym.utils.gym_commit.logger = logging.getLogger(__name__)