          if ireq not in self._dependencies_cache:
              if ireq.editable and (ireq.source_dir and os.path.exists(ireq.source_dir)):
                  # No download_dir for locally available editable requirements.
-@@ -164,11 +297,14 @@ class PyPIRepository(BaseRepository):
+@@ -164,11 +300,14 @@ class PyPIRepository(BaseRepository):
                      download_dir=download_dir,
                      wheel_download_dir=self._wheel_download_dir,
                      session=self.session,

         """
         Given a pinned or an editable InstallRequirement, returns a set of
         dependencies (also InstallRequirements, but not necessarily pinned).
@@ -139,6 +257,21 @@ class PyPIRepository(BaseRepository):
         if not (ireq.editable or is_pinned_requirement(ireq)):
             raise TypeError('Expected pinned or editable InstallRequirement, got {}'.format(ireq))
 

+                    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()
