From 9ca2240530070d3719a42abfbe8c5f4677633a04 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Thu, 2 Apr 2020 21:42:26 +0800 Subject: [PATCH] More clarification on the name --- src/pip/_internal/resolution/resolvelib/candidates.py | 3 ++- src/pip/_internal/resolution/resolvelib/requirements.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pip/_internal/resolution/resolvelib/candidates.py b/src/pip/_internal/resolution/resolvelib/candidates.py index 1f3cca9c5..31453dbd4 100644 --- a/src/pip/_internal/resolution/resolvelib/candidates.py +++ b/src/pip/_internal/resolution/resolvelib/candidates.py @@ -218,7 +218,8 @@ class RequiresPythonCandidate(Candidate): @property def name(self): # type: () -> str - return "" # Avoid conflicting with the PyPI package "Python". + # Avoid conflicting with the PyPI package "Python". + return "" @property def version(self): diff --git a/src/pip/_internal/resolution/resolvelib/requirements.py b/src/pip/_internal/resolution/resolvelib/requirements.py index cdfa93c2c..b8711534d 100644 --- a/src/pip/_internal/resolution/resolvelib/requirements.py +++ b/src/pip/_internal/resolution/resolvelib/requirements.py @@ -35,10 +35,13 @@ class ExplicitRequirement(Requirement): class NoMatchRequirement(Requirement): """A requirement that never matches anything. + + Note: Similar to ExplicitRequirement, the caller should handle name + canonicalisation; this class does not perform it. """ def __init__(self, name): # type: (str) -> None - self._name = canonicalize_name(name) + self._name = name @property def name(self): -- GitLab