envs_manager
#
Tools for managing conda environments.
Functions#
Gets the path to the user's environments.txt file. |
|
|
Registers an environment by adding it to environments.txt file. |
|
Unregisters an environment by removing its entry from the environments.txt file if certain conditions are met. |
|
Lists all known conda environment prefixes. |
|
Queries all known prefixes for a given specification. |
|
Cleans the environments.txt file by removing specified locations. |
|
Rewrites the environments.txt file with the specified prefixes. |
- get_user_environments_txt_file(userhome: str = '~') str #
Gets the path to the user's environments.txt file.
- register_env(location: str) None #
Registers an environment by adding it to environments.txt file.
- Parameters:
location (str) -- The file path of the environment to register.
- Returns:
None
- unregister_env(location: str) None #
Unregisters an environment by removing its entry from the environments.txt file if certain conditions are met.
The environment is only unregistered if its associated 'conda-meta' directory exists and contains no significant files other than 'history'. If these conditions are met, the environment's path is removed from environments.txt.
- Parameters:
location (str) -- The file path of the environment to unregister.
- Returns:
None
- list_all_known_prefixes() list[str] #
Lists all known conda environment prefixes.
- Returns:
A list of all known conda environment prefixes.
- Return type:
List[str]
- query_all_prefixes(spec: str) collections.abc.Iterator[tuple[str, tuple]] #
Queries all known prefixes for a given specification.
- _clean_environments_txt(environments_txt_file: str, remove_location: str | None = None) tuple[str, Ellipsis] #
Cleans the environments.txt file by removing specified locations.