MCPcopy Create free account
hub / github.com/TrainLoop/evals / get_previous_version

Function get_previous_version

scripts/release.py:85–103  ·  view source on GitHub ↗

Get the previous version by looking at git tags.

()

Source from the content-addressed store, hash-verified

83
84
85def get_previous_version() -> Optional[str]:
86 """Get the previous version by looking at git tags."""
87 try:
88 # Get all version tags, sorted by version
89 tags_output = run_cmd(
90 "git tag -l | grep -E '^v[0-9]+\\.[0-9]+\\.[0-9]+$' | sort -V",
91 capture_output=True,
92 check=False,
93 )
94 if not tags_output:
95 return None
96
97 tags = tags_output.strip().split("\n")
98 if len(tags) >= 1:
99 # Return the latest tag without the 'v' prefix
100 return tags[-1][1:] # Remove 'v' prefix
101 return None
102 except Exception:
103 return None
104
105
106def get_git_diff_since_version(previous_version: Optional[str]) -> str:

Callers 2

create_release_notesFunction · 0.85
mainFunction · 0.85

Calls 1

run_cmdFunction · 0.85

Tested by

no test coverage detected