Merge pull request #2665 from pre-commit/move-parse-version

move parse_version to pre_commit.clientlib
This commit is contained in:
Anthony Sottile 2023-01-01 17:51:11 -05:00 committed by GitHub
commit 017fa5c0b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 14 deletions

View file

@ -241,10 +241,5 @@ def rmtree(path: str) -> None:
shutil.rmtree(path, ignore_errors=False, onerror=handle_remove_readonly)
def parse_version(s: str) -> tuple[int, ...]:
"""poor man's version comparison"""
return tuple(int(p) for p in s.split('.'))
def win_exe(s: str) -> str:
return s if sys.platform != 'win32' else f'{s}.exe'