Documentation ¶
Index ¶
- func UpdateDependenciesCache(updatedMap map[string]*buildinfo.Dependency, cacheDir string) (err error)
- func UpdateDepsChecksumInfo(dependenciesMap map[string]*buildinfo.Dependency, cacheDirPath string, ...) error
- func UpdateDepsIdsAndRequestedBy(allDependencies map[string]*buildinfo.Dependency, ...)
- type DependenciesCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdateDependenciesCache ¶
func UpdateDependenciesCache(updatedMap map[string]*buildinfo.Dependency, cacheDir string) (err error)
Receives map of all current project's dependencies information. The map contains the dependencies retrieved from Artifactory as well as those read from cache. Writes the updated project's dependencies cache with all current dependencies.
func UpdateDepsChecksumInfo ¶
func UpdateDepsChecksumInfo(dependenciesMap map[string]*buildinfo.Dependency, cacheDirPath string, servicesManager artifactory.ArtifactoryServicesManager, repository string) error
Populate project's dependencies with checksums and file names. If the dependency was downloaded in this pip-install execution, checksum will be fetched from Artifactory. Otherwise, check if exists in cache. Return dependency-names of all dependencies which its information could not be obtained.
func UpdateDepsIdsAndRequestedBy ¶ added in v2.9.0
func UpdateDepsIdsAndRequestedBy(allDependencies map[string]*buildinfo.Dependency, dependenciesGraph map[string][]string, topLevelPackagesList []string, packageName, moduleName string)
Before running this function, dependency IDs may be the file names of the resolved python packages. Update build info dependency IDs and the requestedBy field. allDependencies - Dependency name to Dependency map dependenciesGraph - Dependency graph as built by 'pipdeptree' or 'pipenv graph' topLevelPackagesList - The direct dependencies packageName - The resolved package name of the Python project, may be empty if we couldn't resolve it moduleName - The input module name from the user, or the packageName
Types ¶
type DependenciesCache ¶
type DependenciesCache struct { Version int `json:"version,omitempty"` DepsMap map[string]*buildinfo.Dependency `json:"dependencies,omitempty"` }
func GetProjectDependenciesCache ¶
func GetProjectDependenciesCache(cacheDir string) (cache *DependenciesCache, err error)
Reads the json cache file of recent used project's dependencies, and converts it into a map of Key: dependency_name Value: dependency's struct with all relevant information. If cache file does not exist -> return nil, nil. If error occurred, return error.
func (DependenciesCache) GetDependency ¶
func (cache DependenciesCache) GetDependency(dependencyName string) *buildinfo.Dependency
Return required dependency from cache. If dependency does not exist, return nil. dependencyName - Name of dependency (lowercase package name).