From bdf093bbf93b923d7f069bebeada9b306c2a96ea Mon Sep 17 00:00:00 2001 From: Daniel Barnes Date: Mon, 25 Sep 2023 14:20:25 -0700 Subject: [PATCH 1/3] Allow caps in dirname --- gto/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gto/constants.py b/gto/constants.py index 8ac794bd..0fd294d6 100644 --- a/gto/constants.py +++ b/gto/constants.py @@ -41,7 +41,7 @@ def tag_to_name(value): return value.replace(SEPARATOR_IN_TAG, SEPARATOR_IN_NAME) -dirname = "[a-z0-9-_./]+" # improve? +dirname = "[a-zA-Z0-9-_./]+" # improve? name = r"[a-z0-9]([a-z0-9-/_]*[a-z0-9])?" semver = r"(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?:-(?P(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?" counter = "?P[0-9]+" From 5591ccaf86823262a71f56c9f2f85ddee99d2962 Mon Sep 17 00:00:00 2001 From: Daniel Barnes Date: Mon, 25 Sep 2023 14:27:43 -0700 Subject: [PATCH 2/3] expand test --- tests/test_constants.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_constants.py b/tests/test_constants.py index 87d1c79d..ad3d8bd7 100644 --- a/tests/test_constants.py +++ b/tests/test_constants.py @@ -66,6 +66,7 @@ def test_check_fullname_is_valid(name): "model", "dvclive=model", "some/folder=some/model", + "Some/folder/A=model", ], ) def test_check_fullname_in_tag_is_valid(name): From d4d53e0ed1a33b3c085bee0e02209a6c1b599529 Mon Sep 17 00:00:00 2001 From: Dave Berenbaum Date: Wed, 4 Oct 2023 14:22:56 -0400 Subject: [PATCH 3/3] allow uppercase model names (#424) On top of #420, this adds support for uppercase model names. --- gto/constants.py | 2 +- tests/test_constants.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gto/constants.py b/gto/constants.py index 0fd294d6..84ae1653 100644 --- a/gto/constants.py +++ b/gto/constants.py @@ -42,7 +42,7 @@ def tag_to_name(value): dirname = "[a-zA-Z0-9-_./]+" # improve? -name = r"[a-z0-9]([a-z0-9-/_]*[a-z0-9])?" +name = r"[a-zA-Z0-9]([a-zA-Z0-9-/_]*[a-zA-Z0-9])?" semver = r"(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?:-(?P(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?" counter = "?P[0-9]+" name_re = re.compile(f"^{name}$") diff --git a/tests/test_constants.py b/tests/test_constants.py index ad3d8bd7..60081cac 100644 --- a/tests/test_constants.py +++ b/tests/test_constants.py @@ -19,6 +19,8 @@ "model-prod-v1", "model_prod_v1", "dvclive/model", + "model_A", + "DVCLive/Model", ], ) def test_check_name_is_valid(name): @@ -40,8 +42,6 @@ def test_check_name_is_valid(name): "model@1", "model#1", "@namespace/model", - "DVCLive/Model", - "model A", ], ) def test_check_name_is_invalid(name): @@ -54,6 +54,7 @@ def test_check_name_is_invalid(name): "model", "dvclive:model", "some/folder:some/model", + "some/Other_Folder:some/model", ], ) def test_check_fullname_is_valid(name): @@ -67,6 +68,7 @@ def test_check_fullname_is_valid(name): "dvclive=model", "some/folder=some/model", "Some/folder/A=model", + "Some/folder/A=Model", ], ) def test_check_fullname_in_tag_is_valid(name):