 +    def __init__(self, pip_options, session, use_json=False):
          self.session = session
 +        self.use_json = use_json
- 
-         index_urls = [pip_options.index_url] + pip_options.extra_index_urls
-         if pip_options.no_index:
-@@ -56,6 +96,10 @@ class PyPIRepository(BaseRepository):
+         self.pip_options = pip_options
+         self.wheel_cache = WheelCache(CACHE_DIR, pip_options.format_control)
+ 
+@@ -74,6 +115,10 @@ class PyPIRepository(BaseRepository):
          # of all secondary dependencies for the given requirement, so we
          # only have to go to disk once for each requirement
          self._dependencies_cache = {}

+            return set(self._json_dep_cache[ireq])
+        except Exception:
+            return set()
+
 
     def get_dependencies(self, ireq):
+        json_results = set()

+            except TypeError:
+                pass
+
         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 +270,14 @@ class PyPIRepository(BaseRepository):
                     download_dir=download_dir,
                     wheel_download_dir=self._wheel_download_dir,
                     session=self.session,
+                    ignore_installed=True,
+                    ignore_compatibility=False,
                     wheel_cache=self.wheel_cache,
                 )
-                self._dependencies_cache[ireq] = reqset._prepare_file(
+                result = reqset._prepare_file(
                     self.finder,
-                    ireq
+                    ireq,
+                    ignore_requires_python=True
                 )
             except TypeError:
                 # Pip >= 10 (new resolver!)
@@ -195,9 +304,39 @@ class PyPIRepository(BaseRepository):
                     isolated=False,
                     wheel_cache=self.wheel_cache,
                     use_user_site=False,
+                    ignore_compatibility=False
                 )
                 self.resolver.resolve(reqset)
-                self._dependencies_cache[ireq] = reqset.requirements.values()
+                result = reqset.requirements.values()
+            # Convert setup_requires dict into a somewhat usable form.
+            if setup_requires:
+                for section in setup_requires:
