aedev.setup_hook

individually configurable setup hook

by replacing the function call of project_env_vars() in the aedev.setup_project module of a project with a call to the function hooked_project_env_vars(), provided by this module, an individual hook will be executed automatically just before the execution of the setuptools setup() method.

this setup hook can be used e.g. to adapt/extend the variables and constants of the project environment variable mapping. also, the settings of a portion of a namespace project can be configured individually by adding a hook module (containing a hook method) into the portions project working tree root folder. the default names of the hook module and method are specified by the constant NAMESPACE_EXTEND_ENTRY_POINT, which gets also added automatically into the project environment variable mapping by the function hooked_project_env_vars() of this module.

Module Attributes

NAMESPACE_EXTEND_ENTRY_POINT

module:method default names of the setup hook

Functions

hooked_project_env_vars([project_path])

called from setup.py instead of project_env_vars() to determine the project vars.

pev_update_hook(pev)

check if optional NAMESPACE_EXTEND_ENTRY_POINT hook file exists and if yes then run it to change pev values.

NAMESPACE_EXTEND_ENTRY_POINT = 'setup_hooks:extend_project_env_vars'

module:method default names of the setup hook

hooked_project_env_vars(project_path='')[source]

called from setup.py instead of project_env_vars() to determine the project vars.

Parameters:

project_path (str) – optional rel/abs path of package/app/project root (def=current working directory).

Return type:

Dict[str, Union[str, Sequence[str], List[Tuple[str, Tuple[str, ...]]], Dict[str, Any]]]

Returns:

project environment variables mapping/dict, optionally updated by hook.

pev_update_hook(pev)[source]

check if optional NAMESPACE_EXTEND_ENTRY_POINT hook file exists and if yes then run it to change pev values.

Parameters:

pev (Dict[str, Union[str, Sequence[str], List[Tuple[str, Tuple[str, ...]]], Dict[str, Any]]]) – namespace environment variables.

Return type:

bool

Returns:

True if hook got called, else False.