requirements

package
v0.23.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExactVersion added in v0.23.0

func ExactVersion(pipRequirement string) (string, bool)

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

func NormalizePackageName(name string) string

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 PackageName(pipRequirement string) string

func ParseLocalArtifactRequirement added in v0.22.0

func ParseLocalArtifactRequirement(line string) (string, bool, error)

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 ReadRequirements(path string) ([]string, error)

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>]

func Versions added in v0.15.10

func Versions(pipRequirement string) []string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL