hutch_python.bug.get_current_environment

hutch_python.bug.get_current_environment()

Get the current CONDA environment

The environment name is gathered by first checking environment variable $CONDA_ENVNAME that is set by the hutch-python startup scripts. If for whatever reason that is not available we check $CONDA_DEFAULT_ENV which is set by Conda itself. The reason this is not relied on primarily is it has a strange name and is entirely undocumented but seems to work effectively.

In addition the hutch-python startup script sets the PYTHONPATH to pick up packages in “development” mode. The list of package names installed this way is found to help inform how the current Python environment differs from the enforced CONDA environment

Returns:

  • env (str) – Name of environment

  • dev_pkgs (list) – List of packages installed in the development folder