artifacts: Bring back name_is_compatible. (#9972)

* artifacts: Bring back `name_is_compatible`.

Unfortunately, DVCLive was importing this function so I am bringing back the name for backwards compatibility.

* Update artifacts.py
This commit is contained in:
David de la Iglesia Castro
2023-09-26 14:32:27 +03:00
committed by GitHub
parent 95c9790368
commit 2aa2bef9d6
+15
View File
@@ -38,6 +38,21 @@ def check_name_format(name: str) -> None:
) from exc
def name_is_compatible(name: str) -> bool:
"""
Only needed by DVCLive per iterative/dvclive#715
Will be removed in future release.
"""
from gto.constants import assert_name_is_valid
from gto.exceptions import ValidationError
try:
assert_name_is_valid(name)
return True
except ValidationError:
return False
def check_for_nested_dvc_repo(dvcfile: Path):
from dvc.repo import Repo