idiap_devtools.profile#
Module Attributes
The previous default location for the user configuration file. |
|
The default location for the user configuration file. |
Functions
|
Returns the local directory of the named profile. |
|
Loads a profile TOML file, returns a dictionary with contents. |
Classes
|
A class representing the development profile. |
- idiap_devtools.profile.OLD_USER_CONFIGURATION = PosixPath('/home/docs/.config/devtools.toml')#
The previous default location for the user configuration file.
- idiap_devtools.profile.USER_CONFIGURATION = PosixPath('/home/docs/.config/idiap-devtools.toml')#
The default location for the user configuration file.
- idiap_devtools.profile.load(dir)[source]#
Loads a profile TOML file, returns a dictionary with contents.
- idiap_devtools.profile.get_profile_path(name)[source]#
Returns the local directory of the named profile.
If the input name corresponds to an existing directory, then that is returned. Otherwise, we lookup the said name inside the user configuration. If one exists, then the path pointed by that variable is returned. Otherwise, an exception is raised.
- class idiap_devtools.profile.Profile(name)[source]#
Bases:
object
A class representing the development profile.
- Parameters:
path – The name of the local profile to return - can be either an existing path, or any name from the user configuration file.
- conda_config(python, public, stable)[source]#
Builds the conda-configuration to use based on the profile.
- Parameters:
python (
str
) – The python version in the format “X.Y” (e.g. “3.9” or “3.10”)private – Set to
True
if we should use private channels/indexes to lookup dependencies. Should beFalse
otherwisestable (
bool
) – Set toTrue
if we should only consider stable versions of packages, as opposed to pre-release ones (beta packages). Set toFalse
otherwise.
- Return type:
- return_type:
- conda_build.config.Config: A dictionary containing the merged
configuration, as produced by conda-build API’s get_or_merge_config() function.
- python_indexes(public, stable)[source]#
Returns Python indexes to be used according to the current profile.
- Parameters:
private – Set to
True
if we should use private channels/indexes to lookup dependencies. Should beFalse
otherwisestable (
bool
) – Set toTrue
if we should only consider stable versions of packages, as opposed to pre-release ones (beta packages). Set toFalse
otherwise.
- Return type:
- get_path(key, default=None)[source]#
Reads the contents of path from the profile and resolves it.
This function will search for a given profile key, consider it points to a path (relative or absolute) and will return that resolved path to the caller.
- Parameters:
- Return type:
- Returns:
The selected profile file path, or the contents of
default
otherwise.
- get_file_contents(key, default=None)[source]#
Reads the contents of a file from the profile.
This function will search for a given profile key, consider it points to a filename (relative or absolute) and will read its contents, returning them to the caller.
- Parameters:
- Return type:
- Returns:
The contents of the selected profile file, or the contents of
default
otherwise.