From 52cda2fe38c6b9fcf45e7e12791409939801e042 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Sat, 19 Oct 2024 18:21:13 -0400 Subject: [PATCH] Apply AI fix for issue 6231 --- pipenv/utils/dependencies.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pipenv/utils/dependencies.py b/pipenv/utils/dependencies.py index 37b3c0552a..251fd05c92 100644 --- a/pipenv/utils/dependencies.py +++ b/pipenv/utils/dependencies.py @@ -1132,6 +1132,11 @@ def install_req_from_pipfile(name, pipfile): version = "" req_str = f"{name}{extras_str}{version}" + # Handle markers before constructing InstallRequirement + markers = PipenvMarkers.from_pipfile(name, _pipfile) + if markers: + req_str = f"{req_str};{markers}" + install_req, _ = expansive_install_req_from_line( req_str, comes_from=None, @@ -1141,7 +1146,6 @@ def install_req_from_pipfile(name, pipfile): constraint=False, expand_env=True, ) - markers = PipenvMarkers.from_pipfile(name, _pipfile) return install_req, markers, req_str