python

package
v0.15.9 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Author                 string            `json:"author"`
	AuthorEmail            string            `json:"author_email"`
	BugtrackURL            string            `json:"bugtrack_url"`
	Classifiers            []string          `json:"classifiers"`
	Description            string            `json:"description"`
	DescriptionContentType string            `json:"description_content_type"`
	DocsURL                string            `json:"docs_url"`
	DownloadURL            string            `json:"download_url"`
	Downloads              InfoDownloads     `json:"downloads"`
	HomePage               string            `json:"home_page"`
	Keywords               string            `json:"keywords"`
	License                string            `json:"license"`
	Maintainer             string            `json:"maintainer"`
	MaintainerEmail        string            `json:"maintainer_email"`
	Name                   string            `json:"name"`
	PackageURL             string            `json:"package_url"`
	Platform               string            `json:"platform"`
	ProjectURL             string            `json:"project_url"`
	ProjectURLs            map[string]string `json:"project_urls"`
	ReleaseURL             string            `json:"release_url"`
	RequiresDist           []string          `json:"requires_dist"`
	RequiresPython         string            `json:"requires_python"`
	Summary                string            `json:"summary"`
	Version                string            `json:"version"`
	Yanked                 bool              `json:"yanked"`
	YankedReason           string            `json:"yanked_reason"`
}

func (*Info) GetSourceURL added in v0.5.0

func (i *Info) GetSourceURL() string

GetSourceURL returns the source url for the package. This is sometimes Homepage, sometimes in the ProjectUrls as Homepage or Source.

type InfoDownloads

type InfoDownloads struct {
	LastDay   int `json:"last_day"`
	LastMonth int `json:"last_month"`
	LastWeek  int `json:"last_week"`
}

type Package

type Package struct {
	Info         Info                 `json:"info"`
	LastSerial   int                  `json:"last_serial"`
	Releases     map[string][]Release `json:"releases"`
	URLs         []Release            `json:"urls"`
	Dependencies []string             `json:"dependencies"`
}

Package is the json response from https://pypi.org/pypi/PACKAGE_NAME/json more details at https://warehouse.pypa.io/api-reference/json.html

type PackageIndex

type PackageIndex struct {
	Client *rlhttp.RLHTTPClient
	// contains filtered or unexported fields
}

func NewPackageIndex

func NewPackageIndex(url string) *PackageIndex

func (*PackageIndex) CheckSourceDeps

func (p *PackageIndex) CheckSourceDeps(projectName string) error

CheckSourceDeps not all packages list requirements, so we may need to dive into the source code to find deps

func (*PackageIndex) Get

func (p *PackageIndex) Get(ctx context.Context, projectName, version string) (*Package, error)

func (*PackageIndex) GetLatest

func (p *PackageIndex) GetLatest(ctx context.Context, projectName string) (*Package, error)

func (*PackageIndex) GetVersion

func (p *PackageIndex) GetVersion(ctx context.Context, projectName, version string) (*Package, error)

type PythonContext

type PythonContext struct {
	// PackageName is the name of the python package to build and install
	PackageName string

	// PackageVersion is the version of python package to build and install
	PackageVersion string

	// PythonVersion is the version of python to build the package against
	PythonVersion string

	// PackageIndex - Client for talking to pypi
	PackageIndex *PackageIndex

	// OutDir is the output directory for the generated melange files.
	OutDir string

	// BaseURIFormat is the base URI which should contain a %s for the
	// package name.
	BaseURIFormat string

	// AdditionalRepositories contains any additional apk repos to add
	// to the manifest.
	AdditionalRepositories []string

	// AdditionalKeyrings contains any additional apk keys to add
	// to the manifest.
	AdditionalKeyrings []string

	// ToGenerate is the map of dependencies that have been visited when the
	// transitive dependency list is being calculated.
	ToGenerate map[string]Package

	// Pypi Package metadata about package
	Package Package

	// ToCheck is the list of dependencies that have yet to be checked for
	// transitive dependencies.
	ToCheck []string

	// If non-nil, this is the github client to use for fetching metadata
	// to get the commit data for the package.
	GithubClient *github.Client

	// If non-nil, this is the Release Monitoring client to use for fetching
	// metadata to get the monitoring data for the package.
	MonitoringClient *relmon.MonitorFinder

	// If true, avoid converting the PyPI URI to a friendly, human-readable URL
	// May help with conversion failures (404s)
	PreserveBaseURI bool
}

PythonContext is the execution context for the python subcommand.

func New

func New(packageName string) (PythonContext, error)

New initialises a new PythonContext.

func (*PythonContext) Generate

func (c *PythonContext) Generate(ctx context.Context) error

Generate is the entrypoint to generate a python package melange file. It handles recursively finding all dependencies for a pypi package and generating a melange file for each.

type Release

type Release struct {
	CommentText       string         `json:"comment_text"`
	Digest            ReleaseDigests `json:"digests"`
	Downloads         int            `json:"downloads"`
	Filename          string         `json:"filename"`
	HasSig            bool           `json:"has_sig"`
	Md5Digest         string         `json:"md5_digest"`
	PackageType       string         `json:"packagetype"`
	PythonVersion     string         `json:"python_version"`
	Size              int            `json:"size"`
	UploadTimeIso8601 string         `json:"upload_time_iso_8601"`
	URL               string         `json:"url"`
	Yanked            bool           `json:"yanked"`
	YankedReason      string         `json:"yanked_reason"`
}

type ReleaseDigests

type ReleaseDigests struct {
	Md5    string `json:"md5"`
	Sha256 string `json:"sha256"`
}

Jump to

Keyboard shortcuts

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