 +                    setup_requires = self.finder.get_extras_links(
 +                        dist.get_metadata_lines('requires.txt')
 +                    )
++                # HACK: Sometimes the InstallRequirement doesn't properly get
++                # these values set on it during the resolution process. It's
++                # difficult to pin down what is going wrong. This fixes things.
 +                ireq.version = dist.version
 +                ireq.project_name = dist.project_name
 +                ireq.req = dist.as_requirement()

             reqset.cleanup_files()
         return set(self._dependencies_cache[ireq])
 
@@ -224,17 +390,10 @@ class PyPIRepository(BaseRepository):
         matching_candidates = candidates_by_version[matching_versions[0]]
 
         return {

                 )
             except TypeError:
                 # Pip >= 10 (new resolver!)
@@ -190,14 +329,44 @@ class PyPIRepository(BaseRepository):
                     upgrade_strategy="to-satisfy-only",
                     force_reinstall=False,
                     ignore_dependencies=False,
