Skip to content

Commit

Permalink
Fix parsing of git urls with egg before subdirectory (#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
apage224 authored Jan 7, 2023
1 parent b22837e commit 78f57f7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/poetry/core/vcs/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
rf"(?P<pathname>[:/\\]({PATH}[/\\])?"
rf"((?P<name>{NAME}?)(\.git|[/\\])?)?)"
r"(?:"
r"#egg=?.+"
r"|"
rf"#(?:egg=.+?&subdirectory=|subdirectory=)(?P<subdirectory>{SUBDIR})"
r"|"
rf"[@#](?P<rev>{REV})(?:[&#](?:egg=.+?|(?:egg=.+?&subdirectory=|subdirectory=)(?P<rev_subdirectory>{SUBDIR})))?"
r"#egg=?.+"
r"|"
rf"[@#](?P<rev>{REV})(?:[&#](?:(?:egg=.+?&subdirectory=|subdirectory=)(?P<rev_subdirectory>{SUBDIR})|egg=.+?))?"
r")?"
r"$"
),
Expand All @@ -46,11 +46,11 @@
rf"(?P<pathname>({PATH})"
rf"(?P<name>{NAME})(\.git|/)?)"
r"(?:"
r"#egg=?.+"
r"|"
rf"#(?:egg=.+?&subdirectory=|subdirectory=)(?P<subdirectory>{SUBDIR})"
r"|"
rf"[@#](?P<rev>{REV})(?:[&#](?:egg=.+?|(?:egg=.+?&subdirectory=|subdirectory=)(?P<rev_subdirectory>{SUBDIR})))?"
r"#egg=?.+"
r"|"
rf"[@#](?P<rev>{REV})(?:[&#](?:(?:egg=.+?&subdirectory=|subdirectory=)(?P<rev_subdirectory>{SUBDIR})|egg=.+?))?"
r")?"
r"$"
),
Expand All @@ -61,11 +61,11 @@
rf"(?P<pathname>([:/]{PATH}/)"
rf"(?P<name>{NAME})(\.git|/)?)"
r"(?:"
r"#egg=.+?"
r"|"
rf"#(?:egg=.+?&subdirectory=|subdirectory=)(?P<subdirectory>{SUBDIR})"
r"|"
rf"[@#](?P<rev>{REV})(?:[&#](?:egg=.+?&subdirectory=|subdirectory=)(?P<rev_subdirectory>{SUBDIR}))?"
r"#egg=?.+"
r"|"
rf"[@#](?P<rev>{REV})(?:[&#](?:(?:egg=.+?&subdirectory=|subdirectory=)(?P<rev_subdirectory>{SUBDIR})|egg=.+?))?"
r")?"
r"$"
),
Expand All @@ -76,11 +76,11 @@
rf"(?P<pathname>({PATH})"
rf"(?P<name>{NAME})(\.git|/)?)"
r"(?:"
r"#egg=?.+"
r"|"
rf"#(?:egg=.+?&subdirectory=|subdirectory=)(?P<subdirectory>{SUBDIR})"
r"|"
rf"[@#](?P<rev>{REV})(?:[&#](?:egg=.+?|(?:egg=.+?&subdirectory=|subdirectory=)(?P<rev_subdirectory>{SUBDIR})))?"
r"#egg=?.+"
r"|"
rf"[@#](?P<rev>{REV})(?:[&#](?:(?:egg=.+?&subdirectory=|subdirectory=)(?P<rev_subdirectory>{SUBDIR})|egg=.+?))?"
r")?"
r"$"
),
Expand Down
1 change: 1 addition & 0 deletions tests/vcs/test_vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 78f57f7

Please sign in to comment.