pypi

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const Infinity = "z"
View Source
const NegInfinity = ""

since the valid pre/post/dev release strings are "a b c rc alpha beta pre preview post rev r dev", NegInfinity is smaller than each one of them, and Infinity is bigger than each one of them.

View Source
const SOURCE_DISTRIBUTION_ENV_TAG = "sdist"
View Source
const TORCH_BASE_URL = "https://download.pytorch.org/"

Variables

This section is empty.

Functions

func DecodeSpecifier

func DecodeSpecifier(specifier string) (c repointerface.Constraint, err error)

func Fabricate

func Fabricate(pkgPath string, name string, version string, environment string, dstDir string) (prefabPath string, blueprintPath string, err error)

TODO: Decode name, version and environment from package METADATA and WHEEL

func NameNormalizer added in v0.2.2

func NameNormalizer(name string) (normalized string)

Types

type EnvSpec added in v0.2.2

type EnvSpec struct {
	PyVer   string `json:"pyVer"`   // e.g. "3.10"
	LibcVer string `json:"libcVer"` // e.g. "2.36"
	Arch    string `json:"arch"`    // e.g. "amd64"
}

func DecodeEnvSpec added in v0.2.2

func DecodeEnvSpec(s string) (es EnvSpec, err error)

func (EnvSpec) Encode added in v0.2.2

func (es EnvSpec) Encode() string

type Package

type Package struct {
	PackageType    string  `json:"packagetype"`
	RequiresPython *string `json:"requires_python"`
	URL            string  `json:"url"`
}

type PyPIQuery

type PyPIQuery struct {
	Releases map[string][]Package `json:"releases"`
}

type Repo

type Repo struct {
	// contains filtered or unexported fields
}

func (*Repo) Fabricate

func (r *Repo) Fabricate(name string, version repointerface.Version, envs []string, dstDir string) (prefabPaths []string, blueprintPaths []string, err error)

func (*Repo) FilterEnv added in v0.2.2

func (r *Repo) FilterEnv(envs []string) (selected []string)

func (*Repo) GetEnvSpec added in v0.2.2

func (r *Repo) GetEnvSpec() repointerface.EnvSpec

func (*Repo) GetEnvs

func (r *Repo) GetEnvs(name string, version repointerface.Version) (envs []string, err error)

func (*Repo) GetVersions

func (r *Repo) GetVersions(name string) (versions []repointerface.Version, err error)

func (*Repo) Init

func (r *Repo) Init(ctx *dcontext.DeployContext) (err error)

func (*Repo) SelectEnv added in v0.2.2

func (r *Repo) SelectEnv(envs []string, envSpec repointerface.EnvSpec) (selected string, err error)

func (*Repo) SelectVersion added in v0.2.2

func (r *Repo) SelectVersion(versions []repointerface.Version) (selected repointerface.Version, err error)

type Version

type Version struct {
	Epoch   int      // Epoch number
	Release []int    // Release number
	Pre     string   // Pre-release type
	PreNum  int      // Pre-release number
	Post    string   // Post-release type
	PostNum int      // Post-release number
	Dev     string   // Dev-release type
	DevNum  int      // Dev-release number
	Local   []string // Local version label
	Raw     string
}

func ParseVersion

func ParseVersion(version string) (ver Version, err error)

func (Version) Compare added in v0.2.2

func (a Version) Compare(other repointerface.Version) (result int)

return negative number when a < b return positive number when a > b return 0 when a == b

func (Version) String

func (v Version) String() string

Jump to

Keyboard shortcuts

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