code: func WriteRequirementsFile(path string, wheels []Name) (err error) {
  	fd, err := os.Create(path)
  	if err != nil {
  		return errors.Annotate(err, "failed to create requirements file").Err()
  	}
  	defer func() {
  		closeErr := fd.Close()
  		if closeErr != nil && err == nil {
  			err = errors.Annotate(closeErr, "failed to Close").Err()
  		}
  	}()
  
  	// Emit a series of "Distribution==Version" strings.
  	seen := make(map[Name]struct{}, len(wheels))
  	for _, wheel := range wheels {
  		// Only mention a given Distribution/Version once.
  		archetype := Name{
  			Distribution: wheel.Distribution,
  			Version:      wheel.Version,
  		}
  		if _, ok := seen[archetype]; ok {
  			// Already seen a package for this archetype, skip it.
  			continue
  		}
  		seen[archetype] = struct{}{}
  
  		if _, err := fmt.Fprintf(fd, "%s==%s\n", archetype.Distribution, archetype.Version); err != nil {
  			return errors.Annotate(err, "failed to write to requirements file").Err()
  		}
  	}
  
  	return nil
  }
docs: // WriteRequirementsFile writes a valid "requirements.txt"-style pip
  // requirements file containing the supplied wheels.
  //
  // The generated requirements will request the exact wheel senver version (using
  // "==").