Package#
A Package is a Runhouse primitive for sharing code between various systems (ex: s3, cluster, local).
Package Factory Method#
- runhouse.package(name: str | None = None, install_method: str | None = None, install_str: str | None = None, path: str | None = None, system: str | None = None, dryrun: bool = False, local_mount: bool = False, data_config: Dict | None = None) Package [source]#
Builds an instance of
Package
.- Parameters:
name (str) β Name to assign the package resource.
install_method (str) β Method for installing the package. Options: [
pip
,conda
,reqs
,local
]install_str (str) β Additional arguments to install.
path (str) β URL of the package to install.
system (str) β File system or cluster on which the package lives. Currently this must a cluster or one of: [
file
,github
,sftp
,ssh
,s3
,gs
,azure
].dryrun (bool) β Whether to create the Package if it doesnβt exist, or load the Package object as a dryrun. (Default:
False
)local_mount (bool) β Whether to locally mount the installed package. (Default:
False
)data_config (Optional[Dict]) β The data config to pass to the underlying fsspec handler.
- Returns:
The resulting package.
- Return type:
Example
>>> import runhouse as rh >>> reloaded_package = rh.package(name="my-package") >>> local_package = rh.package(path="local/folder/path", install_method="local")
- runhouse.git_package(name: str | None = None, git_url: str | None = None, revision: str | None = None, install_method: str | None = None, install_str: str | None = None, dryrun: bool = False)[source]#
Builds an instance of
GitPackage
.- Parameters:
name (str) β Name to assign the package resource.
git_url (str) β The GitHub URL of the package to install.
revision (str) β Version of the Git package to install.
install_method (str) β Method for installing the package. If left blank, defaults to local installation.
install_str (str) β Additional arguments to add to installation command.
dryrun (bool) β Whether to load the Package object as a dryrun, or create the Package if it doesnβt exist. (Default:
False
)
- Returns:
The resulting GitHub Package.
- Return type:
Example
>>> rh.git_package(git_url='https://github.com/runhouse/runhouse.git', >>> install_method='pip', revision='v0.0.1')
Package Class#
GitPackage Docs#
- class runhouse.GitPackage(name: str | None = None, git_url: str | None = None, install_method: str | None = None, install_args: str | None = None, revision: str | None = None, dryrun: bool = False, **kwargs)[source]#
- __init__(name: str | None = None, git_url: str | None = None, install_method: str | None = None, install_args: str | None = None, revision: str | None = None, dryrun: bool = False, **kwargs)[source]#
Runhouse Github Package resource.
Note
To create a git package, please use the factory method
git_package()
orpackage()
.