File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
packages/service-library/src/servicelib Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 77from packaging .version import Version
88from pydantic import TypeAdapter
99
10+ _APP_NAME_PATTERN = re .compile (
11+ r"^[a-z]+(-[a-z]+)*$"
12+ ) # matches lowercase string with words separated by dashes (no whitespace)
13+
1014
1115class PackageInfo :
1216 """Thin wrapper around pgk_resources.Distribution to access package distribution metadata
@@ -29,7 +33,7 @@ def __init__(self, package_name: str):
2933 """
3034 self ._distribution = distribution (package_name )
3135 # property checks
32- if re .match (r"^[a-z]+(-[a-z]+)*$" , self .app_name ) is None :
36+ if re .match (_APP_NAME_PATTERN , self .app_name ) is None :
3337 raise ValueError (
3438 f"Invalid package name { self .app_name } . "
3539 "It must be all lowercase and words separated by dashes ('-')."
You can’t perform that action at this time.
0 commit comments