flambe.compile.extensions
¶
This module provides methods to orchestrate all extensions
Module Contents¶
-
flambe.compile.extensions.
download_extensions
(extensions: Dict[str, str], container_folder: str) → Dict[str, str][source]¶ Iterate through the extensions and download the remote urls.
Parameters: - extensions (Dict[str, str]) – The extensions that may contain both local or remote locations.
- container_folder (str) – The auxiliary folder where to download the remote repo
Returns: A new extensions dict with the local paths instead of remote urls. The local paths contain the downloaded remote resources.
Return type: Dict[str, str]
-
flambe.compile.extensions.
_download_remote_extension
(extension_url: str, location: str) → str[source]¶ Download a remote hosted extension.
It fully supports github urls only (for now).
Parameters: - extension_url (str) – The github url pointing to an extension. For example: https://github.com/user/folder/tree/branch/path/to/ext
- location (str) – The location to download the repo
Returns: The location of the installed package (which it could not match the location passed as parameter)
Return type: str
-
flambe.compile.extensions.
_download_svn
(svn_url: str, location: str, username: Optional[str] = None, password: Optional[str] = None) → None[source]¶ Use svn to download a specific folder inside a git repo.
This works only with remote Github repositories.
Parameters: - svn_url (str) – The github URL adapted to use the SVN protocol
- location (str) – The location to download the folder
- username (str) – The username
- password (str) – The password
-
flambe.compile.extensions.
install_extensions
(extensions: Dict[str, str], user_flag: bool = False) → None[source]¶ Install extensions.
At this point, all extensions must be either local paths or valid pypi packages.
Remote extensions hosted in Github must have been download first.
Parameters: - extensions (Dict[str, str]) – Dictionary of extensions
- user_flag (bool) – Use –user flag when running pip install
-
flambe.compile.extensions.
is_installed_module
(module_name: str) → bool[source]¶ Whether the module is installed.
Parameters: module_name (str) – The name of the module to check for Returns: True if the module is installed locally, False otherwise. Return type: bool