Class RequirementsParser

java.lang.Object
io.github.howtis.pythonembed.gradle.RequirementsParser

public final class RequirementsParser extends Object
Parses Python requirements.txt files into a list of package specifications.

Each non-empty, non-comment line is treated as a package spec. Advanced pip options (-r, -c, --index-url, etc.) are skipped with a warning.

  • Method Details

    • parse

      public static List<String> parse(Path file) throws IOException
      Parses a requirements.txt file and returns the list of package specs.
      Parameters:
      file - path to the requirements.txt file
      Returns:
      list of package specification strings (may be empty)
      Throws:
      IOException - if the file cannot be read