diff --git a/src/poetry/core/vcs/git.py b/src/poetry/core/vcs/git.py index a6467d586..7599b8eec 100644 --- a/src/poetry/core/vcs/git.py +++ b/src/poetry/core/vcs/git.py @@ -29,11 +29,11 @@ rf"(?P[:/\\]({PATH}[/\\])?" rf"((?P{NAME}?)(\.git|[/\\])?)?)" r"(?:" - r"#egg=?.+" - r"|" rf"#(?:egg=.+?&subdirectory=|subdirectory=)(?P{SUBDIR})" r"|" - rf"[@#](?P{REV})(?:[&#](?:egg=.+?|(?:egg=.+?&subdirectory=|subdirectory=)(?P{SUBDIR})))?" + r"#egg=?.+" + r"|" + rf"[@#](?P{REV})(?:[&#](?:(?:egg=.+?&subdirectory=|subdirectory=)(?P{SUBDIR})|egg=.+?))?" r")?" r"$" ), @@ -46,11 +46,11 @@ rf"(?P({PATH})" rf"(?P{NAME})(\.git|/)?)" r"(?:" - r"#egg=?.+" - r"|" rf"#(?:egg=.+?&subdirectory=|subdirectory=)(?P{SUBDIR})" r"|" - rf"[@#](?P{REV})(?:[&#](?:egg=.+?|(?:egg=.+?&subdirectory=|subdirectory=)(?P{SUBDIR})))?" + r"#egg=?.+" + r"|" + rf"[@#](?P{REV})(?:[&#](?:(?:egg=.+?&subdirectory=|subdirectory=)(?P{SUBDIR})|egg=.+?))?" r")?" r"$" ), @@ -61,11 +61,11 @@ rf"(?P([:/]{PATH}/)" rf"(?P{NAME})(\.git|/)?)" r"(?:" - r"#egg=.+?" - r"|" rf"#(?:egg=.+?&subdirectory=|subdirectory=)(?P{SUBDIR})" r"|" - rf"[@#](?P{REV})(?:[&#](?:egg=.+?&subdirectory=|subdirectory=)(?P{SUBDIR}))?" + r"#egg=?.+" + r"|" + rf"[@#](?P{REV})(?:[&#](?:(?:egg=.+?&subdirectory=|subdirectory=)(?P{SUBDIR})|egg=.+?))?" r")?" r"$" ), @@ -76,11 +76,11 @@ rf"(?P({PATH})" rf"(?P{NAME})(\.git|/)?)" r"(?:" - r"#egg=?.+" - r"|" rf"#(?:egg=.+?&subdirectory=|subdirectory=)(?P{SUBDIR})" r"|" - rf"[@#](?P{REV})(?:[&#](?:egg=.+?|(?:egg=.+?&subdirectory=|subdirectory=)(?P{SUBDIR})))?" + r"#egg=?.+" + r"|" + rf"[@#](?P{REV})(?:[&#](?:(?:egg=.+?&subdirectory=|subdirectory=)(?P{SUBDIR})|egg=.+?))?" r")?" r"$" ), diff --git a/tests/vcs/test_vcs.py b/tests/vcs/test_vcs.py index d9ddb0019..26898bf61 100644 --- a/tests/vcs/test_vcs.py +++ b/tests/vcs/test_vcs.py @@ -404,6 +404,7 @@ def test_parse_url(url: str, parsed: ParsedUrl) -> None: assert result.rev == parsed.rev assert result.url == parsed.url assert result.user == parsed.user + assert result.subdirectory == parsed.subdirectory def test_parse_url_should_fail() -> None: