From f215aa77f68757cb5182c1c51445248078e1958b Mon Sep 17 00:00:00 2001 From: Michael Bordash Date: Wed, 18 Oct 2023 15:50:33 -0700 Subject: [PATCH 1/2] add unit test for hyphenated uri --- tests/unit/core/components/test_module_path.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/unit/core/components/test_module_path.py b/tests/unit/core/components/test_module_path.py index 2db1fe9ea..a005666a2 100644 --- a/tests/unit/core/components/test_module_path.py +++ b/tests/unit/core/components/test_module_path.py @@ -37,6 +37,15 @@ ) TESTS: List[TypeDefTestDefinition] = [ + { + "definition": "git::git://github.com/onicagroup/foo/foo-bar.git", + "expected": { + "location": "./", + "arguments": {}, + "source": "git", + "uri": "git://github.com/onicagroup/foo/foo-bar.git", + }, + }, { "definition": "git::git://github.com/onicagroup/foo/bar.git", "expected": { From d22095a0c43b3c28a41e6facdf5487be2cde89a9 Mon Sep 17 00:00:00 2001 From: Michael Bordash Date: Wed, 18 Oct 2023 15:51:08 -0700 Subject: [PATCH 2/2] add support for hyphenated uri in regex --- runway/core/components/_module_path.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runway/core/components/_module_path.py b/runway/core/components/_module_path.py index bdc471fc2..60124812a 100644 --- a/runway/core/components/_module_path.py +++ b/runway/core/components/_module_path.py @@ -37,7 +37,7 @@ class ModulePath: ARGS_REGEX: ClassVar[str] = r"(\?)(?P.*)$" REMOTE_SOURCE_HANDLERS: ClassVar[Dict[str, Type[Source]]] = {"git": Git} SOURCE_REGEX: ClassVar[str] = r"(?P[a-z]+)(\:\:)" - URI_REGEX: ClassVar[str] = r"(?P[a-z]+://[a-zA-Z0-9\./]+?(?=//|\?|$))" + URI_REGEX: ClassVar[str] = r"(?P[a-z]+://[a-zA-Z0-9\./-]+?(?=//|\?|$))" def __init__( self,