code: def _read_lines(filepath):
      
      with open(filepath, 'rt', encoding='utf8') as fh:
          for line in fh:
              line = line.strip()
              if line.startswith("-r"):
                  logger.debug("Reading deps from nested requirement file: %s", line)
                  try:
                      nested_filename = line.split()[1]
                  except IndexError:
                      logger.warning(
                          "Invalid format to indicate a nested requirements file: '%r'", line)
                  else:
                      nested_filepath = os.path.join(
                          os.path.dirname(filepath), nested_filename)
                      yield from _read_lines(nested_filepath)
              else:
                  yield line
docs: Read a req file to a list to support nested requirement files.