diff --git a/src/poetry/core/packages/dependency.py b/src/poetry/core/packages/dependency.py index c01ede94f..a539d59b6 100644 --- a/src/poetry/core/packages/dependency.py +++ b/src/poetry/core/packages/dependency.py @@ -253,7 +253,7 @@ def base_pep_508_name(self) -> str: requirement = self.pretty_name if self.extras: - extras = ",".join(self.extras) + extras = ",".join(sorted(self.extras)) requirement += f"[{extras}]" if isinstance(self.constraint, VersionUnion): diff --git a/src/poetry/core/packages/directory_dependency.py b/src/poetry/core/packages/directory_dependency.py index 4c51b39cc..75512bd43 100644 --- a/src/poetry/core/packages/directory_dependency.py +++ b/src/poetry/core/packages/directory_dependency.py @@ -119,7 +119,7 @@ def base_pep_508_name(self) -> str: requirement = self.pretty_name if self.extras: - extras = ",".join(self.extras) + extras = ",".join(sorted(self.extras)) requirement += f"[{extras}]" path = path_to_url(self.path) if self.path.is_absolute() else self.path diff --git a/src/poetry/core/packages/file_dependency.py b/src/poetry/core/packages/file_dependency.py index a1ecdcd30..a599f58e6 100644 --- a/src/poetry/core/packages/file_dependency.py +++ b/src/poetry/core/packages/file_dependency.py @@ -105,7 +105,7 @@ def base_pep_508_name(self) -> str: requirement = self.pretty_name if self.extras: - extras = ",".join(self.extras) + extras = ",".join(sorted(self.extras)) requirement += f"[{extras}]" path = path_to_url(self.path) if self.path.is_absolute() else self.path diff --git a/src/poetry/core/packages/url_dependency.py b/src/poetry/core/packages/url_dependency.py index 69d34500a..8a8c0c7e6 100644 --- a/src/poetry/core/packages/url_dependency.py +++ b/src/poetry/core/packages/url_dependency.py @@ -46,7 +46,7 @@ def base_pep_508_name(self) -> str: requirement = self.pretty_name if self.extras: - extras = ",".join(self.extras) + extras = ",".join(sorted(self.extras)) requirement += f"[{extras}]" requirement += f" @ {self._url}" diff --git a/src/poetry/core/packages/vcs_dependency.py b/src/poetry/core/packages/vcs_dependency.py index 241d5e798..6228d5fe4 100644 --- a/src/poetry/core/packages/vcs_dependency.py +++ b/src/poetry/core/packages/vcs_dependency.py @@ -110,7 +110,7 @@ def base_pep_508_name(self) -> str: parsed_url = git.ParsedUrl.parse(self._source) if self.extras: - extras = ",".join(self.extras) + extras = ",".join(sorted(self.extras)) requirement += f"[{extras}]" if parsed_url.protocol is not None: