integration#

These helpers were originally defined in tests/test_create.py, but were refactored here so downstream projects can benefit from them too.

Classes#

Functions#

escape_for_winpath(p)

running_a_python_capable_of_unicode_subprocessing()

set_tmpdir(tmpdir)

_get_temp_prefix([name, use_restricted_unicode])

make_temp_prefix([name, use_restricted_unicode, ...])

When the env. you are creating will be used to install Python 2.7 on Windows

FORCE_temp_prefix([name, use_restricted_unicode])

run_command(→ tuple[str, str, int])

make_temp_env(→ Iterator[str])

make_temp_package_cache(→ Iterator[str])

make_temp_channel(→ Iterator[str])

create_temp_location(→ str)

tempdir(→ Iterator[str])

reload_config(→ None)

package_is_installed(...)

get_shortcut_dir([prefix_for_unix])

Attributes#

TEST_LOG_LEVEL#
PYTHON_BINARY#
UNICODE_CHARACTERS = 'ōγђ家固한áêñßôç'#
UNICODE_CHARACTERS_RESTRICTED = 'abcdef'#
which_or_where#
cp_or_copy#
env_or_set#
SPACER_CHARACTER = ' '#
escape_for_winpath(p)#
running_a_python_capable_of_unicode_subprocessing()#
tmpdir_in_use#
set_tmpdir(tmpdir)#
_get_temp_prefix(name=None, use_restricted_unicode=False)#
make_temp_prefix(name=None, use_restricted_unicode=False, _temp_prefix=None)#

When the env. you are creating will be used to install Python 2.7 on Windows only a restricted amount of Unicode will work, and probably only those chars in your current codepage, so the characters in UNICODE_CHARACTERS_RESTRICTED should probably be randomly generated from that instead. The problem here is that the current codepage needs to be able to handle 'sys.prefix' otherwise ntpath will fall over.

FORCE_temp_prefix(name=None, use_restricted_unicode=False)#
class Commands#
COMPARE = 'compare'#
CONFIG = 'config'#
CLEAN = 'clean'#
CREATE = 'create'#
INFO = 'info'#
INSTALL = 'install'#
LIST = 'list'#
REMOVE = 'remove'#
SEARCH = 'search'#
UPDATE = 'update'#
RUN = 'run'#
run_command(command, prefix, *arguments, **kwargs) tuple[str, str, int]#
make_temp_env(*packages, **kwargs) Iterator[str]#
make_temp_package_cache() Iterator[str]#
make_temp_channel(packages) Iterator[str]#
create_temp_location() str#
tempdir() Iterator[str]#
reload_config(prefix) None#
package_is_installed(prefix: str | os.PathLike | pathlib.Path, spec: str | conda.models.match_spec.MatchSpec) conda.models.records.PrefixRecord | None#
get_shortcut_dir(prefix_for_unix=sys.prefix)#