Skip to content

Commit

Permalink
Bugfix/remote uri path hyphen support (#2013)
Browse files Browse the repository at this point in the history
* add unit test for hyphenated uri

* add support for hyphenated uri in regex

---------

Co-authored-by: Michael Bordash <[email protected]>
  • Loading branch information
mbordash2 and Michael Bordash authored Oct 19, 2023
1 parent 956acd6 commit 1fa0fb0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion runway/core/components/_module_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ModulePath:
ARGS_REGEX: ClassVar[str] = r"(\?)(?P<args>.*)$"
REMOTE_SOURCE_HANDLERS: ClassVar[Dict[str, Type[Source]]] = {"git": Git}
SOURCE_REGEX: ClassVar[str] = r"(?P<source>[a-z]+)(\:\:)"
URI_REGEX: ClassVar[str] = r"(?P<uri>[a-z]+://[a-zA-Z0-9\./]+?(?=//|\?|$))"
URI_REGEX: ClassVar[str] = r"(?P<uri>[a-z]+://[a-zA-Z0-9\./-]+?(?=//|\?|$))"

def __init__(
self,
Expand Down
9 changes: 9 additions & 0 deletions tests/unit/core/components/test_module_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 1fa0fb0

Please sign in to comment.