def METHOD_NAME(self, req: InstallRequirement, key: str) -> Generator[None, None, None]:
    """Ensure that `key` cannot install itself as a setup requirement.
    :raises LookupError: If `key` was already provided in a parent invocation of
                         the context introduced by this method."""
    tracker_id = TrackerId(key)
    self.add(req, tracker_id)
    yield
    self.remove(req, tracker_id)