diff --git a/requirements.txt b/requirements.txt index b6414d2e..03cec0f1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ swankit==0.1.1b1 -swanboard==0.1.3b1 +swanboard==0.1.3b2 cos-python-sdk-v5 requests click diff --git a/swanlab/data/formater.py b/swanlab/data/formater.py index e68ed1cc..07e5280f 100644 --- a/swanlab/data/formater.py +++ b/swanlab/data/formater.py @@ -93,7 +93,7 @@ def _auto_cut(name: str, value: str, max_len: int, cut: bool) -> str: def check_proj_name_format(name: str, auto_cut: bool = True) -> str: """ - 检查项目名格式,必须是0-9a-zA-Z以及连字符(_-) + 检查项目名格式,必须是0-9a-zA-Z以及连字符(_-.+) 最大长度为100个字符 Parameters @@ -119,8 +119,8 @@ def check_proj_name_format(name: str, auto_cut: bool = True) -> str: name超出长度 """ max_len = 100 - if not check_string(name) or not re.match(r"^[0-9a-zA-Z_-]+$", name): - raise ValueError(f"Project name `{name}` is invalid, which must be 0-9, a-z, A-Z, _ , -") + if not check_string(name) or not re.match(r"^[0-9a-zA-Z_\-+.]+$", name): + raise ValueError(f"Project name `{name}` is invalid, which must be 0-9, a-z, A-Z, _ , -, +, .") name = name.strip() return _auto_cut("project", name, max_len, auto_cut) diff --git a/swanlab/package.json b/swanlab/package.json index 5214b104..f7fac053 100644 --- a/swanlab/package.json +++ b/swanlab/package.json @@ -1,6 +1,6 @@ { "name": "swanlab", - "version": "0.3.13", + "version": "0.3.14", "description": "", "python": "true" } diff --git a/test/unit/data/test_fomater.py b/test/unit/data/test_fomater.py index f7f2a7dc..e8b1e436 100644 --- a/test/unit/data/test_fomater.py +++ b/test/unit/data/test_fomater.py @@ -58,6 +58,12 @@ class TestProjName: generate(size=1), "-", "_", + ".12", + "1", + "1.b", + "a.b", + "+", + "1+1" ], ) def test_proj_name_common(self, value):