diff --git a/news/5299.bugfix.rst b/news/5299.bugfix.rst new file mode 100644 index 00000000..3e724299 --- /dev/null +++ b/news/5299.bugfix.rst @@ -0,0 +1 @@ +Sorting ``constraints`` before resolving, which fixes ``pipenv lock`` generates nondeterminism environment markers. diff --git a/pipenv/utils/resolver.py b/pipenv/utils/resolver.py index 198ad484..82663b68 100644 --- a/pipenv/utils/resolver.py +++ b/pipenv/utils/resolver.py @@ -647,6 +647,7 @@ class Resolver: # Only use default_constraints when installing dev-packages if self.dev: self._constraints += self.default_constraints + self._constraints.sort(key=lambda ireq: ireq.name) return self._constraints @contextlib.contextmanager