flambe.compile.extensions

This module provides methods to orchestrate all extensions

Module Contents

flambe.compile.extensions.logger[source]
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:
Returns:

The location of the installed package (which it could not match the location passed as parameter)

Return type:

str

flambe.compile.extensions._has_svn() → bool[source]

Return if the host has svn installed

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
flambe.compile.extensions.import_modules(modules: Iterable[str]) → None[source]

Dinamically import modules

Parameters:modules (Iterable[str]) – An iterable of strings containing the modules to import
flambe.compile.extensions.setup_default_modules()[source]