OhMyArtifacts
Documentation for OhMyArtifacts.
OhMyArtifacts.bind_my_artifact!OhMyArtifacts.create_my_artifactOhMyArtifacts.download_my_artifact!OhMyArtifacts.initOhMyArtifacts.load_my_artifacts_tomlOhMyArtifacts.my_artifact_existsOhMyArtifacts.my_artifact_hashOhMyArtifacts.my_artifact_pathOhMyArtifacts.my_artifacts_toml!OhMyArtifacts.unbind_my_artifact!OhMyArtifacts.unbind_my_artifact!OhMyArtifacts.@my_artifactOhMyArtifacts.@my_artifacts_toml!OhMyArtifacts.@my_artifacts_toml!
OhMyArtifacts.bind_my_artifact! — Methodbind_my_artifact!(artifacts_toml::String, name::AbstractString, hash::SHA256; force::Bool = false, metadata = nothing)Writes a mapping of name -> hash in the given "Artifacts.toml" file and track the usage. If force is set to true, this will overwrite a pre-existant mapping, otherwise an error is raised. By setting metadata, we can store extra information in the artifacts_toml with field name meta of name entry.
OhMyArtifacts.create_my_artifact — Methodcreate_my_artifact(f::Function)Create artifact by calling f(working_dir). f is the function that create/put/download file(s) into the working_dir. f should either return the path to the file/directory or return nothing. If f return nothing, then everything in working_dir would be cached. If f return a path, that path must be inside working_dir.
OhMyArtifacts.download_my_artifact! — Methoddownload_my_artifact!([downloadf::Function = Downloads.download], url, name::AbstractString, artifacts_toml::String;
force_bind::Bool = false, bind_metadata = nothing, downloadf_kwarg...)Convenient function that do download-create-bind together and return the content hash. Download function downloadf should take two position arguments (i.e. downloadf(url, dest; downloadf_kwarg...)). if force_bind is true, it will overwrite the pre-existant binding.
See also: createmyartifact, bindmyartifact!
OhMyArtifacts.init — Methodinit()Initialize the storage space.
Generally you don't have to manually call this function. It would be called everytime you call my_artifacts_toml!. This function would setup the scratch space we need, check if we need to recycle some storages.
OhMyArtifacts.load_my_artifacts_toml — Methodload_my_artifacts_toml(artifacts_toml::String)Safely read the artifacts_toml, return a Dict{String, Any} of binding name to sha256 hash.
OhMyArtifacts.my_artifact_exists — Methodmy_artifact_exists(hash::SHA256)Returns whether the given artifact (identified by its SHA256 content hash) exists on-disk.
OhMyArtifacts.my_artifact_hash — Methodmy_artifact_hash(name::AbstractString, artifacts_toml::String)Return the hash found in artifacts_toml with given name, or nothing if not found.
OhMyArtifacts.my_artifact_path — Methodmy_artifact_path(hash::SHA256)Given an artifact (identified by SHA256 content hash), return its installation path. If the artifact does not exist, returns the location it would be installed to.
See also: my_artifact_exists
OhMyArtifacts.my_artifacts_toml! — Methodmy_artifacts_toml!(pkg::Union{Module,Base.UUID,Nothing}; versioned = false)Return the path to (or creates) "Artifacts.toml" for the given pkg. If versioned is set to true, we get a separate "Artifacts_<version number>.toml".
See also: @my_artifacts_toml!
OhMyArtifacts.unbind_my_artifact! — Methodunbind_my_artifact!(artifacts_toml::String, name::AbstractString)Unbind the given name from the "Artifacts.toml" file. Silently fails if no such binding exists within the file.
OhMyArtifacts.unbind_my_artifact! — Methodunbind_my_artifact!(artifacts_toml::String, names::Vector{String})Unbind the given list of names from the "Artifacts.toml" file.
OhMyArtifacts.@my_artifact — Macro@my_artifact op name [hash]Convenient macro for working with "Artifacts.toml". Requiring a global variable my_artifacts storing the path to "Artifacts.toml" (created by @my_artifacts_toml!) to work correctly.
Usage:
@my_artifact :bind name hash=>bind_my_artifact!(my_artifacts, name, hash)@my_artifact :hash name=>my_artifact_hash(name, my_artifacts)@my_artifact :unbind name=>unbind_my_artifact!(my_artifacts, name)@my_artifact :download name url downloadf kwarg...=>download_my_artifact!(downloadf, url, name, my_artifacts; kwarg...)
See also: bind_my_artifact!, my_artifact_hash, unbind_my_artifact!, @my_artifacts_toml
OhMyArtifacts.@my_artifacts_toml! — Macro@my_artifacts_toml!(versioned=true)Convenience macro that gets/creates a "Artifacts.toml" with version and parented to the package the calling module belongs to.
See also: my_artifacts_toml!
OhMyArtifacts.@my_artifacts_toml! — Macro@my_artifacts_toml!()Convenience macro that gets/creates a "Artifacts.toml" and parented to the package the calling module belongs to.
See also: my_artifacts_toml!