def compatibility_from_options(working_dir, options=None, environment=None):
    """Get compose v3 compatibility from --compatibility option
       or from COMPOSE_COMPATIBILITY environment variable."""
    compatibility_option = options.get('--compatibility')
    compatibility_environment = environment.get_boolean('COMPOSE_COMPATIBILITY'
        )
    return compatibility_option or compatibility_environment
