Skip to content

Commit

Permalink
Apply CR suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Secrus committed Aug 15, 2023
1 parent 514bba1 commit bd086ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/poetry/utils/dependency_specification.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
DependencySpec = Dict[str, Union[str, bool, Dict[str, Union[str, bool]], List[str]]]
BaseSpec = TypeVar("BaseSpec", DependencySpec, InlineTable)

GIT_URL_SCHEMES = {"git+http", "git+https", "git+ssh"}


def dependency_to_specification(
dependency: Dependency, specification: BaseSpec
Expand Down Expand Up @@ -143,7 +145,7 @@ def _parse_url(self, requirement: str) -> DependencySpec | None:
if not (url_parsed.scheme and url_parsed.netloc):
return None

if url_parsed.scheme in ["git+https", "git+ssh"]:
if url_parsed.scheme in GIT_URL_SCHEMES:
return self._parse_git_url(requirement)

if url_parsed.scheme in ["http", "https"]:
Expand Down

0 comments on commit bd086ec

Please sign in to comment.