conda_recipe_manager.fetcher.base_artifact_fetcher#

Description:

Provides a base class that all Artifact Fetcher are derived from.

Classes

BaseArtifactFetcher(name)

Base class for all ArtifactFetcher classes.

class conda_recipe_manager.fetcher.base_artifact_fetcher.BaseArtifactFetcher(name: str)[source]#

Bases: AbstractContextManager[BaseArtifactFetcher]

Base class for all ArtifactFetcher classes. An ArtifactFetcher provides a standard set of tools to retrieve bundles of source code.

Files retrieved from any artifact fetcher are stored in a secure temporary directory. The underlying resource can be cleaned up manually or automatically if the artifact fetcher class is used as a context-managed resource.

apply_patches() None[source]#

TODO Flush this mechanism out. It looks like the same mechanism is used for http and git sources(?)

cleanup() None[source]#

Allows the caller to manually clean-up resources used by this artifact-fetching class.

abstractmethod fetch() None[source]#

Retrieves the build artifact and source code and dumps it to a secure temporary location.

"Gretchen, stop trying to make fetch happen! It's not going to happen!" - Regina George

Raises:

FetchError -- When the target artifact fails to be acquired.

fetched() bool[source]#

Allows the caller to know if the target resource has been successfully fetched. In some scenarios this may be useful to know to prevent duplicated/wasted I/O calls.

Returns:

True if this object has successfully fetched the target resource AND that resource is still available. False otherwise.

abstractmethod get_path_to_source_code() Path[source]#

Returns the directory containing the artifact's bundled source code.

Raises:

FetchRequiredError -- If a call to fetch() is required before using this function.