Skip to content

Commit

Permalink
Add support for pip==23.1 where deprecated --install-option has b…
Browse files Browse the repository at this point in the history
…een removed (#1828)
  • Loading branch information
atugushev committed Mar 27, 2023
1 parent e8ab3b9 commit aa59f6a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion piptools/utils.py
Expand Up @@ -21,6 +21,7 @@
from pip._vendor.packaging.version import Version
from pip._vendor.pkg_resources import Distribution, Requirement, get_distribution

from piptools._compat import PIP_VERSION
from piptools.subprocess_utils import run_python_snippet

_KT = TypeVar("_KT")
Expand Down Expand Up @@ -456,7 +457,6 @@ def copy_install_requirement(
"markers": template.markers,
"use_pep517": template.use_pep517,
"isolated": template.isolated,
"install_options": template.install_options,
"global_options": template.global_options,
"hash_options": template.hash_options,
"constraint": template.constraint,
Expand All @@ -465,6 +465,9 @@ def copy_install_requirement(
}
kwargs.update(extra_kwargs)

if PIP_VERSION[:2] <= (23, 0):
kwargs["install_options"] = template.install_options

# Original link does not belong to install requirements constructor,
# pop it now to update later.
original_link = kwargs.pop("original_link", None)
Expand Down

0 comments on commit aa59f6a

Please sign in to comment.