[LNT] Update to match API change in PIP

The parse_requirements function in PIP now (as of version 20.1) returns
a list of ParsedRequirements, where it was previously a list of
InstallRequirements. Update our setup.py to work with either one.

This is an internal function of pip, so we shouldn't really be depending
on it, the recommended solution seems to be to hard-code the dependency
list in setup.py. However, according to a comment on D45211 the
requirements.*.txt files are needed for some cloud setups, and this
avoids duplicating the dependency list between these files and setup.py.

Differential Revision: https://reviews.llvm.org/D78620
diff --git a/setup.py b/setup.py
index 723c9bd..133ef38 100644
--- a/setup.py
+++ b/setup.py
@@ -40,7 +40,15 @@
     # In old PIP the session flag cannot be passed.
     install_reqs = parse_requirements(req_file)
 
-reqs = [str(ir.req) for ir in install_reqs]
+try:
+    # Filter out git dependencies, which can't be handled by setuptools.
+    reqs = [ir.requirement for ir in install_reqs
+            if not ir.requirement.startswith("git+")]
+except AttributeError:
+    # Old versions of pip (<20.1) returned a List[InstallRequirement] instead
+    # of a List[ParsedRequirement], which has different member names, and does
+    # not include git dependencies.
+    reqs = [str(ir.req) for ir in install_reqs]
 
 setup(
     name="LNT",