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:

Package

Example

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:

GitPackage

Example

Package Class

class runhouse.Package(name: str | None = None, install_method: str | None = None, install_target: str | Folder | None = None, install_args: str | None = None, dryrun: bool = False, **kwargs)[source]
__init__(name: str | None = None, install_method: str | None = None, install_target: str | Folder | None = None, install_args: str | None = None, dryrun: bool = False, **kwargs)[source]

Runhouse Package resource.

Note

To create a git package, please use the factory method package().

to(system: str | Dict | Cluster, path: str | None = None, mount: bool = False)[source]

Copy the package onto filesystem or cluster, and return the new Package object.

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() or package().