integration#

这些助手函数最初定义在 tests/test_create.py 中,但在这里被重构,以便下游项目也能从中受益。

#

函数#

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, ...])

当您创建的环境将用于在 Windows 上安装 Python 2.7 时

FORCE_temp_prefix([name, use_restricted_unicode])

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

make_temp_env(→ collections.abc.Iterator[str])

make_temp_package_cache(→ collections.abc.Iterator[str])

make_temp_channel(→ collections.abc.Iterator[str])

create_temp_location(→ str)

tempdir(→ collections.abc.Iterator[str])

reload_config(→ None)

package_is_installed(...)

get_shortcut_dir([prefix_for_unix])

属性#

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)#

当您创建的环境将用于仅在 Windows 上安装 Python 2.7 时,只有有限数量的 Unicode 字符可以使用,并且可能只有当前代码页中的字符,因此 UNICODE_CHARACTERS_RESTRICTED 中的字符可能应该从中随机生成。 这里的问题是当前代码页需要能够处理“sys.prefix”,否则 ntpath 将会崩溃。

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) collections.abc.Iterator[str]#
make_temp_package_cache() collections.abc.Iterator[str]#
make_temp_channel(packages) collections.abc.Iterator[str]#
create_temp_location() str#
tempdir() collections.abc.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)#