Documentation
¶
Index ¶
- Constants
- Variables
- func BuildDependencyGraph(modules *[]meta.Package, pkgsMetadata *map[string]Metadata) error
- func BuildDistInfoPath(location string, name string, version string) string
- func BuildLicenseURL(distInfoLocation string) string
- func BuildLocalPath(location string, name string) string
- func BuildMetadataPath(distInfoLocation string) string
- func BuildPackageJSONURL(name string, version string) string
- func BuildPackageReleaseURL(name string, version string) string
- func BuildPackageURL(name string) string
- func BuildProjectURL(name string) string
- func BuildWheelPath(distInfoLocation string) string
- func GetChecksumeFromPyPiPackageData(pkgData PypiPackageData, metadata Metadata) *meta.Checksum
- func GetDownloadLocationFromPyPiPackageData(pkgData PypiPackageData, metadata Metadata) string
- func GetHighestOrderHashData(digests DigestTypes) (meta.HashAlgorithm, string)
- func GetMaintenerDataFromPyPiPackageData(pkgData PypiPackageData) (string, string)
- func GetShortPythonVersion(version string) string
- func GetVenFromEnvs() (bool, string, string)
- func GetWheelDistributionInfo(metadata *Metadata) (string, string, error)
- func HasDefaultVenv(path string) (bool, string, string)
- func HasPyvenvCfg(path string) bool
- func IsAuthorAnOrganization(author string, authoremail string) bool
- func IsRequirementMeet(data string) bool
- func IsRootModule(pkg Packages, pipType string) bool
- func IsValidRootModule(path string) bool
- func ParseMetadata(metadata *Metadata, packagedetails string)
- func ScanPyvenvCfg(files *string, folderpath *string) filepath.WalkFunc
- func SearchVenv(path string) (bool, string, string)
- func SetMetadataToNoAssertion(metadata *Metadata, packagename string)
- func SetMetadataValues(matadata *Metadata, datamap map[string]string)
- type DigestTypes
- type GetPackageDetailsFunc
- type Metadata
- type MetadataDecoder
- func (d *MetadataDecoder) BuildMetadata(pkgs []Packages) (map[string]Metadata, []Metadata, error)
- func (d *MetadataDecoder) BuildModule(metadata Metadata) meta.Package
- func (d *MetadataDecoder) ConvertMetadataToModules(pkgs []Packages, modules *[]meta.Package) (map[string]Metadata, error)
- func (d *MetadataDecoder) GetMetadataList(pkgs []Packages) (map[string]Metadata, []Metadata, error)
- type Packages
- type PypiPackageData
- type PypiPackageDistInfo
- type PypiPackageInfo
Constants ¶
View Source
const ( ProjectURL = "pypi.org/project" PackageURL = "pypi.org/pypi" SitePackage = "site-packages" PackageDistInfoPath = ".dist-info" PackageLicenseFile = "LICENSE" PackageMetadataFie = "METADATA" PackageWheelFie = "WHEEL" // NOASSERTION constant NoAssertion = "NOASSERTION" KeyName = "name" KeyVersion = "version" KeySummary = "summary" KeyHomePage = "home-page" KeyAuthor = "author" KeyAuthorEmail = "author-email" KeyLicense = "license" KeyLocation = "location" KeyRequires = "requires" )
View Source
const ( ModuleDotVenv = ".venv" ModuleVenv = "venv" PyvenvCfg = "pyvenv.cfg" VirtualEnv = "VIRTUAL_ENV" )
Virtual env constants
Variables ¶
View Source
var AuthorAnOrganizationKeywords = []string{"Authority", "Team", "Developers", "Services", "Foundation", "Software"}
View Source
var HashAlgoPickOrder []meta.HashAlgorithm = []meta.HashAlgorithm{ meta.HashAlgoSHA512, meta.HashAlgoSHA384, meta.HashAlgoSHA256, meta.HashAlgoSHA224, meta.HashAlgoSHA1, meta.HashAlgoMD6, meta.HashAlgoMD5, meta.HashAlgoMD4, meta.HashAlgoMD2, }
HashAlgoPickOrder Order in which we want to pick the package digest
View Source
var PythonVersion = map[string]string{
"cp39": "Python 3.9",
"cp38": "Python 3.8",
"cp37": "Python 3.7",
"cp36": "Python 3.6",
"cp35": "Python 3.5",
"cp34": "Python 3.4",
"cp33": "Python 3.3",
"cp32": "Python 3.2",
"cp31": "Python 3.1",
"cp30": "Python 3.0",
"cp27": "Python 2.7",
"cp26": "Python 2.6",
"cp25": "Python 2.5",
"cp24": "Python 2.4",
"cp23": "Python 2.3",
"cp22": "Python 2.2",
"cp21": "Python 2.1",
"cp20": "Python 2.0",
"cp16": "Python 1.6",
"cp15": "Python 1.5",
"cp10": "Python 1.0",
}
Functions ¶
func BuildDependencyGraph ¶
func BuildDistInfoPath ¶
func BuildLicenseURL ¶
func BuildLocalPath ¶
func BuildMetadataPath ¶
func BuildPackageJSONURL ¶
func BuildPackageReleaseURL ¶
func BuildPackageURL ¶
func BuildProjectURL ¶
func BuildWheelPath ¶
func GetChecksumeFromPyPiPackageData ¶
func GetChecksumeFromPyPiPackageData(pkgData PypiPackageData, metadata Metadata) *meta.Checksum
func GetDownloadLocationFromPyPiPackageData ¶
func GetDownloadLocationFromPyPiPackageData(pkgData PypiPackageData, metadata Metadata) string
func GetHighestOrderHashData ¶
func GetHighestOrderHashData(digests DigestTypes) (meta.HashAlgorithm, string)
func GetMaintenerDataFromPyPiPackageData ¶
func GetMaintenerDataFromPyPiPackageData(pkgData PypiPackageData) (string, string)
func GetShortPythonVersion ¶
func GetVenFromEnvs ¶
func HasPyvenvCfg ¶
func IsAuthorAnOrganization ¶
func IsRequirementMeet ¶
func IsRootModule ¶
func IsValidRootModule ¶
func ParseMetadata ¶
func SetMetadataValues ¶
Types ¶
type DigestTypes ¶
type GetPackageDetailsFunc ¶
type Metadata ¶
type Metadata struct { CPVersion string Root bool Name string Version string Description string ProjectURL string PackageURL string PackageJSONURL string PackageReleaseURL string HomePage string Author string AuthorEmail string License string DistInfoPath string LicensePath string MetadataPath string WheelPath string Location string LocalPath string Modules []string Generator string Tag string }
type MetadataDecoder ¶
type MetadataDecoder struct {
// contains filtered or unexported fields
}
func NewMetadataDecoder ¶
func NewMetadataDecoder(pkgDetailsFunc GetPackageDetailsFunc) *MetadataDecoder
New Metadata Decoder ...
func (*MetadataDecoder) BuildMetadata ¶
func (*MetadataDecoder) BuildModule ¶
func (d *MetadataDecoder) BuildModule(metadata Metadata) meta.Package
func (*MetadataDecoder) ConvertMetadataToModules ¶
func (*MetadataDecoder) GetMetadataList ¶
type Packages ¶
type Packages struct { Name string `json:"name,omitempty"` Version string `json:"version,omitempty"` Location string `json:"location,omitempty"` Installer string `json:"installer,omitempty"` Root bool CPVersion string }
func LoadModules ¶
type PypiPackageData ¶
type PypiPackageData struct { Info PypiPackageInfo `json:"info"` Urls []PypiPackageDistInfo `json:"urls"` }
func GetPackageDataFromPyPi ¶
func GetPackageDataFromPyPi(packageJSONURL string) (PypiPackageData, error)
type PypiPackageDistInfo ¶
type PypiPackageDistInfo struct { CommentText string `json:"comment_text"` Digests DigestTypes `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"` RequiresPython string `json:"requires_python"` URL string `json:"url"` Yanked bool `json:"yanked"` YankedReason string `json:"yanked_reason"` }
func GetPackageBDistWheelInfo ¶
func GetPackageBDistWheelInfo(distInfo PypiPackageDistInfo, generator string, tag string, cpversion string) (PypiPackageDistInfo, bool)
func GetPackageSDistInfo ¶
func GetPackageSDistInfo(distInfo PypiPackageDistInfo, generator string) (PypiPackageDistInfo, bool)
type PypiPackageInfo ¶
type PypiPackageInfo 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"` HomePageURL 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"` 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"` }
Click to show internal directories.
Click to hide internal directories.