pypi

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

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 DecodePreReleasePhase

func DecodePreReleasePhase(ver string) int

2 for a, 3 for b, 4 for rc, 1 for not pre-release

func DecodeSpecifier

func DecodeSpecifier(specifier string) (s pySpecifier, err error)

operator, version, isWildcard

func EqualReleaseNumber

func EqualReleaseNumber(a, b []int) bool

Return True if two release numbers are equal

func EqualVersion

func EqualVersion(a, b *Version) bool

Return True if Version a and b are equal aka b satisfies == a If the "a" is a public version identifier (no local version label), then the local version label of "b" MUST be ignored when matching versions.

func Fabricate

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

func LengthWithoutTailingZeros

func LengthWithoutTailingZeros(a []int) int

func NewerEqualReleaseNumber

func NewerEqualReleaseNumber(a, b []int) bool

Return True if a is newer than or equal to b

func NewerReleaseNumber

func NewerReleaseNumber(a, b []int) bool

Return True if a is newer than b

func NewerVersion

func NewerVersion(a, b *Version) bool

Return True if a is newer Version than b

func NormalizeName

func NormalizeName(name string) string

func ParseRelease

func ParseRelease(ver string) []int

func PrefixMatchVersion

func PrefixMatchVersion(a, b *Version) bool

Return True is b prefix match to a

func WildcardMatchReleaseNumber

func WildcardMatchReleaseNumber(a, b []int) bool

Return True if b matches wildcard a e.g. if a = 1.1.2, then its wildcard version is 1.1.* , when b = 1.1.3.4, return true, since 1.1.* == 1.1.3.4

Types

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(specSheet repointerface.SpecSheet, dstDir string) (prefabPath string, blueprintPath string, err error)

func (*Repo) FabricateDepend

func (r *Repo) FabricateDepend(item *prefab.Prefab, existVersions []string, dstDir string) (prefabPaths []string, blueprintPaths []string, err error)

func (*Repo) GenerateSpecSheet

func (r *Repo) GenerateSpecSheet(name string, specifier string) (specSheet repointerface.SpecSheet, err error)

func (*Repo) GetEnvs

func (r *Repo) GetEnvs(specSheet repointerface.SpecSheet) (envs []string, err error)

func (*Repo) GetVersions

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

func (*Repo) Init

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

type SpecSheet

type SpecSheet struct {
	SpecType      string `json:"specType"`
	Name_s        string `json:"name"`
	Version_s     string `json:"version"`
	Environment_s string `json:"environment"`
	Specifier     string `json:"specifier"`
	PyVer         string `json:"pyVer"`   // e.g. "3.10"
	LibcVer       string `json:"libcVer"` // e.g. "2.36"
	Arch          string `json:"arch"`    // e.g. "amd64"
}

func (*SpecSheet) Environment

func (s *SpecSheet) Environment() string

func (*SpecSheet) Name

func (s *SpecSheet) Name() string

func (*SpecSheet) SelectEnv

func (s *SpecSheet) SelectEnv(envs []string) (err error)

select one environment and fill it into [environmet] Warning! no matched environment is not an error, should leave [environment] empty and return nil

func (*SpecSheet) SelectVersion

func (s *SpecSheet) SelectVersion(versions []string) (err error)

1. set [environmet] to "" 2. select one version and fill it into [version] Warning! no matched version is not an error, should leave [version] empty and return nil

func (*SpecSheet) Type

func (s *SpecSheet) Type() string

func (*SpecSheet) Version

func (s *SpecSheet) Version() string

func (*SpecSheet) VersionSpecifier

func (s *SpecSheet) VersionSpecifier() string

type Version

type Version struct {
	Epoch   int    // Original Epoch segment
	Release string // Original Release String
	Rel_n   []int  // Release Number
	Pre     string // Original Pre-release segment
	Pre_l   int    // 2 for a, 3 for b, 4 for rc, 1 for not pre-release
	Pre_n   int    // Pre-Release Number
	Post    string // Original Post-Release segment
	Post_n  int    // Post-Release Number
	Dev     string // Original Dev-Release segment
	Dev_n   int    // Dev-Release Number
	Local   string // Original Local version identifiers
	IsPre   bool
	IsPost  bool
	IsDev   bool
	IsLocal bool
}

func ParseVersion

func ParseVersion(ver string) (*Version, error)

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