Documentation
¶
Index ¶
- func ExactVersion(pipRequirement string) (string, bool)
- func NormalizePackageName(name string) string
- func PackageName(pipRequirement string) string
- func ParseLocalArtifactRequirement(line string) (string, bool, error)
- func ReadRequirements(path string) ([]string, error)
- func SplitPinnedPythonRequirement(requirement string) (name string, version string, findLinks []string, extraIndexURLs []string, ...)
- func Versions(pipRequirement string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExactVersion ¶ added in v0.23.0
ExactVersion returns the version from a pip requirement only when it is a single exact `==` pin, e.g. "torch==2.7.0" (inline pip options and the CUDA local tag are preserved). Ranges, inequalities, wildcard pins, compound specifiers, direct URLs, and unpinned requirements return ("", false): they do not name one concrete version to reason about.
func NormalizePackageName ¶ added in v0.23.0
NormalizePackageName canonicalizes a distribution name for comparison, PEP 503-style: extras are dropped, "-_." separator runs collapse to "-", and the result is lowercased.
func PackageName ¶ added in v0.15.2
func ParseLocalArtifactRequirement ¶ added in v0.22.0
ParseLocalArtifactRequirement returns a bare local wheel or source archive path. Other pip requirements pass through unchanged; unsupported local forms return an error before the Docker build starts.
func ReadRequirements ¶ added in v0.14.4
func SplitPinnedPythonRequirement ¶ added in v0.15.2
func SplitPinnedPythonRequirement(requirement string) (name string, version string, findLinks []string, extraIndexURLs []string, err error)
SplitPinnedPythonRequirement returns the name, version, findLinks, and extraIndexURLs from a requirements.txt line in the form name==version [--find-links=<findLink>] [-f <findLink>] [--extra-index-url=<extraIndexURL>]
Types ¶
This section is empty.