pypi

package
v0.116.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMockClient

func GetMockClient(baseURL, mockedToken, mockedBody string, mockedHTTPStatusCode int) *httpclient.MockClient

GetMockClient returns a MockClient that validates the URL prefix and Bearer token, then serves the provided body and status code.

Types

type Pypi

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

Pypi defines a resource of kind "pypi".

func New

func New(spec interface{}) (*Pypi, error)

New returns a new valid Pypi resource object.

func (*Pypi) Changelog

func (p *Pypi) Changelog(from, to string) *result.Changelogs

Changelog returns release notes for the package between the from and to versions.

func (*Pypi) Condition

func (p *Pypi) Condition(ctx context.Context, source string, scmHandler scm.ScmHandler) (pass bool, message string, err error)

Condition checks that a PyPI package version exists.

func (*Pypi) ReportConfig

func (p *Pypi) ReportConfig() interface{}

ReportConfig returns a sanitized copy of the spec for reporting.

func (*Pypi) Source

func (p *Pypi) Source(ctx context.Context, workingDir string, resultSource *result.Source) error

Source returns the latest matching PyPI package version.

func (*Pypi) Target

func (p *Pypi) Target(_ context.Context, source string, scmHandler scm.ScmHandler, dryRun bool, resultTarget *result.Target) error

Target is not supported for the pypi plugin.

type Spec

type Spec struct {
	// Name defines the PyPI package name.
	Name string `yaml:",omitempty"`
	// Version defines a specific package version for condition checks.
	Version string `yaml:",omitempty"`
	// URL defines the PyPI-compatible registry URL (defaults to https://pypi.org/).
	URL string `yaml:",omitempty"`
	// Token defines the Bearer token for private registries.
	Token string `yaml:",omitempty"`
	// VersionFilter provides parameters to specify version pattern and its type.
	VersionFilter version.Filter `yaml:",omitempty"`
}

Spec defines a specification for a PyPI package parsed from an updatecli manifest.

func (*Spec) Validate

func (s *Spec) Validate() error

Validate checks that the Pypi spec contains required fields.

Jump to

Keyboard shortcuts

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