External dependency
external_dependency ¶
This module contains helper object for manipulating external dependencies.
These manipulations include retrieving, validating, and cleaning external dependencies for the build environment.
ExternalDependency ¶
Baseclass to allow downloading external dependencies during the update phase.
Specific External dependency types (git, nuget, etc.) are subclassed from this class. Additional external dependency types may be created.
Attributes:
Name | Type | Description |
---|---|---|
scope |
str
|
Determines if descriptor is included on a particular build. |
type |
str
|
Type of ext_dep. |
name |
str
|
Name of ext_dep, used to name the folder the ext_dep will be unpacked in to |
source |
str
|
Source to query for ext_dep. |
version |
str
|
Version string to keep track of what version is currently installed. |
flags |
list[str]
|
Flags dictating what actions should be taken once this dependency is resolved More info: (docs/feature_extdep/) |
var_name |
str
|
Used with set_*_var flag. Determines name of var to be set. |
Tip
The attributes are what must be described in the ext_dep yaml file!
__init__ ¶
__init__(descriptor: dict) -> None
Inits a web dependency based off the provided descriptor.
set_global_cache_path ¶
set_global_cache_path(
global_cache_path: str,
) -> ExternalDependency
Sets the global cache path to locate already downloaded dependencies.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
global_cache_path |
str
|
directory of the global cache |
required |
determine_cache_path ¶
determine_cache_path() -> Optional[str]
Determines the cache path is global_cache_path is not none.
copy_from_global_cache ¶
copy_from_global_cache(dest_path: str) -> None
Copies the dependency from global cache if present.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dest_path |
str
|
path to copy to |
required |
copy_to_global_cache ¶
copy_to_global_cache(source_path: str) -> None
Copies the dependency to global cache if present.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_path |
str
|
source to copy into global cache. |
required |
update_state_file ¶
update_state_file() -> None
Updates the file representing the state of the dependency.
ExtDepFactory ¶
ExtDepFactory(descriptor: dict) -> ExternalDependency
External Dependency Factory capable of generating each type of dependency.
Note
Ensure all external dependencies are imported in this class to avoid errors.