foundry_dev_tools.utils.compat module

foundry_dev_tools.utils.compat module#

This module contains utility functions for compatibility between the v1 and v2 config.

foundry_dev_tools.utils.compat.v1_to_v2_config_dict(config, env=True, get_config=True)[source]#

Converts the config argument to the new v2 config.

Parameters:
  • config (dict) – the v1 dictionary to convert

  • env (bool) – whether to include the environment variables in the conversion

  • get_config (bool) – wether to get the config from files and merge it

Return type:

dict

foundry_dev_tools.utils.compat.v1_to_v2_config(config)[source]#

Converts a version 1 configuration to a version 2 configuration.

Parameters:

config (dict) – The version 1 configuration to be converted.

Returns:

A tuple containing the TokenProvider and the converted configuration.

Return type:

tuple[TokenProvider, dict]

Raises:

AttributeError – If the TokenProvider cannot be created due to missing jwt or client_id(/client_secret).

foundry_dev_tools.utils.compat.get_v1_environment_variables()[source]#

Parses the v1 environment variables and converts them to a v2 dictionary.

Returns:

A dictionary containing the processed v1 environment variables.

Return type:

dict