schrodinger.utils.env module

schrodinger.utils.env.append_path(env_dict, env_var, path)

Appends a path to env_var (defined as constants in schrodinger.utils.env) in the env_dict. This uses the traditional path seperator. We normalize the path argument.

Parameters:
  • env_var (str) – existing environment variable (example: schrodinger.utils.env.PATH)
  • path (str) – path to extend with
schrodinger.utils.env.prepend_path(env_dict, env_var, path)

Appends a path to env_var (defined as constants in schrodinger.utils.env) We normalize the path argument.

Parameters:
  • env_var (str) – existing environment variable (example: schrodinger.utils.env.PATH)
  • path (str) – path to extend with
class schrodinger.utils.env.swap_ld_library_path

Bases: contextlib.ContextDecorator

Restore LD_LIBRARY_PATH to the value that it was when we first ran a toplevel script. ORIGINAL_LD_LIBRARY_PATH is set by toplevel.sh

__init__

Initialize self. See help(type(self)) for accurate signature.

class schrodinger.utils.env.EnvironmentContext(key, value)

Bases: object

Context manager to temporarily set an environment variable and then return it to its original value upon exit.

__init__(key, value)

Initialize self. See help(type(self)) for accurate signature.

class schrodinger.utils.env.remove_ssl_ld_library_path

Bases: contextlib.ContextDecorator

Temporarily remove SSL library path from the LD_LIBRARY_PATH. This will force ssh, as called by MPI, to be linked against the system libcrypto rather than the one in the Schrodinger software (JOBCON-5027). But sometimes the user has ssh but not libcrypto and then their ssh has to use our libcrypto (DESMOND-7780). So test whether ssh fails or not by actually running it. What a world!

__init__

Initialize self. See help(type(self)) for accurate signature.

schrodinger.utils.env.prepend_sys_path(path)

Prepend to a specific path to sys.path. Strongly consider using a namespace

Parameters:path (str) – directory name of path