conda_recipe_manager.fetcher.http_artifact_fetcher#

Description:

Provides an Artifact Fetcher capable of acquiring a software archive from an HTTP/HTTPS source.

Classes

ArtifactArchiveType(value)

Enumerates the types of archive file formats that are supported.

HttpArtifactFetcher(name, archive_url)

Artifact Fetcher capable of downloading a software archive from a remote HTTP/HTTPS source.

class conda_recipe_manager.fetcher.http_artifact_fetcher.ArtifactArchiveType(value)[source]#

Bases: Enum

Enumerates the types of archive file formats that are supported.

TARBALL = 3#
UNKNOWN = 4#
ZIP = 1#
ZIP_7 = 2#
class conda_recipe_manager.fetcher.http_artifact_fetcher.HttpArtifactFetcher(name: str, archive_url: str)[source]#

Bases: BaseArtifactFetcher

Artifact Fetcher capable of downloading a software archive from a remote HTTP/HTTPS source.

apply_patches() None#

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

cleanup() None#

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

fetch() None[source]#

Retrieves a software archive from a remote HTTP/HTTPS host and stores the files in a secure temporary directory.

Raises:

FetchError -- If an issue occurred while downloading or extracting the archive.

fetched() bool#

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.

get_archive_sha256() str[source]#

Calculates a SHA-256 hash on the downloaded software archive.

Raises:

FetchRequiredError -- If fetch() has not been successfully invoked.

get_archive_type() ArtifactArchiveType[source]#

Returns the type of archive that was retrieved. This evaluation was determined by evaluating the file and not by the file name.

Raises:

FetchRequiredError -- If fetch() has not been successfully invoked.

get_archive_url() str[source]#

Returns the URL where the archive can be found. This may be useful if the URL needs to be corrected or modified.

Returns:

The URL where the archive can be found.

get_path_to_source_code() Path[source]#

Returns the directory containing the artifact's bundled source code. NOTE: If the target archive compresses top-level folder that contains the source code, this path will point to a directory containing that uncompressed top-level folder.

Raises:

FetchRequiredError -- If fetch() has not been successfully invoked.