HEX
Server: LiteSpeed
System: Linux server161.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: imagzxcb (1058)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/imagzxcb/public_html/db127a/create.zip
PK鼷\~�W< < 
creator.pynu�[���import json
import logging
import os
import sys
from abc import ABCMeta, abstractmethod
from argparse import ArgumentTypeError
from ast import literal_eval
from collections import OrderedDict
from pathlib import Path

from virtualenv.discovery.cached_py_info import LogCmd
from virtualenv.util.path import safe_delete
from virtualenv.util.subprocess import run_cmd
from virtualenv.version import __version__

from .pyenv_cfg import PyEnvCfg

HERE = Path(os.path.abspath(__file__)).parent
DEBUG_SCRIPT = HERE / "debug.py"


class CreatorMeta:
    def __init__(self):
        self.error = None


class Creator(metaclass=ABCMeta):
    """A class that given a python Interpreter creates a virtual environment"""

    def __init__(self, options, interpreter):
        """Construct a new virtual environment creator.

        :param options: the CLI option as parsed from :meth:`add_parser_arguments`
        :param interpreter: the interpreter to create virtual environment from
        """
        self.interpreter = interpreter
        self._debug = None
        self.dest = Path(options.dest)
        self.clear = options.clear
        self.no_vcs_ignore = options.no_vcs_ignore
        self.pyenv_cfg = PyEnvCfg.from_folder(self.dest)
        self.app_data = options.app_data
        self.env = options.env

    def __repr__(self):
        return f"{self.__class__.__name__}({', '.join(f'{k}={v}' for k, v in self._args())})"

    def _args(self):
        return [
            ("dest", str(self.dest)),
            ("clear", self.clear),
            ("no_vcs_ignore", self.no_vcs_ignore),
        ]

    @classmethod
    def can_create(cls, interpreter):  # noqa: U100
        """Determine if we can create a virtual environment.

        :param interpreter: the interpreter in question
        :return: ``None`` if we can't create, any other object otherwise that will be forwarded to \
                  :meth:`add_parser_arguments`
        """
        return True

    @classmethod
    def add_parser_arguments(cls, parser, interpreter, meta, app_data):  # noqa: U100
        """Add CLI arguments for the creator.

        :param parser: the CLI parser
        :param app_data: the application data folder
        :param interpreter: the interpreter we're asked to create virtual environment for
        :param meta: value as returned by :meth:`can_create`
        """
        parser.add_argument(
            "dest",
            help="directory to create virtualenv at",
            type=cls.validate_dest,
        )
        parser.add_argument(
            "--clear",
            dest="clear",
            action="store_true",
            help="remove the destination directory if exist before starting (will overwrite files otherwise)",
            default=False,
        )
        parser.add_argument(
            "--no-vcs-ignore",
            dest="no_vcs_ignore",
            action="store_true",
            help="don't create VCS ignore directive in the destination directory",
            default=False,
        )

    @abstractmethod
    def create(self):
        """Perform the virtual environment creation."""
        raise NotImplementedError

    @classmethod
    def validate_dest(cls, raw_value):
        """No path separator in the path, valid chars and must be write-able"""

        def non_write_able(dest, value):
            common = Path(*os.path.commonprefix([value.parts, dest.parts]))
            raise ArgumentTypeError(f"the destination {dest.relative_to(common)} is not write-able at {common}")

        # the file system must be able to encode
        # note in newer CPython this is always utf-8 https://www.python.org/dev/peps/pep-0529/
        encoding = sys.getfilesystemencoding()
        refused = OrderedDict()
        kwargs = {"errors": "ignore"} if encoding != "mbcs" else {}
        for char in str(raw_value):
            try:
                trip = char.encode(encoding, **kwargs).decode(encoding)
                if trip == char:
                    continue
                raise ValueError(trip)
            except ValueError:
                refused[char] = None
        if refused:
            bad = "".join(refused.keys())
            msg = f"the file system codec ({encoding}) cannot handle characters {bad!r} within {raw_value!r}"
            raise ArgumentTypeError(msg)
        if os.pathsep in raw_value:
            msg = f"destination {raw_value!r} must not contain the path separator ({os.pathsep})"
            raise ArgumentTypeError(f"{msg} as this would break the activation scripts")

        value = Path(raw_value)
        if value.exists() and value.is_file():
            raise ArgumentTypeError(f"the destination {value} already exists and is a file")
        dest = Path(os.path.abspath(str(value))).resolve()  # on Windows absolute does not imply resolve so use both
        value = dest
        while dest:
            if dest.exists():
                if os.access(str(dest), os.W_OK):
                    break
                else:
                    non_write_able(dest, value)
            base, _ = dest.parent, dest.name
            if base == dest:
                non_write_able(dest, value)  # pragma: no cover
            dest = base
        return str(value)

    def run(self):
        if self.dest.exists() and self.clear:
            logging.debug("delete %s", self.dest)
            safe_delete(self.dest)
        self.create()
        self.set_pyenv_cfg()
        if not self.no_vcs_ignore:
            self.setup_ignore_vcs()

    def set_pyenv_cfg(self):
        self.pyenv_cfg.content = OrderedDict()
        self.pyenv_cfg["home"] = os.path.dirname(os.path.abspath(self.interpreter.system_executable))
        self.pyenv_cfg["implementation"] = self.interpreter.implementation
        self.pyenv_cfg["version_info"] = ".".join(str(i) for i in self.interpreter.version_info)
        self.pyenv_cfg["virtualenv"] = __version__

    def setup_ignore_vcs(self):
        """Generate ignore instructions for version control systems."""
        # mark this folder to be ignored by VCS, handle https://www.python.org/dev/peps/pep-0610/#registered-vcs
        git_ignore = self.dest / ".gitignore"
        if not git_ignore.exists():
            git_ignore.write_text("# created by virtualenv automatically\n*\n", encoding="utf-8")
        # Mercurial - does not support the .hgignore file inside a subdirectory directly, but only if included via the
        # subinclude directive from root, at which point on might as well ignore the directory itself, see
        # https://www.selenic.com/mercurial/hgignore.5.html for more details
        # Bazaar - does not support ignore files in sub-directories, only at root level via .bzrignore
        # Subversion - does not support ignore files, requires direct manipulation with the svn tool

    @property
    def debug(self):
        """
        :return: debug information about the virtual environment (only valid after :meth:`create` has run)
        """
        if self._debug is None and self.exe is not None:
            self._debug = get_env_debug_info(self.exe, self.debug_script(), self.app_data, self.env)
        return self._debug

    @staticmethod
    def debug_script():
        return DEBUG_SCRIPT


def get_env_debug_info(env_exe, debug_script, app_data, env):
    env = env.copy()
    env.pop("PYTHONPATH", None)

    with app_data.ensure_extracted(debug_script) as debug_script:
        cmd = [str(env_exe), str(debug_script)]
        logging.debug("debug via %r", LogCmd(cmd))
        code, out, err = run_cmd(cmd)

    try:
        if code != 0:
            if out:
                result = literal_eval(out)
            else:
                if code == 2 and "file" in err:
                    # Re-raise FileNotFoundError from `run_cmd()`
                    raise OSError(err)
                raise Exception(err)
        else:
            result = json.loads(out)
        if err:
            result["err"] = err
    except Exception as exception:
        return {"out": out, "err": err, "returncode": code, "exception": repr(exception)}
    if "sys" in result and "path" in result["sys"]:
        del result["sys"]["path"][0]
    return result


__all__ = [
    "Creator",
    "CreatorMeta",
]
PK鼷\����[[via_global_ref/_virtualenv.pynu�[���"""Patches that are applied at runtime to the virtual environment"""
# -*- coding: utf-8 -*-

import os
import sys

VIRTUALENV_PATCH_FILE = os.path.join(__file__)


def patch_dist(dist):
    """
    Distutils allows user to configure some arguments via a configuration file:
    https://docs.python.org/3/install/index.html#distutils-configuration-files

    Some of this arguments though don't make sense in context of the virtual environment files, let's fix them up.
    """
    # we cannot allow some install config as that would get packages installed outside of the virtual environment
    old_parse_config_files = dist.Distribution.parse_config_files

    def parse_config_files(self, *args, **kwargs):
        result = old_parse_config_files(self, *args, **kwargs)
        install = self.get_option_dict("install")

        if "prefix" in install:  # the prefix governs where to install the libraries
            install["prefix"] = VIRTUALENV_PATCH_FILE, os.path.abspath(sys.prefix)
        for base in ("purelib", "platlib", "headers", "scripts", "data"):
            key = "install_{}".format(base)
            if key in install:  # do not allow global configs to hijack venv paths
                install.pop(key, None)
        return result

    dist.Distribution.parse_config_files = parse_config_files


# Import hook that patches some modules to ignore configuration values that break package installation in case
# of virtual environments.
_DISTUTILS_PATCH = "distutils.dist", "setuptools.dist"
if sys.version_info > (3, 4):
    # https://docs.python.org/3/library/importlib.html#setting-up-an-importer

    class _Finder:
        """A meta path finder that allows patching the imported distutils modules"""

        fullname = None

        # lock[0] is threading.Lock(), but initialized lazily to avoid importing threading very early at startup,
        # because there are gevent-based applications that need to be first to import threading by themselves.
        # See https://github.com/pypa/virtualenv/issues/1895 for details.
        lock = []

        def find_spec(self, fullname, path, target=None):  # noqa: U100
            if fullname in _DISTUTILS_PATCH and self.fullname is None:
                # initialize lock[0] lazily
                if len(self.lock) == 0:
                    import threading

                    lock = threading.Lock()
                    # there is possibility that two threads T1 and T2 are simultaneously running into find_spec,
                    # observing .lock as empty, and further going into hereby initialization. However due to the GIL,
                    # list.append() operation is atomic and this way only one of the threads will "win" to put the lock
                    # - that every thread will use - into .lock[0].
                    # https://docs.python.org/3/faq/library.html#what-kinds-of-global-value-mutation-are-thread-safe
                    self.lock.append(lock)

                from functools import partial
                from importlib.util import find_spec

                with self.lock[0]:
                    self.fullname = fullname
                    try:
                        spec = find_spec(fullname, path)
                        if spec is not None:
                            # https://www.python.org/dev/peps/pep-0451/#how-loading-will-work
                            is_new_api = hasattr(spec.loader, "exec_module")
                            func_name = "exec_module" if is_new_api else "load_module"
                            old = getattr(spec.loader, func_name)
                            func = self.exec_module if is_new_api else self.load_module
                            if old is not func:
                                try:
                                    setattr(spec.loader, func_name, partial(func, old))
                                except AttributeError:
                                    pass  # C-Extension loaders are r/o such as zipimporter with <python 3.7
                            return spec
                    finally:
                        self.fullname = None

        @staticmethod
        def exec_module(old, module):
            old(module)
            if module.__name__ in _DISTUTILS_PATCH:
                patch_dist(module)

        @staticmethod
        def load_module(old, name):
            module = old(name)
            if module.__name__ in _DISTUTILS_PATCH:
                patch_dist(module)
            return module

    sys.meta_path.insert(0, _Finder())
elif sys.version_info < (3, 3):
    # https://www.python.org/dev/peps/pep-0302/
    from imp import find_module
    from pkgutil import ImpImporter, ImpLoader

    class _VirtualenvImporter(object, ImpImporter):
        def __init__(self, path=None):
            object.__init__(self)
            ImpImporter.__init__(self, path)

        def find_module(self, fullname, path=None):
            if fullname in _DISTUTILS_PATCH:
                try:
                    return _VirtualenvLoader(fullname, *find_module(fullname.split(".")[-1], path))
                except ImportError:
                    pass
            return None

    class _VirtualenvLoader(object, ImpLoader):
        def __init__(self, fullname, file, filename, etc):
            object.__init__(self)
            ImpLoader.__init__(self, fullname, file, filename, etc)

        def load_module(self, fullname):
            module = super(_VirtualenvLoader, self).load_module(fullname)
            patch_dist(module)
            module.__loader__ = None  # distlib fallback
            return module

    sys.meta_path.append(_VirtualenvImporter())
else:
    # https://www.python.org/dev/peps/pep-0302/
    from imp import find_module
    from pkgutil import ImpImporter, ImpLoader

    class _VirtualenvImporter(ImpImporter):
        def __init__(self, path=None):
            object.__init__(self)
            ImpImporter.__init__(self, path)

        def find_module(self, fullname, path=None):
            if fullname in _DISTUTILS_PATCH:
                try:
                    return _VirtualenvLoader(fullname, *find_module(fullname.split(".")[-1], path))
                except ImportError:
                    pass
            return None

    class _VirtualenvLoader(ImpLoader):
        def __init__(self, fullname, file, filename, etc):
            object.__init__(self)
            ImpLoader.__init__(self, fullname, file, filename, etc)

        def load_module(self, fullname):
            module = super(_VirtualenvLoader, self).load_module(fullname)
            patch_dist(module)
            module.__loader__ = None  # distlib fallback
            return module

    sys.meta_path.append(_VirtualenvImporter())
PK鼷\XC�ffvia_global_ref/store.pynu�[���from pathlib import Path


def handle_store_python(meta, interpreter):
    if is_store_python(interpreter):
        meta.symlink_error = "Windows Store Python does not support virtual environments via symlink"
    return meta


def is_store_python(interpreter):
    parts = Path(interpreter.system_executable).parts
    return (
        len(parts) > 4
        and parts[-4] == "Microsoft"
        and parts[-3] == "WindowsApps"
        and parts[-2].startswith("PythonSoftwareFoundation.Python.3.")
        and parts[-1].startswith("python")
    )


__all__ = [
    "handle_store_python",
    "is_store_python",
]
PK鼷\k4��TTvia_global_ref/api.pynu�[���import logging
import os
from abc import ABCMeta
from pathlib import Path

from virtualenv.info import fs_supports_symlink

from ..creator import Creator, CreatorMeta


class ViaGlobalRefMeta(CreatorMeta):
    def __init__(self):
        super().__init__()
        self.copy_error = None
        self.symlink_error = None
        if not fs_supports_symlink():
            self.symlink_error = "the filesystem does not supports symlink"

    @property
    def can_copy(self):
        return not self.copy_error

    @property
    def can_symlink(self):
        return not self.symlink_error


class ViaGlobalRefApi(Creator, metaclass=ABCMeta):
    def __init__(self, options, interpreter):
        super().__init__(options, interpreter)
        self.symlinks = self._should_symlink(options)
        self.enable_system_site_package = options.system_site

    @staticmethod
    def _should_symlink(options):
        # Priority of where the option is set to follow the order: CLI, env var, file, hardcoded.
        # If both set at same level prefers copy over symlink.
        copies, symlinks = getattr(options, "copies", False), getattr(options, "symlinks", False)
        copy_src, sym_src = options.get_source("copies"), options.get_source("symlinks")
        for level in ["cli", "env var", "file", "default"]:
            s_opt = symlinks if sym_src == level else None
            c_opt = copies if copy_src == level else None
            if s_opt is True and c_opt is True:
                return False
            if s_opt is True:
                return True
            if c_opt is True:
                return False
        return False  # fallback to copy

    @classmethod
    def add_parser_arguments(cls, parser, interpreter, meta, app_data):
        super().add_parser_arguments(parser, interpreter, meta, app_data)
        parser.add_argument(
            "--system-site-packages",
            default=False,
            action="store_true",
            dest="system_site",
            help="give the virtual environment access to the system site-packages dir",
        )
        group = parser.add_mutually_exclusive_group()
        if not meta.can_symlink and not meta.can_copy:
            raise RuntimeError("neither symlink or copy method supported")
        if meta.can_symlink:
            group.add_argument(
                "--symlinks",
                default=True,
                action="store_true",
                dest="symlinks",
                help="try to use symlinks rather than copies, when symlinks are not the default for the platform",
            )
        if meta.can_copy:
            group.add_argument(
                "--copies",
                "--always-copy",
                default=not meta.can_symlink,
                action="store_true",
                dest="copies",
                help="try to use copies rather than symlinks, even when symlinks are the default for the platform",
            )

    def create(self):
        self.install_patch()

    def install_patch(self):
        text = self.env_patch_text()
        if text:
            pth = self.purelib / "_virtualenv.pth"
            logging.debug("create virtualenv import hook file %s", pth)
            pth.write_text("import _virtualenv", encoding="utf-8")
            dest_path = self.purelib / "_virtualenv.py"
            logging.debug("create %s", dest_path)
            dest_path.write_text(text, encoding="utf-8")

    def env_patch_text(self):
        """Patch the distutils package to not be derailed by its configuration files"""
        with self.app_data.ensure_extracted(Path(__file__).parent / "_virtualenv.py") as resolved_path:
            text = resolved_path.read_text(encoding="utf-8")
            return text.replace('"__SCRIPT_DIR__"', repr(os.path.relpath(str(self.script_dir), str(self.purelib))))

    def _args(self):
        return super()._args() + [("global", self.enable_system_site_package)]

    def set_pyenv_cfg(self):
        super().set_pyenv_cfg()
        self.pyenv_cfg["include-system-site-packages"] = "true" if self.enable_system_site_package else "false"


__all__ = [
    "ViaGlobalRefMeta",
    "ViaGlobalRefApi",
]
PK鼷\V����&via_global_ref/builtin/python2/site.pynu�[���# -*- coding: utf-8 -*-
"""
A simple shim module to fix up things on Python 2 only.

Note: until we setup correctly the paths we can only import built-ins.
"""
import sys


def main():
    """Patch what needed, and invoke the original site.py"""
    here = __file__  # the distutils.install patterns will be injected relative to this site.py, save it here
    config = read_pyvenv()
    sys.real_prefix = sys.base_prefix = config["base-prefix"]
    sys.base_exec_prefix = config["base-exec-prefix"]
    sys.base_executable = config["base-executable"]
    global_site_package_enabled = config.get("include-system-site-packages", False) == "true"
    rewrite_standard_library_sys_path()
    disable_user_site_package()
    load_host_site(here)
    if global_site_package_enabled:
        add_global_site_package()
    rewrite_getsitepackages(here)


def load_host_site(here):
    """trigger reload of site.py - now it will use the standard library instance that will take care of init"""
    # we have a duality here, we generate the platform and pure library path based on what distutils.install specifies
    # because this is what pip will be using; the host site.py though may contain it's own pattern for where the
    # platform and pure library paths should exist

    # notably on Ubuntu there's a patch for getsitepackages to point to
    # - prefix + local/lib/pythonx.y/dist-packages
    # - prefix + lib/pythonx.y/dist-packages
    # while distutils.install.cmd still points both of these to
    # - prefix + lib/python2.7/site-packages

    # to facilitate when the two match, or not we first reload the site.py, now triggering the import of host site.py,
    # as this will ensure that initialization code within host site.py runs

    # ___RELOAD_CODE___

    # and then if the distutils site packages are not on the sys.path we add them via add_site_dir; note we must add
    # them by invoking add_site_dir to trigger the processing of pth files

    add_site_dir = sys.modules["site"].addsitedir
    for path in get_site_packages_dirs(here):
        add_site_dir(path)


def get_site_packages_dirs(here):
    import json
    import os

    site_packages = r"""
    ___EXPECTED_SITE_PACKAGES___
    """

    for path in json.loads(site_packages):
        yield os.path.abspath(os.path.join(here, path.encode("utf-8")))


sep = "\\" if sys.platform == "win32" else "/"  # no os module here yet - poor mans version


def read_pyvenv():
    """read pyvenv.cfg"""
    config_file = "{}{}pyvenv.cfg".format(sys.prefix, sep)
    with open(config_file) as file_handler:
        lines = file_handler.readlines()
    config = {}
    for line in lines:
        try:
            split_at = line.index("=")
        except ValueError:
            continue  # ignore bad/empty lines
        else:
            config[line[:split_at].strip()] = line[split_at + 1 :].strip()
    return config


def rewrite_standard_library_sys_path():
    """Once this site file is loaded the standard library paths have already been set, fix them up"""
    exe, prefix, exec_prefix = get_exe_prefixes(base=False)
    base_exe, base_prefix, base_exec = get_exe_prefixes(base=True)
    exe_dir = exe[: exe.rfind(sep)]
    for at, path in enumerate(sys.path):
        path = abs_path(path)  # replace old sys prefix path starts with new
        skip_rewrite = path == exe_dir  # don't fix the current executable location, notably on Windows this gets added
        skip_rewrite = skip_rewrite  # ___SKIP_REWRITE____
        if not skip_rewrite:
            sys.path[at] = map_path(path, base_exe, exe_dir, exec_prefix, base_prefix, prefix, base_exec)

    # the rewrite above may have changed elements from PYTHONPATH, revert these if on
    if sys.flags.ignore_environment:
        return
    import os

    python_paths = []
    if "PYTHONPATH" in os.environ and os.environ["PYTHONPATH"]:
        for path in os.environ["PYTHONPATH"].split(os.pathsep):
            if path not in python_paths:
                python_paths.append(path)
    sys.path[: len(python_paths)] = python_paths


def get_exe_prefixes(base=False):
    return tuple(abs_path(getattr(sys, ("base_" if base else "") + i)) for i in ("executable", "prefix", "exec_prefix"))


def abs_path(value):
    values, keep = value.split(sep), []
    at = len(values) - 1
    while at >= 0:
        if values[at] == "..":
            at -= 1
        else:
            keep.append(values[at])
        at -= 1
    return sep.join(keep[::-1])


def map_path(path, base_executable, exe_dir, exec_prefix, base_prefix, prefix, base_exec_prefix):
    if path_starts_with(path, exe_dir):
        # content inside the exe folder needs to remap to original executables folder
        orig_exe_folder = base_executable[: base_executable.rfind(sep)]
        return "{}{}".format(orig_exe_folder, path[len(exe_dir) :])
    elif path_starts_with(path, prefix):
        return "{}{}".format(base_prefix, path[len(prefix) :])
    elif path_starts_with(path, exec_prefix):
        return "{}{}".format(base_exec_prefix, path[len(exec_prefix) :])
    return path


def path_starts_with(directory, value):
    return directory.startswith(value if value[-1] == sep else value + sep)


def disable_user_site_package():
    """Flip the switch on enable user site package"""
    # sys.flags is a c-extension type, so we cannot monkeypatch it, replace it with a python class to flip it
    sys.original_flags = sys.flags

    class Flags(object):
        def __init__(self):
            self.__dict__ = {key: getattr(sys.flags, key) for key in dir(sys.flags) if not key.startswith("_")}

    sys.flags = Flags()
    sys.flags.no_user_site = 1


def add_global_site_package():
    """add the global site package"""
    import site

    # add user site package
    sys.flags = sys.original_flags  # restore original
    site.ENABLE_USER_SITE = None  # reset user site check
    # add the global site package to the path - use new prefix and delegate to site.py
    orig_prefixes = None
    try:
        orig_prefixes = site.PREFIXES
        site.PREFIXES = [sys.base_prefix, sys.base_exec_prefix]
        site.main()
    finally:
        site.PREFIXES = orig_prefixes + site.PREFIXES


# Debian and it's derivatives patch this function. We undo the damage
def rewrite_getsitepackages(here):
    site = sys.modules["site"]

    site_package_dirs = get_site_packages_dirs(here)
    orig_getsitepackages = site.getsitepackages

    def getsitepackages():
        sitepackages = orig_getsitepackages()
        if sys.prefix not in site.PREFIXES or sys.exec_prefix not in site.PREFIXES:
            # Someone messed with the prefixes, so we stop patching
            return sitepackages
        for path in site_package_dirs:
            if path not in sitepackages:
                sitepackages.insert(0, path)

        return sitepackages

    site.getsitepackages = getsitepackages


main()
PK鼷\[�C.��)via_global_ref/builtin/python2/python2.pynu�[���import abc
import json
import os
from pathlib import Path

from virtualenv.create.describe import Python2Supports
from virtualenv.create.via_global_ref.builtin.ref import PathRefToDest
from virtualenv.info import IS_ZIPAPP
from virtualenv.util.zipapp import read as read_from_zipapp

from ..via_global_self_do import ViaGlobalRefVirtualenvBuiltin

HERE = Path(os.path.abspath(__file__)).parent


class Python2(ViaGlobalRefVirtualenvBuiltin, Python2Supports, metaclass=abc.ABCMeta):
    def create(self):
        """Perform operations needed to make the created environment work on Python 2"""
        super().create()
        # install a patched site-package, the default Python 2 site.py is not smart enough to understand pyvenv.cfg,
        # so we inject a small shim that can do this, the location of this depends where it's on host
        sys_std_plat = Path(self.interpreter.system_stdlib_platform)
        site_py_in = (
            self.stdlib_platform
            if ((sys_std_plat / "site.py").exists() or (sys_std_plat / "site.pyc").exists())
            else self.stdlib
        )
        site_py = site_py_in / "site.py"

        custom_site = get_custom_site()
        if IS_ZIPAPP:
            custom_site_text = read_from_zipapp(custom_site)
        else:
            custom_site_text = custom_site.read_text(encoding="utf-8")
        expected = json.dumps([os.path.relpath(str(i), str(site_py)) for i in self.libs])

        custom_site_text = custom_site_text.replace("___EXPECTED_SITE_PACKAGES___", expected)

        reload_code = os.linesep.join(f"    {i}" for i in self.reload_code.splitlines()).lstrip()
        custom_site_text = custom_site_text.replace("# ___RELOAD_CODE___", reload_code)

        skip_rewrite = os.linesep.join(f"            {i}" for i in self.skip_rewrite.splitlines()).lstrip()
        custom_site_text = custom_site_text.replace("# ___SKIP_REWRITE____", skip_rewrite)

        site_py.write_text(custom_site_text, encoding="utf-8")

    @property
    def reload_code(self):
        return 'reload(sys.modules["site"])  # noqa # call system site.py to setup import libraries'

    @property
    def skip_rewrite(self):
        return ""

    @classmethod
    def sources(cls, interpreter):
        yield from super().sources(interpreter)
        # install files needed to run site.py, either from stdlib or stdlib_platform, at least pyc, but both if exists
        # if neither exists return the module file to trigger failure
        mappings, needs_py_module = (
            cls.mappings(interpreter),
            cls.needs_stdlib_py_module(),
        )
        for req in cls.modules():
            module_file, to_module, module_exists = cls.from_stdlib(mappings, f"{req}.py")
            compiled_file, to_compiled, compiled_exists = cls.from_stdlib(mappings, f"{req}.pyc")
            if needs_py_module or module_exists or not compiled_exists:
                yield PathRefToDest(module_file, dest=to_module)
            if compiled_exists:
                yield PathRefToDest(compiled_file, dest=to_compiled)

    @staticmethod
    def from_stdlib(mappings, name):
        for from_std, to_std in mappings:
            src = from_std / name
            if src.exists():
                return src, to_std, True
        # if not exists, fallback to first in list
        return mappings[0][0] / name, mappings[0][1], False

    @classmethod
    def mappings(cls, interpreter):
        mappings = [(Path(interpreter.system_stdlib_platform), cls.to_stdlib_platform)]
        if interpreter.system_stdlib_platform != interpreter.system_stdlib:
            mappings.append((Path(interpreter.system_stdlib), cls.to_stdlib))
        return mappings

    def to_stdlib(self, src):
        return self.stdlib / src.name

    def to_stdlib_platform(self, src):
        return self.stdlib_platform / src.name

    @classmethod
    def needs_stdlib_py_module(cls):
        raise NotImplementedError

    @classmethod
    def modules(cls):
        return []


def get_custom_site():
    return HERE / "site.py"
PK鼷\bf�~I'I'?via_global_ref/builtin/python2/__pycache__/site.cpython-311.pycnu�[����

�|oi����dZddlZd�Zd�Zd�ZejdkrdndZd	�Zd
�Zdd�Z	d
�Z
d�Zd�Zd�Z
d�Zd�Ze��dS)z�
A simple shim module to fix up things on Python 2 only.

Note: until we setup correctly the paths we can only import built-ins.
�Nc�|�t}t��}|dxt_t_|dt_|dt_|�dd��dk}t��t��t|��|rt��t|��dS)z2Patch what needed, and invoke the original site.pyzbase-prefixzbase-exec-prefixzbase-executablezinclude-system-site-packagesF�trueN)
�__file__�read_pyvenv�sys�real_prefix�base_prefix�base_exec_prefix�base_executable�get�!rewrite_standard_library_sys_path�disable_user_site_package�load_host_site�add_global_site_package�rewrite_getsitepackages)�here�config�global_site_package_enableds   ��/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/builtin/python2/site.py�mainr
s����D�
�]�]�F�(.�}�(=�=�C�O�c�o�!�"4�5�C�� �!2�3�C��"(�*�*�-K�U�"S�"S�W]�"]��%�'�'�'������4����"�"��!�!�!��D�!�!�!�!�!�c�n�tjdj}t|��D]
}||���dS)zetrigger reload of site.py - now it will use the standard library instance that will take care of init�siteN)r�modules�
addsitedir�get_site_packages_dirs)r�add_site_dir�paths   rrrsG��(�;�v�&�1�L�&�t�,�,������T������rc	#��K�ddl}ddl}d}|�|��D]J}|j�|j�||�d������V��KdS)Nrz&
    ___EXPECTED_SITE_PACKAGES___
    zutf-8)�json�os�loadsr�abspath�join�encode)rr r!�
site_packagesrs     rrr3s������K�K�K�
�I�I�I��M��
�
�=�)�)�H�H���g�o�o�b�g�l�l�4����W�1E�1E�F�F�G�G�G�G�G�G�H�Hr�win32�\�/c��d�tjt��}t	|��5}|���}ddd��n#1swxYwYi}|D]d}	|�d��}||dzd����||d|����<�U#t$rY�awxYw|S)zread pyvenv.cfgz{}{}pyvenv.cfgN�=�)	�formatr�prefix�sep�open�	readlines�index�strip�
ValueError)�config_file�file_handler�linesr�line�split_ats      rrrBs��"�)�)�#�*�c�:�:�K�	
�k�	�	�)�l��&�&�(�(��)�)�)�)�)�)�)�)�)�)�)����)�)�)�)�
�F��K�K��	K��z�z�#���H�/3�8�a�<�>�>�.B�.H�.H�.J�.J�F�4�	��	�?�(�(�*�*�+�+���	�	�	��H�	�����Ms#�A�A�A�(B:�:
C�Cc
�j�td���\}}}td���\}}}|d|�t���}ttj��D]@\}}t
|��}||k}	|	}	|	s"t|||||||��tj|<�Atjj	rdSddl
}
g}d|
jvrN|
jdrA|
jd�|
j
��D]}||vr|�|���|tjdt|���<dS)z[Once this site file is loaded the standard library paths have already been set, fix them upF��baseTNr�
PYTHONPATH)�get_exe_prefixes�rfindr/�	enumeraterr�abs_path�map_path�flags�ignore_environmentr!�environ�split�pathsep�append�len)�exer.�exec_prefix�base_exer	�	base_exec�exe_dir�atr�skip_rewriter!�python_pathss            rr
r
RsN��/�U�;�;�;��C���'7�T�'B�'B�'B�$�H�k�9��"�C�I�I�c�N�N�"�#�G��c�h�'�'�j�j���D���~�~���w���#���	j�#�D�(�G�[�+�W]�_h�i�i�C�H�R�L���y�#����
�I�I�I��L��r�z�!�!�b�j��&>�!��J�|�,�2�2�2�:�>�>�	*�	*�D��<�'�'��#�#�D�)�)�)��$0�C�H�
 �s�<� � �
 �!�!�!rFc�:��t�fd�dD����S)Nc3�j�K�|]-}ttt�rdnd|z����V��.dS)�base_�N)rA�getattrr)�.0�ir<s  �r�	<genexpr>z#get_exe_prefixes.<locals>.<genexpr>lsC�����x�x�1��'�#�4�(?���R�1�'D�E�E�F�F�x�x�x�x�x�xr)�
executabler.rK)�tupler;s`rr>r>ks'����x�x�x�x�Pw�x�x�x�x�x�xrc� �|�t��g}}t|��dz
}|dkr8||dkr|dz}n|�||��|dz}|dk�8t�|ddd���S)Nr,rz..���)rFr/rIrHr$)�value�values�keeprOs    rrArAos����;�;�s�#�#�R�D�F�	�V���q��B�
��'�'��"�:�����!�G�B�B��K�K��r�
�#�#�#�
�a���
��'�'��8�8�D���2��J���rc��t||��rM|d|�t���}d�||t	|��d���St||��r+d�||t	|��d���St||��r+d�||t	|��d���S|S)Nz{}{})�path_starts_withr?r/r-rI)rrrNrKr	r.r
�orig_exe_folders        rrBrB{s�����g�&�&�I�)�*F�O�,A�,A�#�,F�,F�*F�G���}�}�_�d�3�w�<�<�>�>�.B�C�C�C�	�$��	'�	'�I��}�}�[�$�s�6�{�{�}�}�*=�>�>�>�	�$��	,�	,�I��}�}�-�t�C��4D�4D�4F�4F�/G�H�H�H��Krc�b�|�|dtkr|n	|tz��S)Nr])�
startswithr/)�	directoryr^s  rrbrb�s,������r��c�)9�)9���u�s�{�K�K�Krc��tjt_Gd�dt��}|��t_dtj_dS)z+Flip the switch on enable user site packagec��eZdZd�ZdS)�(disable_user_site_package.<locals>.Flagsc�V�d�ttj��D��|_dS)Nc�n�i|]2}|�d���|ttj|����3S)�_)rerVrrC)rW�keys  r�
<dictcomp>zEdisable_user_site_package.<locals>.Flags.__init__.<locals>.<dictcomp>�s;��o�o�o�c�[^�[i�[i�jm�[n�[n�o�S�'�#�)�S�"9�"9�o�o�or)�dirrrC�__dict__)�selfs r�__init__z1disable_user_site_package.<locals>.Flags.__init__�s#��o�o�S���^�^�o�o�o�D�M�M�MrN)�__name__�
__module__�__qualname__rr�rr�Flagsri�s(������	p�	p�	p�	p�	prrwr,N)rrC�original_flags�object�no_user_site)rws rrr�s_����C��p�p�p�p�p��p�p�p�����C�I��C�I���rc��ddl}tjt_d|_d}	|j}tjtjg|_|���||jz|_dS#||jz|_wxYw)zadd the global site packagerN)	rrrxrC�ENABLE_USER_SITE�PREFIXESr	r
r)r�
orig_prefixess  rrr�sz���K�K�K��"�C�I� �D���M�6��
�
���#�*>�?��
��	�	����%��
�5��
�
�
��
��
�5��
�5�5�5�5s�8A.�.A?c�x����tjd�t|����j����fd�}|�_dS)Nrc������}tj�jvstj�jvr|S�D]}||vr|�d|���|S)Nr)rr.r}rK�insert)�sitepackagesr�orig_getsitepackagesr�site_package_dirss  ���r�getsitepackagesz0rewrite_getsitepackages.<locals>.getsitepackages�sk���+�+�-�-���:�T�]�*�*�c�o�T�]�.R�.R���%�	-�	-�D��<�'�'��#�#�A�t�,�,�,���r)rrrr�)rr�r�rr�s  @@@rrr�s[������;�v��D�.�t�4�4���/��	�	�	�	�	�	�	�+�D���r)F)�__doc__rrrr�platformr/rr
r>rArBrbrrrrvrr�<module>r�s����
�
�
�
�
"�
"�
"� ���2	H�	H�	H��l�g�%�%�d�d�3��
�
�
� 1�1�1�2y�y�y�y�	 �	 �	 �	�	�	�L�L�L�
�
�
�6�6�6�$+�+�+�(������rPK鼷\�Uv��Cvia_global_ref/builtin/python2/__pycache__/__init__.cpython-311.pycnu�[����

�|oi���dS)N�r���/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/builtin/python2/__init__.py�<module>rs���rPK鼷\�$���Bvia_global_ref/builtin/python2/__pycache__/python2.cpython-311.pycnu�[����

�|oi�����ddlZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZ
ddlmZeej�e����jZGd	�d
eeej���Zd�ZdS)
�N)�Path)�Python2Supports)�
PathRefToDest)�	IS_ZIPAPP)�read�)�ViaGlobalRefVirtualenvBuiltinc����eZdZ�fd�Zed���Zed���Ze�fd���Ze	d���Z
ed���Zd�Zd�Z
ed	���Zed
���Z�xZS)�Python2c����t�����t|jj��}|dz���s|dz���r|jn|j}|dz�t��}trt|��}n|�d���}tj
�fd�|jD����}|�d|��}t j�d�|j���D�������}|�d|��}t j�d	�|j���D�������}|�d
|��}��|d���dS)zJPerform operations needed to make the created environment work on Python 2�site.pyzsite.pyczutf-8)�encodingc���g|]<}tj�t|��t�������=S�)�os�path�relpath�str)�.0�i�site_pys  ���/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/builtin/python2/python2.py�
<listcomp>z"Python2.create.<locals>.<listcomp>#s5���X�X�X��r�w���s�1�v�v�s�7�|�|�D�D�X�X�X��___EXPECTED_SITE_PACKAGES___c3� K�|]	}d|��V��
dS)z    Nr�rrs  r�	<genexpr>z!Python2.create.<locals>.<genexpr>'s(����%X�%X�Q�j�Q�j�j�%X�%X�%X�%X�%X�%Xrz# ___RELOAD_CODE___c3� K�|]	}d|��V��
dS)z            Nrrs  rrz!Python2.create.<locals>.<genexpr>*s+����&b�&b�a�'9�a�'9�'9�&b�&b�&b�&b�&b�&brz# ___SKIP_REWRITE____N)�super�creater�interpreter�system_stdlib_platform�exists�stdlib_platform�stdlib�get_custom_siter�read_from_zipapp�	read_text�json�dumps�libs�replacer�linesep�join�reload_code�
splitlines�lstrip�skip_rewrite�
write_text)
�self�sys_std_plat�
site_py_in�custom_site�custom_site_text�expectedr0r3r�	__class__s
        @�rr!zPython2.creates�����
���������D�,�C�D�D���	�)�1�1�3�3�
�8D�z�8Q�7Y�7Y�7[�7[�
�D� � ���	�
�y�(��%�'�'���	G�/��<�<���*�4�4�g�4�F�F���:�X�X�X�X�d�i�X�X�X�Y�Y��+�3�3�4R�T\�]�]���j�o�o�%X�%X�$�:J�:U�:U�:W�:W�%X�%X�%X�X�X�_�_�a�a��+�3�3�4I�;�W�W���z���&b�&b�4�CT�C_�C_�Ca�Ca�&b�&b�&b�b�b�i�i�k�k��+�3�3�4K�\�Z�Z�����+�g��>�>�>�>�>rc��dS)NzSreload(sys.modules["site"])  # noqa # call system site.py to setup import librariesr�r5s rr0zPython2.reload_code/s��d�drc��dS)N�rr=s rr3zPython2.skip_rewrite3s���rrc#��K�t���|��Ed{V��|�|��|���}}|���D]j}|�||�d���\}}}|�||�d���\}}	}
|s|s|
st
||���V�|
rt
||	���V��kdS)Nz.pyz.pyc)�dest)r �sources�mappings�needs_stdlib_py_module�modules�from_stdlibr)�clsr"rC�needs_py_module�req�module_file�	to_module�
module_exists�
compiled_file�to_compiled�compiled_existsr;s           �rrBzPython2.sources7s������7�7�?�?�;�/�/�/�/�/�/�/�/�/�
�L�L��%�%��&�&�(�(�"���;�;�=�=�	E�	E�C�47�O�O�H�QT�k�k�k�4Z�4Z�1�K��M�:=�/�/�(�WZ�T`�T`�T`�:a�:a�7�M�;���
A�-�
A��
A�#�K�i�@�@�@�@�@�@��
E�#�M��D�D�D�D�D�D��
	E�	Erc��|D]%\}}||z}|���r||dfcS�&|dd|z|dddfS)NTr�F)r$)rC�name�from_std�to_std�srcs     rrFzPython2.from_stdlibHsk�� (�	)�	)��H�f��T�/�C��z�z�|�|�
)��F�D�(�(�(�(�
)���{�1�~��$�h�q�k�!�n�e�;�;rc��t|j��|jfg}|j|jkr.|�t|j��|jf��|S�N)rr#�to_stdlib_platform�
system_stdlib�append�	to_stdlib)rGr"rCs   rrCzPython2.mappingsQsW���+�<�=�=�s�?U�V�W���-��1J�J�J��O�O�T�+�";�<�<�c�m�L�M�M�M��rc� �|j|jzSrW)r&rR�r5rUs  rr[zPython2.to_stdlibXs���{�S�X�%�%rc� �|j|jzSrW)r%rRr]s  rrXzPython2.to_stdlib_platform[s���#�c�h�.�.rc��t�rW)�NotImplementedError�rGs rrDzPython2.needs_stdlib_py_module^s��!�!rc��gSrWrras rrEzPython2.modulesbs���	r)�__name__�
__module__�__qualname__r!�propertyr0r3�classmethodrB�staticmethodrFrCr[rXrDrE�
__classcell__)r;s@rrrs%�������?�?�?�?�?�<�e�e��X�e�����X���E�E�E�E��[�E� �<�<��\�<�����[��&�&�&�/�/�/��"�"��[�"�����[�����rr)�	metaclassc��tdzS)Nr
)�HERErrrr'r'gs
���)��r)�abcr*r�pathlibr�virtualenv.create.describer�,virtualenv.create.via_global_ref.builtin.refr�virtualenv.infor�virtualenv.util.zipapprr(�via_global_self_dor	r�abspath�__file__�parentrl�ABCMetarr'rrr�<module>rxs��
�
�
�
�����	�	�	�	�������6�6�6�6�6�6�F�F�F�F�F�F�%�%�%�%�%�%�;�;�;�;�;�;�>�>�>�>�>�>��t�B�G�O�O�H�%�%�&�&�-��T�T�T�T�T�+�_���T�T�T�T�n����rPK鼷\*via_global_ref/builtin/python2/__init__.pynu�[���PK鼷\�!l��via_global_ref/builtin/ref.pynu�[���"""
Virtual environments in the traditional sense are built as reference to the host python. This file allows declarative
references to elements on the file system, allowing our system to automatically detect what modes it can support given
the constraints: e.g. can the file system symlink, can the files be read, executed, etc.
"""

import os
from abc import ABCMeta, abstractmethod
from collections import OrderedDict
from stat import S_IXGRP, S_IXOTH, S_IXUSR

from virtualenv.info import fs_is_case_sensitive, fs_supports_symlink
from virtualenv.util.path import copy, make_exe, symlink


class RefMust:
    NA = "NA"
    COPY = "copy"
    SYMLINK = "symlink"


class RefWhen:
    ANY = "ANY"
    COPY = "copy"
    SYMLINK = "symlink"


class PathRef(metaclass=ABCMeta):
    """Base class that checks if a file reference can be symlink/copied"""

    FS_SUPPORTS_SYMLINK = fs_supports_symlink()
    FS_CASE_SENSITIVE = fs_is_case_sensitive()

    def __init__(self, src, must=RefMust.NA, when=RefWhen.ANY):
        self.must = must
        self.when = when
        self.src = src
        try:
            self.exists = src.exists()
        except OSError:
            self.exists = False
        self._can_read = None if self.exists else False
        self._can_copy = None if self.exists else False
        self._can_symlink = None if self.exists else False

    def __repr__(self):
        return f"{self.__class__.__name__}(src={self.src})"

    @property
    def can_read(self):
        if self._can_read is None:
            if self.src.is_file():
                try:
                    with self.src.open("rb"):
                        self._can_read = True
                except OSError:
                    self._can_read = False
            else:
                self._can_read = os.access(str(self.src), os.R_OK)
        return self._can_read

    @property
    def can_copy(self):
        if self._can_copy is None:
            if self.must == RefMust.SYMLINK:
                self._can_copy = self.can_symlink
            else:
                self._can_copy = self.can_read
        return self._can_copy

    @property
    def can_symlink(self):
        if self._can_symlink is None:
            if self.must == RefMust.COPY:
                self._can_symlink = self.can_copy
            else:
                self._can_symlink = self.FS_SUPPORTS_SYMLINK and self.can_read
        return self._can_symlink

    @abstractmethod
    def run(self, creator, symlinks):
        raise NotImplementedError

    def method(self, symlinks):
        if self.must == RefMust.SYMLINK:
            return symlink
        if self.must == RefMust.COPY:
            return copy
        return symlink if symlinks else copy


class ExePathRef(PathRef, metaclass=ABCMeta):
    """Base class that checks if a executable can be references via symlink/copy"""

    def __init__(self, src, must=RefMust.NA, when=RefWhen.ANY):
        super().__init__(src, must, when)
        self._can_run = None

    @property
    def can_symlink(self):
        if self.FS_SUPPORTS_SYMLINK:
            return self.can_run
        return False

    @property
    def can_run(self):
        if self._can_run is None:
            mode = self.src.stat().st_mode
            for key in [S_IXUSR, S_IXGRP, S_IXOTH]:
                if mode & key:
                    self._can_run = True
                break
            else:
                self._can_run = False
        return self._can_run


class PathRefToDest(PathRef):
    """Link a path on the file system"""

    def __init__(self, src, dest, must=RefMust.NA, when=RefWhen.ANY):
        super().__init__(src, must, when)
        self.dest = dest

    def run(self, creator, symlinks):
        dest = self.dest(creator, self.src)
        method = self.method(symlinks)
        dest_iterable = dest if isinstance(dest, list) else (dest,)
        if not dest.parent.exists():
            dest.parent.mkdir(parents=True, exist_ok=True)
        for dst in dest_iterable:
            method(self.src, dst)


class ExePathRefToDest(PathRefToDest, ExePathRef):
    """Link a exe path on the file system"""

    def __init__(self, src, targets, dest, must=RefMust.NA, when=RefWhen.ANY):
        ExePathRef.__init__(self, src, must, when)
        PathRefToDest.__init__(self, src, dest, must, when)
        if not self.FS_CASE_SENSITIVE:
            targets = list(OrderedDict((i.lower(), None) for i in targets).keys())
        self.base = targets[0]
        self.aliases = targets[1:]
        self.dest = dest

    def run(self, creator, symlinks):
        bin_dir = self.dest(creator, self.src).parent
        dest = bin_dir / self.base
        method = self.method(symlinks)
        method(self.src, dest)
        if not symlinks:
            make_exe(dest)
        for extra in self.aliases:
            link_file = bin_dir / extra
            if link_file.exists():
                link_file.unlink()
            if symlinks:
                link_file.symlink_to(self.base)
            else:
                copy(self.src, link_file)
            if not symlinks:
                make_exe(link_file)

    def __repr__(self):
        return f"{self.__class__.__name__}(src={self.src}, alias={self.aliases})"


__all__ = [
    "ExePathRef",
    "ExePathRefToDest",
    "PathRefToDest",
    "PathRef",
    "RefWhen",
    "RefMust",
]
PK鼷\����%via_global_ref/builtin/builtin_way.pynu�[���from abc import ABCMeta

from virtualenv.create.creator import Creator
from virtualenv.create.describe import Describe


class VirtualenvBuiltin(Creator, Describe, metaclass=ABCMeta):
    """A creator that does operations itself without delegation, if we can create it we can also describe it"""

    def __init__(self, options, interpreter):
        Creator.__init__(self, options, interpreter)
        Describe.__init__(self, self.dest, interpreter)


__all__ = [
    "VirtualenvBuiltin",
]
PK鼷\�p���%via_global_ref/builtin/pypy/common.pynu�[���import abc
from pathlib import Path

from virtualenv.create.via_global_ref.builtin.ref import PathRefToDest, RefMust, RefWhen

from ..via_global_self_do import ViaGlobalRefVirtualenvBuiltin


class PyPy(ViaGlobalRefVirtualenvBuiltin, metaclass=abc.ABCMeta):
    @classmethod
    def can_describe(cls, interpreter):
        return interpreter.implementation == "PyPy" and super().can_describe(interpreter)

    @classmethod
    def _executables(cls, interpreter):
        host = Path(interpreter.system_executable)
        targets = sorted(f"{name}{PyPy.suffix}" for name in cls.exe_names(interpreter))
        must = RefMust.COPY if interpreter.version_info.major == 2 else RefMust.NA
        yield host, targets, must, RefWhen.ANY

    @classmethod
    def executables(cls, interpreter):
        yield from super().sources(interpreter)

    @classmethod
    def exe_names(cls, interpreter):
        return {
            cls.exe_stem(),
            "python",
            f"python{interpreter.version_info.major}",
            f"python{interpreter.version_info.major}.{interpreter.version_info.minor}",
        }

    @classmethod
    def sources(cls, interpreter):
        yield from cls.executables(interpreter)
        for host in cls._add_shared_libs(interpreter):
            yield PathRefToDest(host, dest=lambda self, s: self.bin_dir / s.name)

    @classmethod
    def _add_shared_libs(cls, interpreter):
        # https://bitbucket.org/pypy/pypy/issue/1922/future-proofing-virtualenv
        python_dir = Path(interpreter.system_executable).resolve().parent
        yield from cls._shared_libs(python_dir)

    @classmethod
    def _shared_libs(cls, python_dir):  # noqa: U100
        raise NotImplementedError


__all__ = [
    "PyPy",
]
PK鼷\B�ו	�	$via_global_ref/builtin/pypy/pypy3.pynu�[���import abc
from pathlib import Path

from virtualenv.create.describe import PosixSupports, Python3Supports, WindowsSupports
from virtualenv.create.via_global_ref.builtin.ref import PathRefToDest

from .common import PyPy


class PyPy3(PyPy, Python3Supports, metaclass=abc.ABCMeta):
    @classmethod
    def exe_stem(cls):
        return "pypy3"

    @classmethod
    def exe_names(cls, interpreter):
        return super().exe_names(interpreter) | {"pypy"}


class PyPy3Posix(PyPy3, PosixSupports):
    """PyPy 3 on POSIX"""

    @classmethod
    def _shared_libs(cls, python_dir):
        # glob for libpypy3-c.so, libpypy3-c.dylib, libpypy3.9-c.so ...
        return python_dir.glob("libpypy3*.*")

    def to_lib(self, src):
        return self.dest / "lib" / src.name

    @classmethod
    def sources(cls, interpreter):
        yield from super().sources(interpreter)
        # PyPy >= 3.8 supports a standard prefix installation, where older
        # versions always used a portable/development style installation.
        # If this is a standard prefix installation, skip the below:
        if interpreter.system_prefix == "/usr":
            return
        # Also copy/symlink anything under prefix/lib, which, for "portable"
        # PyPy builds, includes the tk,tcl runtime and a number of shared
        # objects. In distro-specific builds or on conda this should be empty
        # (on PyPy3.8+ it will, like on CPython, hold the stdlib).
        host_lib = Path(interpreter.system_prefix) / "lib"
        stdlib = Path(interpreter.system_stdlib)
        if host_lib.exists() and host_lib.is_dir():
            for path in host_lib.iterdir():
                if stdlib == path:
                    # For PyPy3.8+ the stdlib lives in lib/pypy3.8
                    # We need to avoid creating a symlink to it since that
                    # will defeat the purpose of a virtualenv
                    continue
                yield PathRefToDest(path, dest=cls.to_lib)


class Pypy3Windows(PyPy3, WindowsSupports):
    """PyPy 3 on Windows"""

    @property
    def less_v37(self):
        return self.interpreter.version_info.minor < 7

    @classmethod
    def _shared_libs(cls, python_dir):
        # glob for libpypy*.dll and libffi*.dll
        for pattern in ["libpypy*.dll", "libffi*.dll"]:
            srcs = python_dir.glob(pattern)
            yield from srcs


__all__ = [
    "PyPy3",
    "PyPy3Posix",
    "Pypy3Windows",
]
PK鼷\���
�
$via_global_ref/builtin/pypy/pypy2.pynu�[���import abc
import logging
import os
from pathlib import Path

from virtualenv.create.describe import PosixSupports, WindowsSupports
from virtualenv.create.via_global_ref.builtin.ref import PathRefToDest

from ..python2.python2 import Python2
from .common import PyPy


class PyPy2(PyPy, Python2, metaclass=abc.ABCMeta):
    """PyPy 2"""

    @classmethod
    def exe_stem(cls):
        return "pypy"

    @classmethod
    def sources(cls, interpreter):
        yield from super().sources(interpreter)
        # include folder needed on Python 2 as we don't have pyenv.cfg
        host_include_marker = cls.host_include_marker(interpreter)
        if host_include_marker.exists():
            yield PathRefToDest(host_include_marker.parent, dest=lambda self, _: self.include)  # noqa: U101

    @classmethod
    def needs_stdlib_py_module(cls):
        return True

    @classmethod
    def host_include_marker(cls, interpreter):
        return Path(interpreter.system_include) / "PyPy.h"

    @property
    def include(self):
        return self.dest / self.interpreter.install_path("headers")

    @classmethod
    def modules(cls):
        # pypy2 uses some modules before the site.py loads, so we need to include these too
        return super().modules() + [
            "os",
            "copy_reg",
            "genericpath",
            "linecache",
            "stat",
            "UserDict",
            "warnings",
        ]

    @property
    def lib_pypy(self):
        return self.dest / "lib_pypy"

    def ensure_directories(self):
        dirs = super().ensure_directories()
        dirs.add(self.lib_pypy)
        host_include_marker = self.host_include_marker(self.interpreter)
        if host_include_marker.exists():
            dirs.add(self.include.parent)
        else:
            logging.debug("no include folders as can't find include marker %s", host_include_marker)
        return dirs

    @property
    def skip_rewrite(self):
        """
        PyPy2 built-in imports are handled by this path entry, don't overwrite to not disable it
        see: https://github.com/pypa/virtualenv/issues/1652
        """
        return f'or path.endswith("lib_pypy{os.sep}__extensions__") # PyPy2 built-in import marker'


class PyPy2Posix(PyPy2, PosixSupports):
    """PyPy 2 on POSIX"""

    @classmethod
    def modules(cls):
        return super().modules() + ["posixpath"]

    @classmethod
    def _shared_libs(cls, python_dir):
        return python_dir.glob("libpypy*.*")

    @property
    def lib(self):
        return self.dest / "lib"

    @classmethod
    def sources(cls, interpreter):
        yield from super().sources(interpreter)
        host_lib = Path(interpreter.system_prefix) / "lib"
        if host_lib.exists():
            yield PathRefToDest(host_lib, dest=lambda self, _: self.lib)  # noqa: U101


class Pypy2Windows(PyPy2, WindowsSupports):
    """PyPy 2 on Windows"""

    @classmethod
    def modules(cls):
        return super().modules() + ["ntpath"]

    @classmethod
    def _shared_libs(cls, python_dir):
        # No glob in python2 PathLib
        for candidate in ["libpypy-c.dll", "libffi-7.dll", "libffi-8.dll"]:
            dll = python_dir / candidate
            if dll.exists():
                yield dll

    @classmethod
    def sources(cls, interpreter):
        yield from super().sources(interpreter)
        yield PathRefToDest(Path(interpreter.system_prefix) / "libs", dest=lambda self, s: self.dest / s.name)


__all__ = [
    "PyPy2",
    "PyPy2Posix",
    "Pypy2Windows",
]
PK鼷\lj(P��@via_global_ref/builtin/pypy/__pycache__/__init__.cpython-311.pycnu�[����

�|oi���dS)N�r���/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/builtin/pypy/__init__.py�<module>rs���rPK鼷\��{C>via_global_ref/builtin/pypy/__pycache__/common.cpython-311.pycnu�[����

�|oi���j�ddlZddlmZddlmZmZmZddlmZGd�deej	���Z
dgZdS)	�N)�Path)�
PathRefToDest�RefMust�RefWhen�)�ViaGlobalRefVirtualenvBuiltinc���eZdZe�fd���Zed���Ze�fd���Zed���Zed���Zed���Z	ed���Z
�xZS)�PyPyc�\��|jdko t���|��S)Nr
)�implementation�super�can_describe��cls�interpreter�	__class__s  ���/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/builtin/pypy/common.pyrzPyPy.can_describe
s(����)�V�3�Y����8L�8L�[�8Y�8Y�Y�c#�K�t|j��}td�|�|��D����}|jjdkrtjntj}|||tj
fV�dS)Nc3�6K�|]}|�tj��V��dS�N)r
�suffix)�.0�names  r�	<genexpr>z$PyPy._executables.<locals>.<genexpr>s/����W�W�D�D�/�$�+�/�/�W�W�W�W�W�Wrr)r�system_executable�sorted�	exe_names�version_info�majorr�COPY�NAr�ANY)rr�host�targets�musts     r�_executableszPyPy._executablessx�����K�1�2�2���W�W�C�M�M�+�<V�<V�W�W�W�W�W��*�7�=��B�B�w�|�|��
���G�T�7�;�.�.�.�.�.�.rc#�Z�K�t���|��Ed{V��dSr)r
�sourcesrs  �r�executableszPyPy.executabless5������7�7�?�?�;�/�/�/�/�/�/�/�/�/�/�/rc��|���dd|jj��d|jj�d|jj��hS)N�python�.)�exe_stemrr �minor)rrs  rrzPyPy.exe_namessL��
�L�L�N�N��5�[�-�3�5�5�V�[�-�3�V�V�k�6N�6T�V�V�	
�	
rc#�K�|�|��Ed{V��|�|��D]}t|d����V��dS)Nc� �|j|jzSr)�bin_dirr)�self�ss  r�<lambda>zPyPy.sources.<locals>.<lambda>&s��4�<�!�&�;P�r)�dest)r*�_add_shared_libsr)rrr$s   rr)zPyPy.sources"su�����?�?�;�/�/�/�/�/�/�/�/�/��(�(��5�5�	R�	R�D���+P�+P�Q�Q�Q�Q�Q�Q�Q�	R�	Rrc#�K�t|j�����j}|�|��Ed{V��dSr)rr�resolve�parent�_shared_libs)rr�
python_dirs   rr7zPyPy._add_shared_libs(sS�����+�7�8�8�@�@�B�B�I�
��#�#�J�/�/�/�/�/�/�/�/�/�/�/rc��t�r)�NotImplementedError)rr<s  rr;zPyPy._shared_libs.s��!�!r)�__name__�
__module__�__qualname__�classmethodrr'r*rr)r7r;�
__classcell__)rs@rr
r
	s���������Z�Z�Z�Z��[�Z��/�/��[�/��0�0�0�0��[�0��
�
��[�
��R�R��[�R�
�0�0��[�0�
�"�"��[�"�"�"�"�"rr
)�	metaclass)�abc�pathlibr�,virtualenv.create.via_global_ref.builtin.refrrr�via_global_self_dor�ABCMetar
�__all__�rr�<module>rLs���
�
�
�
�������X�X�X�X�X�X�X�X�X�X�>�>�>�>�>�>�'"�'"�'"�'"�'"�(�C�K�'"�'"�'"�'"�V����rPK鼷\'��Ϗ�=via_global_ref/builtin/pypy/__pycache__/pypy2.cpython-311.pycnu�[����

�|oi�
����ddlZddlZddlZddlmZddlmZmZddlm	Z	ddl
mZddlm
Z
Gd	�d
e
eej���ZGd�d
ee��ZGd�dee��Zgd�ZdS)�N)�Path)�
PosixSupports�WindowsSupports)�
PathRefToDest�)�Python2�)�PyPyc����eZdZdZed���Ze�fd���Zed���Zed���Ze	d���Z
e�fd���Ze	d���Z�fd	�Z
e	d
���Z�xZS)�PyPy2zPyPy 2c��dS)N�pypy���clss ��/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/builtin/pypy/pypy2.py�exe_stemzPyPy2.exe_stems���v�c#���K�t���|��Ed{V��|�|��}|���rt	|jd����V�dSdS)Nc��|jS�N)�include��self�_s  r�<lambda>zPyPy2.sources.<locals>.<lambda>s
��QU�Q]�r��dest)�super�sources�host_include_marker�existsr�parent)r�interpreterr!�	__class__s   �rr z
PyPy2.sourcess�������7�7�?�?�;�/�/�/�/�/�/�/�/�/�!�5�5�k�B�B���%�%�'�'�	_�� 3� :�A]�A]�^�^�^�^�^�^�^�^�	_�	_rc��dS)NTrrs r�needs_stdlib_py_modulezPyPy2.needs_stdlib_py_modules���trc�0�t|j��dzS)NzPyPy.h)r�system_include)rr$s  rr!zPyPy2.host_include_marker s���K�.�/�/�(�:�:rc�F�|j|j�d��zS)N�headers)rr$�install_path�rs rrz
PyPy2.include$s ���y�4�+�8�8��C�C�C�Crc�N��t�����gd�zS)N)�os�copy_reg�genericpath�	linecache�stat�UserDict�warnings�r�modules�rr%s �rr7z
PyPy2.modules(s/����w�w��� � �$
�$
�$
�
�	
rc��|jdzS)N�lib_pypyrr-s rr:zPyPy2.lib_pypy5s���y�:�%�%rc�B��t�����}|�|j��|�|j��}|���r |�|jj��ntj
d|��|S)Nz2no include folders as can't find include marker %s)r�ensure_directories�addr:r!r$r"rr#�logging�debug)r�dirsr!r%s   �rr<zPyPy2.ensure_directories9s�����w�w�)�)�+�+����������"�6�6�t�7G�H�H���%�%�'�'�	e��H�H�T�\�(�)�)�)�)��M�N�Pc�d�d�d��rc�"�dtj�d�S)z�
        PyPy2 built-in imports are handled by this path entry, don't overwrite to not disable it
        see: https://github.com/pypa/virtualenv/issues/1652
        zor path.endswith("lib_pypyz/__extensions__") # PyPy2 built-in import marker)r/�sepr-s r�skip_rewritezPyPy2.skip_rewriteCs��d�B�F�c�c�c�cr)�__name__�
__module__�__qualname__�__doc__�classmethodrr r'r!�propertyrr7r:r<rC�
__classcell__�r%s@rrr
s6��������L�����[���_�_�_�_��[�_�����[���;�;��[�;��D�D��X�D��

�

�

�

��[�

��&�&��X�&�������d�d��X�d�d�d�d�drr)�	metaclassc�x��eZdZdZe�fd���Zed���Zed���Ze�fd���Z	�xZ
S)�
PyPy2PosixzPyPy 2 on POSIXc�L��t�����dgzS)N�	posixpathr6r8s �rr7zPyPy2Posix.modulesOs����w�w��� � �K�=�0�0rc�,�|�d��S)Nz
libpypy*.*)�glob)r�
python_dirs  r�_shared_libszPyPy2Posix._shared_libsSs�����|�,�,�,rc��|jdzS)N�librr-s rrVzPyPy2Posix.libWs���y�5� � rc#���K�t���|��Ed{V��t|j��dz}|���rt|d����V�dSdS)NrVc��|jSr)rVrs  rrz$PyPy2Posix.sources.<locals>.<lambda>`s��t�x�rr)rr r�
system_prefixr"r)rr$�host_libr%s   �rr zPyPy2Posix.sources[s�������7�7�?�?�;�/�/�/�/�/�/�/�/�/���1�2�2�U�:���?�?���	I���/G�/G�H�H�H�H�H�H�H�H�	I�	Ir)rDrErFrGrHr7rTrIrVr rJrKs@rrNrNLs�����������1�1�1�1��[�1��-�-��[�-��!�!��X�!��I�I�I�I��[�I�I�I�I�IrrNc�b��eZdZdZe�fd���Zed���Ze�fd���Z�xZS)�Pypy2WindowszPyPy 2 on Windowsc�L��t�����dgzS)N�ntpathr6r8s �rr7zPypy2Windows.modulesfs����w�w��� � �H�:�-�-rc#�NK�dD]}||z}|���r|V�� dS)N)z
libpypy-c.dllzlibffi-7.dllzlibffi-8.dll)r")rrS�	candidate�dlls    rrTzPypy2Windows._shared_libsjsF����K�	�	�I��y�(�C��z�z�|�|�
��	�	�	��	�	rc#��K�t���|��Ed{V��tt|j��dzd����V�dS)N�libsc� �|j|jzSr)r�name)r�ss  rrz&Pypy2Windows.sources.<locals>.<lambda>us��[_�[d�gh�gm�[m�rr)rr rrrY)rr$r%s  �rr zPypy2Windows.sourcesrsb������7�7�?�?�;�/�/�/�/�/�/�/�/�/��D��!:�;�;�f�D�Km�Km�n�n�n�n�n�n�n�nr)	rDrErFrGrHr7rTr rJrKs@rr\r\cs�����������.�.�.�.��[�.�����[���o�o�o�o��[�o�o�o�o�orr\)rrNr\)�abcr>r/�pathlibr�virtualenv.create.describerr�,virtualenv.create.via_global_ref.builtin.refr�python2.python2r�commonr
�ABCMetarrNr\�__all__rrr�<module>ros<��
�
�
�
�����	�	�	�	�������E�E�E�E�E�E�E�E�F�F�F�F�F�F�%�%�%�%�%�%�������<d�<d�<d�<d�<d�D�'�S�[�<d�<d�<d�<d�~I�I�I�I�I��
�I�I�I�.o�o�o�o�o�5�/�o�o�o�*�����rPK鼷\�2�[��=via_global_ref/builtin/pypy/__pycache__/pypy3.cpython-311.pycnu�[����

�|oi�	���ddlZddlmZddlmZmZmZddlmZddl	m
Z
Gd�de
eej�	��ZGd
�dee��Z
Gd�d
ee��Zgd�ZdS)�N)�Path)�
PosixSupports�Python3Supports�WindowsSupports)�
PathRefToDest�)�PyPyc�D��eZdZed���Ze�fd���Z�xZS)�PyPy3c��dS)N�pypy3�)�clss ��/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/builtin/pypy/pypy3.py�exe_stemzPyPy3.exe_stems���w�c�N��t���|��dhzS)N�pypy)�super�	exe_names)r�interpreter�	__class__s  �rrzPyPy3.exe_namess"����w�w� � ��-�-���8�8r)�__name__�
__module__�__qualname__�classmethodrr�
__classcell__�rs@rrr
s]�����������[���9�9�9�9��[�9�9�9�9�9rr)�	metaclassc�N��eZdZdZed���Zd�Ze�fd���Z�xZS)�
PyPy3PosixzPyPy 3 on POSIXc�,�|�d��S)Nzlibpypy3*.*��glob)r�
python_dirs  r�_shared_libszPyPy3Posix._shared_libss�����}�-�-�-rc�&�|jdz|jzS)N�lib)�dest�name)�self�srcs  r�to_libzPyPy3Posix.to_libs���y�5� �3�8�+�+rc#��K�t���|��Ed{V��|jdkrdSt|j��dz}t|j��}|���rJ|���r8|���D]%}||kr�	t||j	���V��"dSdSdS)Nz/usrr()r))
r�sources�
system_prefixr�
system_stdlib�exists�is_dir�iterdirrr-)rr�host_lib�stdlib�pathrs     �rr/zPyPy3Posix.sourcess�������7�7�?�?�;�/�/�/�/�/�/�/�/�/��$��.�.��F�
��1�2�2�U�:���k�/�0�0���?�?���	;����!2�!2�	;� �(�(�*�*�
;�
;���T�>�>��#�D�s�z�:�:�:�:�:�:�:�	;�	;�	;�	;�
;�
;r)	rrr�__doc__rr&r-r/rrs@rr!r!sr����������.�.��[�.�,�,�,��;�;�;�;��[�;�;�;�;�;rr!c�>�eZdZdZed���Zed���ZdS)�Pypy3WindowszPyPy 3 on Windowsc�,�|jjjdkS)N�)r�version_info�minor)r+s r�less_v37zPypy3Windows.less_v37:s����,�2�Q�6�6rc#�NK�dD]}|�|��}|Ed{V��� dS)N)zlibpypy*.dllzlibffi*.dllr#)rr%�pattern�srcss    rr&zPypy3Windows._shared_libs>sE����7�	�	�G��?�?�7�+�+�D��O�O�O�O�O�O�O�O�	�	rN)rrrr8�propertyr?rr&rrrr:r:7sN��������
�7�7��X�7�����[���rr:)rr!r:)�abc�pathlibr�virtualenv.create.describerrr�,virtualenv.create.via_global_ref.builtin.refr�commonr	�ABCMetarr!r:�__all__rrr�<module>rKs��
�
�
�
�������V�V�V�V�V�V�V�V�V�V�F�F�F�F�F�F�������9�9�9�9�9�D�/�S�[�9�9�9�9� ;� ;� ;� ;� ;��
� ;� ;� ;�F�����5�/���������rPK鼷\'via_global_ref/builtin/pypy/__init__.pynu�[���PK鼷\��è		,via_global_ref/builtin/via_global_self_do.pynu�[���from abc import ABCMeta

from virtualenv.create.via_global_ref.builtin.ref import (
    ExePathRefToDest,
    RefMust,
    RefWhen,
)
from virtualenv.util.path import ensure_dir

from ..api import ViaGlobalRefApi, ViaGlobalRefMeta
from .builtin_way import VirtualenvBuiltin


class BuiltinViaGlobalRefMeta(ViaGlobalRefMeta):
    def __init__(self):
        super().__init__()
        self.sources = []


class ViaGlobalRefVirtualenvBuiltin(ViaGlobalRefApi, VirtualenvBuiltin, metaclass=ABCMeta):
    def __init__(self, options, interpreter):
        super().__init__(options, interpreter)
        self._sources = getattr(options.meta, "sources", None)  # if we're created as a describer this might be missing

    @classmethod
    def can_create(cls, interpreter):
        """By default, all built-in methods assume that if we can describe it we can create it"""
        # first we must be able to describe it
        if not cls.can_describe(interpreter):
            return None
        meta = cls.setup_meta(interpreter)
        if meta is not None and meta:
            cls._sources_can_be_applied(interpreter, meta)
        return meta

    @classmethod
    def _sources_can_be_applied(cls, interpreter, meta):
        for src in cls.sources(interpreter):
            if src.exists:
                if meta.can_copy and not src.can_copy:
                    meta.copy_error = f"cannot copy {src}"
                if meta.can_symlink and not src.can_symlink:
                    meta.symlink_error = f"cannot symlink {src}"
            else:
                msg = f"missing required file {src}"
                if src.when == RefMust.NA:
                    meta.error = msg
                elif src.when == RefMust.COPY:
                    meta.copy_error = msg
                elif src.when == RefMust.SYMLINK:
                    meta.symlink_error = msg
            if not meta.can_copy and not meta.can_symlink:
                meta.error = f"neither copy or symlink supported, copy: {meta.copy_error} symlink: {meta.symlink_error}"
            if meta.error:
                break
            meta.sources.append(src)

    @classmethod
    def setup_meta(cls, interpreter):  # noqa: U100
        return BuiltinViaGlobalRefMeta()

    @classmethod
    def sources(cls, interpreter):
        for host_exe, targets, must, when in cls._executables(interpreter):
            yield ExePathRefToDest(host_exe, dest=cls.to_bin, targets=targets, must=must, when=when)

    def to_bin(self, src):
        return self.bin_dir / src.name

    @classmethod
    def _executables(cls, interpreter):  # noqa: U100
        raise NotImplementedError

    def create(self):
        dirs = self.ensure_directories()
        for directory in list(dirs):
            if any(i for i in dirs if i is not directory and directory.parts == i.parts[: len(directory.parts)]):
                dirs.remove(directory)
        for directory in sorted(dirs):
            ensure_dir(directory)

        self.set_pyenv_cfg()
        self.pyenv_cfg.write()
        true_system_site = self.enable_system_site_package
        try:
            self.enable_system_site_package = False
            for src in self._sources:
                if (
                    src.when == RefWhen.ANY
                    or (src.when == RefWhen.SYMLINK and self.symlinks is True)
                    or (src.when == RefWhen.COPY and self.symlinks is False)
                ):
                    src.run(self, self.symlinks)
        finally:
            if true_system_site != self.enable_system_site_package:
                self.enable_system_site_package = true_system_site
        super().create()

    def ensure_directories(self):
        return {self.dest, self.bin_dir, self.script_dir, self.stdlib} | set(self.libs)

    def set_pyenv_cfg(self):
        """
        We directly inject the base prefix and base exec prefix to avoid site.py needing to discover these
        from home (which usually is done within the interpreter itself)
        """
        super().set_pyenv_cfg()
        self.pyenv_cfg["base-prefix"] = self.interpreter.system_prefix
        self.pyenv_cfg["base-exec-prefix"] = self.interpreter.system_exec_prefix
        self.pyenv_cfg["base-executable"] = self.interpreter.system_executable


__all__ = [
    "BuiltinViaGlobalRefMeta",
    "ViaGlobalRefVirtualenvBuiltin",
]
PK鼷\��X��Evia_global_ref/builtin/__pycache__/via_global_self_do.cpython-311.pycnu�[����

�|oi	���ddlmZddlmZmZmZddlmZddlm	Z	m
Z
ddlmZGd�d	e
��Z
Gd
�de	ee���Zd	dgZd
S)�)�ABCMeta)�ExePathRefToDest�RefMust�RefWhen)�
ensure_dir�)�ViaGlobalRefApi�ViaGlobalRefMeta�)�VirtualenvBuiltinc���eZdZ�fd�Z�xZS)�BuiltinViaGlobalRefMetac�V��t�����g|_dS�N)�super�__init__�sources��self�	__class__s ���/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/builtin/via_global_self_do.pyrz BuiltinViaGlobalRefMeta.__init__s$���
�������������)�__name__�
__module__�__qualname__r�
__classcell__�rs@rrrs8���������������rrc���eZdZ�fd�Zed���Zed���Zed���Zed���Zd�Z	ed���Z
�fd�Zd	�Z�fd
�Z
�xZS)�ViaGlobalRefVirtualenvBuiltinc���t���||��t|jdd��|_dS)Nr)rr�getattr�meta�_sources)r�options�interpreterrs   �rrz&ViaGlobalRefVirtualenvBuiltin.__init__s6���
������+�.�.�.����i��>�>��
�
�
rc��|�|��sdS|�|��}|�|r|�||��|S)zSBy default, all built-in methods assume that if we can describe it we can create itN)�can_describe�
setup_meta�_sources_can_be_applied)�clsr%r"s   r�
can_createz(ViaGlobalRefVirtualenvBuiltin.can_createsV������,�,�	��4��~�~�k�*�*�������'�'��T�:�:�:��rc���|�|��D]�}|jr1|jr|js
d|��|_|jr|js
d|��|_n[d|��}|jtjkr||_	n9|jtj
kr||_n|jtjkr||_|js|jsd|j�d|j��|_	|j	rdS|j�|����dS)Nzcannot copy zcannot symlink zmissing required file z)neither copy or symlink supported, copy: z
 symlink: )
r�exists�can_copy�
copy_error�can_symlink�
symlink_error�whenr�NA�error�COPY�SYMLINK�append)r*r%r"�src�msgs     rr)z5ViaGlobalRefVirtualenvBuiltin._sources_can_be_applied$s+���;�;�{�+�+�	%�	%�C��z�
-��=�;���;�&:�S�&:�&:�D�O��#�A�C�O�A�)@�3�)@�)@�D�&��4�s�4�4���8�w�z�)�)�!$�D�J�J��X���-�-�&)�D�O�O��X���0�0�),�D�&��=�
y��)9�
y�x���x�x�dh�dv�x�x��
��z�
�����L����$�$�$�$�%	%�	%rc��t��Sr)r�r*r%s  rr(z(ViaGlobalRefVirtualenvBuiltin.setup_meta:s��&�(�(�(rc#�zK�|�|��D]"\}}}}t||j|||���V��#dS)N)�dest�targets�mustr2)�_executablesr�to_bin)r*r%�host_exer>r?r2s      rrz%ViaGlobalRefVirtualenvBuiltin.sources>s`����-0�-=�-=�k�-J�-J�	e�	e�)�H�g�t�T�"�8�#�*�g�TX�_c�d�d�d�d�d�d�d�	e�	erc� �|j|jzSr)�bin_dir�name)rr8s  rrAz$ViaGlobalRefVirtualenvBuiltin.to_binCs���|�c�h�&�&rc��t�r)�NotImplementedErrorr;s  rr@z*ViaGlobalRefVirtualenvBuiltin._executablesFs��!�!rc�����|���}t|��D]2�t�fd�|D����r|�����3t	|��D]�t����|���|j���|j	}	d|_	|j
D]n}|jtj
ks<|jtjkr	|jdus|jtjkr$|jdur|�||j���o	||j	kr||_	n#||j	kr||_	wxYwt%�����dS)Nc3�x�K�|]4}|�u��j|jdt�j���k�0|V��5dSr)�parts�len)�.0�i�	directorys  �r�	<genexpr>z7ViaGlobalRefVirtualenvBuiltin.create.<locals>.<genexpr>MsU�����p�p��a�y�&8�&8�Y�_�PQ�PW�Xn�Z]�^g�^m�Zn�Zn�Xn�Po�=o�=o�1�=o�=o�=o�=o�p�prFT)�ensure_directories�list�any�remove�sortedr�
set_pyenv_cfg�	pyenv_cfg�write�enable_system_site_packager#r2r�ANYr6�symlinksr5�runr�create)r�dirs�true_system_siter8rNrs    @�rr\z$ViaGlobalRefVirtualenvBuiltin.createJs������&�&�(�(���d���	'�	'�I��p�p�p�p�d�p�p�p�p�p�
'����I�&�&�&������	"�	"�I��y�!�!�!�!���������������:��	C�.3�D�+��}�
1�
1���H���+�+���G�O�3�3��
��8M�8M���G�L�0�0�T�]�e�5K�5K��G�G�D�$�-�0�0�0��

1� �4�#B�B�B�2B��/��� �4�#B�B�B�2B��/�B�B�B�B�
���������s
�/A=E�Ec�`�|j|j|j|jht	|j��zSr)r=rD�
script_dir�stdlib�set�libs)rs rrPz0ViaGlobalRefVirtualenvBuiltin.ensure_directoriescs&���	�4�<���$�+�F��T�Y���W�Wrc���t�����|jj|jd<|jj|jd<|jj|jd<dS)z�
        We directly inject the base prefix and base exec prefix to avoid site.py needing to discover these
        from home (which usually is done within the interpreter itself)
        zbase-prefixzbase-exec-prefixzbase-executableN)rrUr%�
system_prefixrV�system_exec_prefix�system_executablers �rrUz+ViaGlobalRefVirtualenvBuiltin.set_pyenv_cfgfsY���
	��������(,�(8�(F���}�%�-1�-=�-P���)�*�,0�,<�,N���(�)�)�)r)rrrr�classmethodr+r)r(rrAr@r\rPrUrrs@rrrs�������?�?�?�?�?�����[���%�%��[�%�*�)�)��[�)��e�e��[�e�'�'�'��"�"��[�"������2X�X�X�O�O�O�O�O�O�O�O�Orr)�	metaclassN)�abcr�,virtualenv.create.via_global_ref.builtin.refrrr�virtualenv.util.pathr�apir	r
�builtin_wayrrr�__all__�rr�<module>rqs
������������������
,�+�+�+�+�+�3�3�3�3�3�3�3�3�*�*�*�*�*�*������.����ZO�ZO�ZO�ZO�ZO�O�5F�RY�ZO�ZO�ZO�ZO�|�#����rPK鼷\�q9��;via_global_ref/builtin/__pycache__/__init__.cpython-311.pycnu�[����

�|oi���dS)N�r���/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/builtin/__init__.py�<module>rs���rPK鼷\�q<��(�(6via_global_ref/builtin/__pycache__/ref.cpython-311.pycnu�[����

�|oi����dZddlZddlmZmZddlmZddlmZm	Z	m
Z
ddlmZm
Z
ddlmZmZmZGd�d	��ZGd
�d��ZGd�d
e���ZGd�dee���ZGd�de��ZGd�dee��Zgd�ZdS)aG
Virtual environments in the traditional sense are built as reference to the host python. This file allows declarative
references to elements on the file system, allowing our system to automatically detect what modes it can support given
the constraints: e.g. can the file system symlink, can the files be read, executed, etc.
�N)�ABCMeta�abstractmethod)�OrderedDict)�S_IXGRP�S_IXOTH�S_IXUSR)�fs_is_case_sensitive�fs_supports_symlink)�copy�make_exe�symlinkc��eZdZdZdZdZdS)�RefMust�NArr
N)�__name__�
__module__�__qualname__r�COPY�SYMLINK���~/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/builtin/ref.pyrrs������	
�B��D��G�G�Grrc��eZdZdZdZdZdS)�RefWhen�ANYrr
N)rrrrrrrrrrrs������
�C��D��G�G�Grrc��eZdZdZe��Ze��Zej	e
jfd�Zd�Z
ed���Zed���Zed���Zed���Zd�Zd	S)
�PathRefz@Base class that checks if a file reference can be symlink/copiedc���||_||_||_	|���|_n#t$r
d|_YnwxYw|jrdnd|_|jrdnd|_|jrdnd|_dS�NF)�must�when�src�exists�OSError�	_can_read�	_can_copy�_can_symlink)�selfr"r r!s    r�__init__zPathRef.__init__"s�����	���	����	 ��*�*�,�,�D�K�K���	 �	 �	 ��D�K�K�K�	 ����!%��7���%���!%��7���%���$(�K�:�D�D�U����s�1�A�Ac�0�|jj�d|j�d�S)N�(src=�))�	__class__rr"�r(s r�__repr__zPathRef.__repr__.s ���.�)�;�;���;�;�;�;rc�`�|j��|j���rR	|j�d��5d|_ddd��n#1swxYwYnM#t$r
d|_Yn:wxYwtjt|j��t
j��|_|jS)N�rbTF)	r%r"�is_file�openr$�os�access�str�R_OKr.s r�can_readzPathRef.can_read1s����>�!��x���!�!�
C�+�����t�,�,�.�.�)-���.�.�.�.�.�.�.�.�.�.�.����.�.�.�.����+�+�+�%*�D�N�N�N�+����"$��3�t�x�=�=�"�'�!B�!B����~�s4�A�A�A�A�A�A�A�A0�/A0c�z�|j�.|jtjkr
|j|_n|j|_|jS�N)r&r rr�can_symlinkr8r.s r�can_copyzPathRef.can_copy>s6���>�!��y�G�O�+�+�!%�!1����!%�����~�rc��|j�5|jtjkr
|j|_n|jo|j|_|jSr:)r'r rrr<�FS_SUPPORTS_SYMLINKr8r.s rr;zPathRef.can_symlinkGsB����$��y�G�L�(�(�$(�M��!�!�$(�$<�$N����!�� � rc��t�r:)�NotImplementedError)r(�creator�symlinkss   r�runzPathRef.runPs��!�!rc��|jtjkrtS|jtjkrt
S|rtnt
Sr:)r rrr
rr)r(rBs  r�methodzPathRef.methodTs9���9���'�'��N��9���$�$��K�"�,�w�w��,rN)rrr�__doc__r
r>r	�FS_CASE_SENSITIVErrrrr)r/�propertyr8r<r;rrCrErrrrrs�������J�J�-�-�/�/��,�,�.�.��!(��'�+�
;�
;�
;�
;�<�<�<��
�
��X�
�����X���!�!��X�!��"�"��^�"�-�-�-�-�-rr)�	metaclassc�h��eZdZdZejejf�fd�	Ze	d���Z
e	d���Z�xZS)�
ExePathRefzIBase class that checks if a executable can be references via symlink/copyc�\��t���|||��d|_dSr:)�superr)�_can_run)r(r"r r!r-s    �rr)zExePathRef.__init___s*���
������d�D�)�)�)���
�
�
rc�"�|jr|jSdSr)r>�can_runr.s rr;zExePathRef.can_symlinkcs���#�	 ��<���urc��|j�I|j���j}tt
tfD]}||zrd|_nd|_|jS)NTF)rNr"�stat�st_moderrr)r(�mode�keys   rrPzExePathRef.can_runisY���=� ��8�=�=�?�?�*�D���'�2�
&�
&���#�:�)�$(�D�M��� %��
��}�r)
rrrrFrrrrr)rHr;rP�
__classcell__�r-s@rrKrK\s��������S�S�!(��'�+�����������X��
�	�	��X�	�	�	�	�	rrKc�B��eZdZdZejejf�fd�	Zd�Z	�xZ
S)�
PathRefToDestzLink a path on the file systemc�\��t���|||��||_dSr:)rMr)�dest)r(r"r[r r!r-s     �rr)zPathRefToDest.__init__ys*���
������d�D�)�)�)���	�	�	rc�0�|�||j��}|�|��}t|t��r|n|f}|j���s|j�dd���|D]}||j|���dS)NT)�parents�exist_ok)r[r"rE�
isinstance�list�parentr#�mkdir)r(rArBr[rE�
dest_iterable�dsts       rrCzPathRefToDest.run}s����y�y��$�(�+�+�����X�&�&�� *�4�� 6� 6�C���T�G�
��{�!�!�#�#�	;��K���d�T��:�:�:� �	"�	"�C��F�4�8�S�!�!�!�!�	"�	"r)rrrrFrrrrr)rCrVrWs@rrYrYvs[�������(�(�'.�z���������"�"�"�"�"�"�"rrYc�>�eZdZdZejejfd�Zd�Z	d�Z
dS)�ExePathRefToDestz"Link a exe path on the file systemc�@�t�||||��t�|||||��|js8t	td�|D���������}|d|_|dd�|_||_	dS)Nc3�BK�|]}|���dfV��dSr:)�lower)�.0�is  r�	<genexpr>z,ExePathRefToDest.__init__.<locals>.<genexpr>�s/����&J�&J�Q����	�	�4�'8�&J�&J�&J�&J�&J�&Jrr�)
rKr)rYrGr`r�keys�base�aliasesr[)r(r"�targetsr[r r!s      rr)zExePathRefToDest.__init__�s������D�#�t�T�2�2�2����t�S�$��d�;�;�;��%�	S��;�&J�&J�'�&J�&J�&J�J�J�O�O�Q�Q�R�R�G��A�J��	��q�r�r�{�����	�	�	rc��|�||j��j}||jz}|�|��}||j|��|st|��|jD]r}||z}|���r|���|r|�	|j��nt|j|��|st|���sdSr:)r[r"rarorErrpr#�unlink�
symlink_tor)r(rArB�bin_dirr[rE�extra�	link_files        rrCzExePathRefToDest.run�s����)�)�G�T�X�.�.�5�����"�����X�&�&����t�x������	��T�N�N�N��\�		$�		$�E��%��I����!�!�
#�� � �"�"�"��
*��$�$�T�Y�/�/�/�/��T�X�y�)�)�)��
$���#�#�#��		$�		$rc�@�|jj�d|j�d|j�d�S)Nr+z, alias=r,)r-rr"rpr.s rr/zExePathRefToDest.__repr__�s*���.�)�Q�Q���Q�Q�$�,�Q�Q�Q�QrN)rrrrFrrrrr)rCr/rrrrfrf�sZ������,�,�07�
�������$�$�$�$R�R�R�R�Rrrf)rKrfrYrrr)rFr4�abcrr�collectionsrrRrrr�virtualenv.infor	r
�virtualenv.util.pathrrr
rrrrKrYrf�__all__rrr�<module>r~s�����
�	�	�	�'�'�'�'�'�'�'�'�#�#�#�#�#�#�*�*�*�*�*�*�*�*�*�*�E�E�E�E�E�E�E�E�8�8�8�8�8�8�8�8�8�8�����������������=-�=-�=-�=-�=-��=-�=-�=-�=-�@������G�����4"�"�"�"�"�G�"�"�"�"R�R�R�R�R�}�j�R�R�R�D�����rPK鼷\����>via_global_ref/builtin/__pycache__/builtin_way.cpython-311.pycnu�[����

�|oi���R�ddlmZddlmZddlmZGd�deee���ZdgZdS)�)�ABCMeta)�Creator)�Describec��eZdZdZd�ZdS)�VirtualenvBuiltinzeA creator that does operations itself without delegation, if we can create it we can also describe itc�h�tj|||��tj||j|��dS)N)r�__init__r�dest)�self�options�interpreters   ��/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/builtin/builtin_way.pyr	zVirtualenvBuiltin.__init__
s4�����w��4�4�4���$��	�;�7�7�7�7�7�N)�__name__�
__module__�__qualname__�__doc__r	�rrrrs)������o�o�8�8�8�8�8rr)�	metaclassN)�abcr�virtualenv.create.creatorr�virtualenv.create.describerr�__all__rrr�<module>rs~��������-�-�-�-�-�-�/�/�/�/�/�/�8�8�8�8�8���W�8�8�8�8�����rPK鼷\"via_global_ref/builtin/__init__.pynu�[���PK鼷\̩E�		(via_global_ref/builtin/cpython/common.pynu�[���from abc import ABCMeta
from collections import OrderedDict
from pathlib import Path

from virtualenv.create.describe import PosixSupports, WindowsSupports
from virtualenv.create.via_global_ref.builtin.ref import RefMust, RefWhen

from ..via_global_self_do import ViaGlobalRefVirtualenvBuiltin


class CPython(ViaGlobalRefVirtualenvBuiltin, metaclass=ABCMeta):
    @classmethod
    def can_describe(cls, interpreter):
        return interpreter.implementation == "CPython" and super().can_describe(interpreter)

    @classmethod
    def exe_stem(cls):
        return "python"


class CPythonPosix(CPython, PosixSupports, metaclass=ABCMeta):
    """Create a CPython virtual environment on POSIX platforms"""

    @classmethod
    def _executables(cls, interpreter):
        host_exe = Path(interpreter.system_executable)
        major, minor = interpreter.version_info.major, interpreter.version_info.minor
        targets = OrderedDict((i, None) for i in ["python", f"python{major}", f"python{major}.{minor}", host_exe.name])
        must = RefMust.COPY if interpreter.version_info.major == 2 else RefMust.NA
        yield host_exe, list(targets.keys()), must, RefWhen.ANY


class CPythonWindows(CPython, WindowsSupports, metaclass=ABCMeta):
    @classmethod
    def _executables(cls, interpreter):
        # symlink of the python executables does not work reliably, copy always instead
        # - https://bugs.python.org/issue42013
        # - venv
        host = cls.host_python(interpreter)
        for path in (host.parent / n for n in {"python.exe", host.name}):
            yield host, [path.name], RefMust.COPY, RefWhen.ANY
        # for more info on pythonw.exe see https://stackoverflow.com/a/30313091
        python_w = host.parent / "pythonw.exe"
        yield python_w, [python_w.name], RefMust.COPY, RefWhen.ANY

    @classmethod
    def host_python(cls, interpreter):
        return Path(interpreter.system_executable)


def is_mac_os_framework(interpreter):
    if interpreter.platform == "darwin":
        framework_var = interpreter.sysconfig_vars.get("PYTHONFRAMEWORK")
        value = "Python3" if interpreter.version_info.major == 3 else "Python"
        return framework_var == value
    return False


__all__ = [
    "CPython",
    "CPythonPosix",
    "CPythonWindows",
    "is_mac_os_framework",
]
PK鼷\����
�
*via_global_ref/builtin/cpython/cpython2.pynu�[���import abc
import logging
from pathlib import Path

from virtualenv.create.via_global_ref.builtin.ref import PathRefToDest

from ..python2.python2 import Python2
from .common import CPython, CPythonPosix, CPythonWindows, is_mac_os_framework


class CPython2(CPython, Python2, metaclass=abc.ABCMeta):
    """Create a CPython version 2  virtual environment"""

    @classmethod
    def sources(cls, interpreter):
        yield from super().sources(interpreter)
        # include folder needed on Python 2 as we don't have pyenv.cfg
        host_include_marker = cls.host_include_marker(interpreter)
        if host_include_marker.exists():
            yield PathRefToDest(host_include_marker.parent, dest=lambda self, _: self.include)  # noqa: U101

    @classmethod
    def needs_stdlib_py_module(cls):
        return False

    @classmethod
    def host_include_marker(cls, interpreter):
        return Path(interpreter.system_include) / "Python.h"

    @property
    def include(self):
        # the pattern include the distribution name too at the end, remove that via the parent call
        return (self.dest / self.interpreter.install_path("headers")).parent

    @classmethod
    def modules(cls):
        return ["os"]  # landmark to set sys.prefix

    def ensure_directories(self):
        dirs = super().ensure_directories()
        host_include_marker = self.host_include_marker(self.interpreter)
        if host_include_marker.exists():
            dirs.add(self.include.parent)
        else:
            logging.debug("no include folders as can't find include marker %s", host_include_marker)
        return dirs


class CPython2PosixBase(CPython2, CPythonPosix, metaclass=abc.ABCMeta):
    """common to macOs framework builds and other posix CPython2"""

    @classmethod
    def sources(cls, interpreter):
        yield from super().sources(interpreter)

        # check if the makefile exists and if so make it available under the virtual environment
        make_file = Path(interpreter.sysconfig["makefile_filename"])
        if make_file.exists() and str(make_file).startswith(interpreter.prefix):
            under_prefix = make_file.relative_to(Path(interpreter.prefix))
            yield PathRefToDest(make_file, dest=lambda self, s: self.dest / under_prefix)  # noqa: U100


class CPython2Posix(CPython2PosixBase):
    """CPython 2 on POSIX (excluding macOs framework builds)"""

    @classmethod
    def can_describe(cls, interpreter):
        return is_mac_os_framework(interpreter) is False and super().can_describe(interpreter)

    @classmethod
    def sources(cls, interpreter):
        yield from super().sources(interpreter)
        # landmark for exec_prefix
        exec_marker_file, to_path, _ = cls.from_stdlib(cls.mappings(interpreter), "lib-dynload")
        yield PathRefToDest(exec_marker_file, dest=to_path)


class CPython2Windows(CPython2, CPythonWindows):
    """CPython 2 on Windows"""

    @classmethod
    def sources(cls, interpreter):
        yield from super().sources(interpreter)
        py27_dll = Path(interpreter.system_executable).parent / "python27.dll"
        if py27_dll.exists():  # this might be global in the Windows folder in which case it's alright to be missing
            yield PathRefToDest(py27_dll, dest=cls.to_bin)

        libs = Path(interpreter.system_prefix) / "libs"
        if libs.exists():
            yield PathRefToDest(libs, dest=lambda self, s: self.dest / s.name)


__all__ = [
    "CPython2",
    "CPython2PosixBase",
    "CPython2Posix",
    "CPython2Windows",
]
PK鼷\5|_r8r8(via_global_ref/builtin/cpython/mac_os.pynu�[���"""The Apple Framework builds require their own customization"""
import logging
import os
import struct
import subprocess
from abc import ABCMeta, abstractmethod
from pathlib import Path
from textwrap import dedent

from virtualenv.create.via_global_ref.builtin.ref import (
    ExePathRefToDest,
    PathRefToDest,
    RefMust,
)
from virtualenv.info import IS_MAC_ARM64

from .common import CPython, CPythonPosix, is_mac_os_framework
from .cpython2 import CPython2PosixBase
from .cpython3 import CPython3


class CPythonmacOsFramework(CPython, metaclass=ABCMeta):
    @classmethod
    def can_describe(cls, interpreter):
        return is_mac_os_framework(interpreter) and super().can_describe(interpreter)

    def create(self):
        super().create()

        # change the install_name of the copied python executables
        target = self.desired_mach_o_image_path()
        current = self.current_mach_o_image_path()
        for src in self._sources:
            if isinstance(src, ExePathRefToDest):
                if src.must == RefMust.COPY or not self.symlinks:
                    exes = [self.bin_dir / src.base]
                    if not self.symlinks:
                        exes.extend(self.bin_dir / a for a in src.aliases)
                    for exe in exes:
                        fix_mach_o(str(exe), current, target, self.interpreter.max_size)

    @classmethod
    def _executables(cls, interpreter):
        for _, targets, must, when in super()._executables(interpreter):
            # Make sure we use the embedded interpreter inside the framework, even if sys.executable points to the
            # stub executable in ${sys.prefix}/bin.
            # See http://groups.google.com/group/python-virtualenv/browse_thread/thread/17cab2f85da75951
            fixed_host_exe = Path(interpreter.prefix) / "Resources" / "Python.app" / "Contents" / "MacOS" / "Python"
            yield fixed_host_exe, targets, must, when

    @abstractmethod
    def current_mach_o_image_path(self):
        raise NotImplementedError

    @abstractmethod
    def desired_mach_o_image_path(self):
        raise NotImplementedError


class CPython2macOsFramework(CPythonmacOsFramework, CPython2PosixBase):
    @classmethod
    def can_create(cls, interpreter):
        if not IS_MAC_ARM64 and super().can_describe(interpreter):
            return super().can_create(interpreter)
        return False

    def current_mach_o_image_path(self):
        return os.path.join(self.interpreter.prefix, "Python")

    def desired_mach_o_image_path(self):
        return "@executable_path/../Python"

    @classmethod
    def sources(cls, interpreter):
        yield from super().sources(interpreter)
        # landmark for exec_prefix
        exec_marker_file, to_path, _ = cls.from_stdlib(cls.mappings(interpreter), "lib-dynload")
        yield PathRefToDest(exec_marker_file, dest=to_path)

        # add a copy of the host python image
        exe = Path(interpreter.prefix) / "Python"
        yield PathRefToDest(exe, dest=lambda self, _: self.dest / "Python", must=RefMust.COPY)  # noqa: U101

        # add a symlink to the Resources dir
        resources = Path(interpreter.prefix) / "Resources"
        yield PathRefToDest(resources, dest=lambda self, _: self.dest / "Resources")  # noqa: U101

    @property
    def reload_code(self):
        result = super().reload_code
        result = dedent(
            f"""
        # the bundled site.py always adds the global site package if we're on python framework build, escape this
        import sysconfig
        config = sysconfig.get_config_vars()
        before = config["PYTHONFRAMEWORK"]
        try:
            config["PYTHONFRAMEWORK"] = ""
            {result}
        finally:
            config["PYTHONFRAMEWORK"] = before
        """,
        )
        return result


class CPython2macOsArmFramework(CPython2macOsFramework, CPythonmacOsFramework, CPython2PosixBase):
    @classmethod
    def can_create(cls, interpreter):
        if IS_MAC_ARM64 and super(CPythonmacOsFramework, cls).can_describe(interpreter):
            return super(CPythonmacOsFramework, cls).can_create(interpreter)
        return False

    def create(self):
        super(CPython2macOsFramework, self).create()
        self.fix_signature()

    def fix_signature(self):
        """
        On Apple M1 machines (arm64 chips),  rewriting the python executable invalidates its signature.
        In python2 this results in a unusable python exe which just dies.
        As a temporary workaround we can codesign the python exe during the creation process.
        """
        exe = self.exe
        try:
            logging.debug("Changing signature of copied python exe %s", exe)
            bak_dir = exe.parent / "bk"
            # Reset the signing on Darwin since the exe has been modified.
            # Note codesign fails on the original exe, it needs to be copied and moved back.
            bak_dir.mkdir(parents=True, exist_ok=True)
            subprocess.check_call(["cp", str(exe), str(bak_dir)])
            subprocess.check_call(["mv", str(bak_dir / exe.name), str(exe)])
            bak_dir.rmdir()
            metadata = "--preserve-metadata=identifier,entitlements,flags,runtime"
            cmd = ["codesign", "-s", "-", metadata, "-f", str(exe)]
            logging.debug("Changing Signature: %s", cmd)
            subprocess.check_call(cmd)
        except Exception:
            logging.fatal("Could not change MacOS code signing on copied python exe at %s", exe)
            raise


class CPython3macOsFramework(CPythonmacOsFramework, CPython3, CPythonPosix):
    def current_mach_o_image_path(self):
        return "@executable_path/../../../../Python3"

    def desired_mach_o_image_path(self):
        return "@executable_path/../.Python"

    @classmethod
    def sources(cls, interpreter):
        yield from super().sources(interpreter)

        # add a symlink to the host python image
        exe = Path(interpreter.prefix) / "Python3"
        yield PathRefToDest(exe, dest=lambda self, _: self.dest / ".Python", must=RefMust.SYMLINK)  # noqa: U101

    @property
    def reload_code(self):
        result = super().reload_code
        result = dedent(
            f"""
        # the bundled site.py always adds the global site package if we're on python framework build, escape this
        import sys
        before = sys._framework
        try:
            sys._framework = None
            {result}
        finally:
            sys._framework = before
        """,
        )
        return result


def fix_mach_o(exe, current, new, max_size):
    """
    https://en.wikipedia.org/wiki/Mach-O

    Mach-O, short for Mach object file format, is a file format for executables, object code, shared libraries,
    dynamically-loaded code, and core dumps. A replacement for the a.out format, Mach-O offers more extensibility and
    faster access to information in the symbol table.

    Each Mach-O file is made up of one Mach-O header, followed by a series of load commands, followed by one or more
    segments, each of which contains between 0 and 255 sections. Mach-O uses the REL relocation format to handle
    references to symbols. When looking up symbols Mach-O uses a two-level namespace that encodes each symbol into an
    'object/symbol name' pair that is then linearly searched for by first the object and then the symbol name.

    The basic structure—a list of variable-length "load commands" that reference pages of data elsewhere in the file—was
    also used in the executable file format for Accent. The Accent file format was in turn, based on an idea from Spice
    Lisp.

    With the introduction of Mac OS X 10.6 platform the Mach-O file underwent a significant modification that causes
    binaries compiled on a computer running 10.6 or later to be (by default) executable only on computers running Mac
    OS X 10.6 or later. The difference stems from load commands that the dynamic linker, in previous Mac OS X versions,
    does not understand. Another significant change to the Mach-O format is the change in how the Link Edit tables
    (found in the __LINKEDIT section) function. In 10.6 these new Link Edit tables are compressed by removing unused and
    unneeded bits of information, however Mac OS X 10.5 and earlier cannot read this new Link Edit table format.
    """
    try:
        logging.debug("change Mach-O for %s from %s to %s", exe, current, new)
        _builtin_change_mach_o(max_size)(exe, current, new)
    except Exception as e:
        logging.warning("Could not call _builtin_change_mac_o: %s. " "Trying to call install_name_tool instead.", e)
        try:
            cmd = ["install_name_tool", "-change", current, new, exe]
            subprocess.check_call(cmd)
        except Exception:
            logging.fatal("Could not call install_name_tool -- you must " "have Apple's development tools installed")
            raise


def _builtin_change_mach_o(maxint):
    MH_MAGIC = 0xFEEDFACE  # noqa: N806
    MH_CIGAM = 0xCEFAEDFE  # noqa: N806
    MH_MAGIC_64 = 0xFEEDFACF  # noqa: N806
    MH_CIGAM_64 = 0xCFFAEDFE  # noqa: N806
    FAT_MAGIC = 0xCAFEBABE  # noqa: N806
    BIG_ENDIAN = ">"  # noqa: N806
    LITTLE_ENDIAN = "<"  # noqa: N806
    LC_LOAD_DYLIB = 0xC  # noqa: N806

    class FileView:
        """A proxy for file-like objects that exposes a given view of a file. Modified from macholib."""

        def __init__(self, file_obj, start=0, size=maxint):
            if isinstance(file_obj, FileView):
                self._file_obj = file_obj._file_obj
            else:
                self._file_obj = file_obj
            self._start = start
            self._end = start + size
            self._pos = 0

        def __repr__(self):
            return f"<fileview [{self._start:d}, {self._end:d}] {self._file_obj!r}>"

        def tell(self):
            return self._pos

        def _checkwindow(self, seek_to, op):
            if not (self._start <= seek_to <= self._end):
                msg = f"{op} to offset {seek_to:d} is outside window [{self._start:d}, {self._end:d}]"
                raise OSError(msg)

        def seek(self, offset, whence=0):
            seek_to = offset
            if whence == os.SEEK_SET:
                seek_to += self._start
            elif whence == os.SEEK_CUR:
                seek_to += self._start + self._pos
            elif whence == os.SEEK_END:
                seek_to += self._end
            else:
                raise OSError(f"Invalid whence argument to seek: {whence!r}")
            self._checkwindow(seek_to, "seek")
            self._file_obj.seek(seek_to)
            self._pos = seek_to - self._start

        def write(self, content):
            here = self._start + self._pos
            self._checkwindow(here, "write")
            self._checkwindow(here + len(content), "write")
            self._file_obj.seek(here, os.SEEK_SET)
            self._file_obj.write(content)
            self._pos += len(content)

        def read(self, size=maxint):
            assert size >= 0
            here = self._start + self._pos
            self._checkwindow(here, "read")
            size = min(size, self._end - here)
            self._file_obj.seek(here, os.SEEK_SET)
            read_bytes = self._file_obj.read(size)
            self._pos += len(read_bytes)
            return read_bytes

    def read_data(file, endian, num=1):
        """Read a given number of 32-bits unsigned integers from the given file with the given endianness."""
        res = struct.unpack(endian + "L" * num, file.read(num * 4))
        if len(res) == 1:
            return res[0]
        return res

    def mach_o_change(at_path, what, value):
        """Replace a given name (what) in any LC_LOAD_DYLIB command found in the given binary with a new name (value),
        provided it's shorter."""

        def do_macho(file, bits, endian):
            # Read Mach-O header (the magic number is assumed read by the caller)
            cpu_type, cpu_sub_type, file_type, n_commands, size_of_commands, flags = read_data(file, endian, 6)
            # 64-bits header has one more field.
            if bits == 64:
                read_data(file, endian)
            # The header is followed by n commands
            for _ in range(n_commands):
                where = file.tell()
                # Read command header
                cmd, cmd_size = read_data(file, endian, 2)
                if cmd == LC_LOAD_DYLIB:
                    # The first data field in LC_LOAD_DYLIB commands is the offset of the name, starting from the
                    # beginning of the  command.
                    name_offset = read_data(file, endian)
                    file.seek(where + name_offset, os.SEEK_SET)
                    # Read the NUL terminated string
                    load = file.read(cmd_size - name_offset).decode()
                    load = load[: load.index("\0")]
                    # If the string is what is being replaced, overwrite it.
                    if load == what:
                        file.seek(where + name_offset, os.SEEK_SET)
                        file.write(value.encode() + b"\0")
                # Seek to the next command
                file.seek(where + cmd_size, os.SEEK_SET)

        def do_file(file, offset=0, size=maxint):
            file = FileView(file, offset, size)
            # Read magic number
            magic = read_data(file, BIG_ENDIAN)
            if magic == FAT_MAGIC:
                # Fat binaries contain nfat_arch Mach-O binaries
                n_fat_arch = read_data(file, BIG_ENDIAN)
                for _ in range(n_fat_arch):
                    # Read arch header
                    cpu_type, cpu_sub_type, offset, size, align = read_data(file, BIG_ENDIAN, 5)
                    do_file(file, offset, size)
            elif magic == MH_MAGIC:
                do_macho(file, 32, BIG_ENDIAN)
            elif magic == MH_CIGAM:
                do_macho(file, 32, LITTLE_ENDIAN)
            elif magic == MH_MAGIC_64:
                do_macho(file, 64, BIG_ENDIAN)
            elif magic == MH_CIGAM_64:
                do_macho(file, 64, LITTLE_ENDIAN)

        assert len(what) >= len(value)

        with open(at_path, "r+b") as f:
            do_file(f)

    return mach_o_change


__all__ = [
    "CPythonmacOsFramework",
    "CPython2macOsFramework",
    "CPython3macOsFramework",
]
PK鼷\���;[;[Avia_global_ref/builtin/cpython/__pycache__/mac_os.cpython-311.pycnu�[����

�|oir8��0�dZddlZddlZddlZddlZddlmZmZddlm	Z	ddl
mZddlm
Z
mZmZddlmZdd	lmZmZmZdd
lmZddlmZGd�d
ee���ZGd�dee��ZGd�deee��ZGd�deee��Zd�Zd�Zgd�Z dS)z:The Apple Framework builds require their own customization�N)�ABCMeta�abstractmethod)�Path)�dedent)�ExePathRefToDest�
PathRefToDest�RefMust)�IS_MAC_ARM64�)�CPython�CPythonPosix�is_mac_os_framework)�CPython2PosixBase)�CPython3c�~��eZdZe�fd���Z�fd�Ze�fd���Zed���Zed���Z	�xZ
S)�CPythonmacOsFrameworkc�d��t|��o t���|��S�N)r�super�can_describe��cls�interpreter�	__class__s  ���/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/builtin/cpython/mac_os.pyrz"CPythonmacOsFramework.can_describes(���"�;�/�/�U�E�G�G�4H�4H��4U�4U�U�c�����t���������}����}�jD]�}t|t��r�|jtj	ks�j
sk�j|jzg}�j
s&|�
�fd�|jD����|D]+}tt!|��||�jj���,��dS)Nc3�,�K�|]}�j|zV��dSr)�bin_dir)�.0�a�selfs  �r�	<genexpr>z/CPythonmacOsFramework.create.<locals>.<genexpr>&s*�����#J�#J��D�L�1�$4�#J�#J�#J�#J�#J�#Jr)r�create�desired_mach_o_image_path�current_mach_o_image_path�_sources�
isinstancer�mustr	�COPY�symlinksr�base�extend�aliases�
fix_mach_o�strr�max_size)r"�target�current�src�exes�exers`     �rr$zCPythonmacOsFramework.creates�����
���������/�/�1�1���0�0�2�2���=�	Y�	Y�C��#�/�0�0�
Y��8�w�|�+�+�4�=�+� �L�3�8�3�4�D��=�K����#J�#J�#J�#J�c�k�#J�#J�#J�J�J�J�#�Y�Y��"�3�s�8�8�W�f�d�>N�>W�X�X�X�X��	Y�	Yrc#��K�t���|��D]2\}}}}t|j��dzdzdzdzdz}||||fV��3dS)N�	Resourcesz
Python.app�Contents�MacOS�Python)r�_executablesr�prefix)rr�_�targetsr)�when�fixed_host_exers       �rr<z"CPythonmacOsFramework._executables*s������&+�g�g�&:�&:�;�&G�&G�	6�	6�"�A�w��d�"�+�"4�5�5��C�l�R�U_�_�bi�i�lt�t�N� �'�4��5�5�5�5�5�	6�	6rc��t�r��NotImplementedError�r"s rr&z/CPythonmacOsFramework.current_mach_o_image_path3���!�!rc��t�rrCrEs rr%z/CPythonmacOsFramework.desired_mach_o_image_path7rFr)�__name__�
__module__�__qualname__�classmethodrr$r<rr&r%�
__classcell__�rs@rrrs���������V�V�V�V��[�V�
Y�
Y�
Y�
Y�
Y��6�6�6�6��[�6��"�"��^�"��"�"��^�"�"�"�"�"rr)�	metaclassc�n��eZdZe�fd���Zd�Zd�Ze�fd���Ze�fd���Z	�xZ
S)�CPython2macOsFrameworkc���tsBt���|��r!t���|��SdS�NF)r
rr�
can_creaters  �rrSz!CPython2macOsFramework.can_create=sA����	3���� 4� 4�[� A� A�	3��7�7�%�%�k�2�2�2��urc�V�tj�|jjd��S�Nr;)�os�path�joinrr=rEs rr&z0CPython2macOsFramework.current_mach_o_image_pathCs���w�|�|�D�,�3�X�>�>�>rc��dS)Nz@executable_path/../Python�rEs rr%z0CPython2macOsFramework.desired_mach_o_image_pathFs��+�+rc#��K�t���|��Ed{V��|�|�|��d��\}}}t	||���V�t|j��dz}t	|d�tj���V�t|j��dz}t	|d����V�dS)Nzlib-dynload��destr;c��|jdzSrUr\�r"r>s  r�<lambda>z0CPython2macOsFramework.sources.<locals>.<lambda>Rs
��d�i�(�6J�r�r]r)r8c��|jdzS)Nr8r\r_s  rr`z0CPython2macOsFramework.sources.<locals>.<lambda>Vs
��D�I��<S�r)	r�sources�from_stdlib�mappingsrrr=r	r*)rr�exec_marker_file�to_pathr>r6�	resourcesrs       �rrczCPython2macOsFramework.sourcesIs�������7�7�?�?�;�/�/�/�/�/�/�/�/�/�'*���s�|�|�K�7P�7P�R_�'`�'`�$��'�1��,�7�;�;�;�;�;�;��;�%�&�&��1���C�&J�&J�QX�Q]�^�^�^�^�^�^���+�,�,�{�:�	��I�,S�,S�T�T�T�T�T�T�T�Trc�T��t��j}td|�d���}|S)Na(
        # the bundled site.py always adds the global site package if we're on python framework build, escape this
        import sysconfig
        config = sysconfig.get_config_vars()
        before = config["PYTHONFRAMEWORK"]
        try:
            config["PYTHONFRAMEWORK"] = ""
            zI
        finally:
            config["PYTHONFRAMEWORK"] = before
        �r�reload_coder�r"�resultrs  �rrkz"CPython2macOsFramework.reload_codeXs>������$���

��

�

�

�
�
���
r)rHrIrJrKrSr&r%rc�propertyrkrLrMs@rrPrP<s��������������[��
?�?�?�,�,�,��U�U�U�U��[�U�������X�����rrPc�>��eZdZe�fd���Z�fd�Zd�Z�xZS)�CPython2macOsArmFrameworkc���trPtt|���|��r(tt|���|��SdSrR)r
rrrrSrs  �rrSz$CPython2macOsArmFramework.can_createlsQ����	M�E�"7��=�=�J�J�;�W�W�	M��.��4�4�?�?��L�L�L��urc�~��tt|�����|���dSr)rrPr$�
fix_signature)r"rs �rr$z CPython2macOsArmFramework.creaters8���
�$�d�+�+�2�2�4�4�4��������rc�F�|j}	tjd|��|jdz}|�dd���tjdt|��t|��g��tjdt||jz��t|��g��|�	��d}dd	d
|dt|��g}tjd|��tj|��dS#t$rtjd
|���wxYw)a
        On Apple M1 machines (arm64 chips),  rewriting the python executable invalidates its signature.
        In python2 this results in a unusable python exe which just dies.
        As a temporary workaround we can codesign the python exe during the creation process.
        z*Changing signature of copied python exe %s�bkT)�parents�exist_ok�cp�mvz9--preserve-metadata=identifier,entitlements,flags,runtime�codesignz-s�-z-fzChanging Signature: %sz>Could not change MacOS code signing on copied python exe at %sN)r6�logging�debug�parent�mkdir�
subprocess�
check_callr0�name�rmdir�	Exception�fatal)r"r6�bak_dir�metadata�cmds     rrsz'CPython2macOsArmFramework.fix_signaturevs���h��	��M�F��L�L�L��j�4�'�G�
�M�M�$��M�6�6�6��!�4��S���3�w�<�<�"@�A�A�A��!�4��W�s�x�-?�)@�)@�#�c�(�(�"K�L�L�L��M�M�O�O�O�R�H��t�S�(�D�#�c�(�(�C�C��M�2�C�8�8�8��!�#�&�&�&�&�&���	�	�	��M�Z�\_�`�`�`��	���s�C4C?�?!D )rHrIrJrKrSr$rsrLrMs@rrprpksj�������������[��
�����������rrpc�T��eZdZd�Zd�Ze�fd���Ze�fd���Z�xZ	S)�CPython3macOsFrameworkc��dS)Nz$@executable_path/../../../../Python3rZrEs rr&z0CPython3macOsFramework.current_mach_o_image_path�s��5�5rc��dS)Nz@executable_path/../.PythonrZrEs rr%z0CPython3macOsFramework.desired_mach_o_image_path�s��,�,rc#���K�t���|��Ed{V��t|j��dz}t	|d�t
j���V�dS)N�Python3c��|jdzS)Nz.Pythonr\r_s  rr`z0CPython3macOsFramework.sources.<locals>.<lambda>�s
��d�i�)�6K�rra)rrcrr=rr	�SYMLINK)rrr6rs   �rrczCPython3macOsFramework.sources�so������7�7�?�?�;�/�/�/�/�/�/�/�/�/��;�%�&�&��2���C�&K�&K�RY�Ra�b�b�b�b�b�b�b�brc�T��t��j}td|�d���}|S)Nz�
        # the bundled site.py always adds the global site package if we're on python framework build, escape this
        import sys
        before = sys._framework
        try:
            sys._framework = None
            z>
        finally:
            sys._framework = before
        rjrls  �rrkz"CPython3macOsFramework.reload_code�s>������$���	
��
	
�	
�	
�
�
���
r)
rHrIrJr&r%rKrcrnrkrLrMs@rr�r��s��������6�6�6�-�-�-��c�c�c�c��[�c�������X�����rr�c�D�	tjd|||��t|��|||��dS#t$r`}tjd|��	dd|||g}tj|��n##t$rtjd���wxYwYd}~dSd}~wwxYw)u�
    https://en.wikipedia.org/wiki/Mach-O

    Mach-O, short for Mach object file format, is a file format for executables, object code, shared libraries,
    dynamically-loaded code, and core dumps. A replacement for the a.out format, Mach-O offers more extensibility and
    faster access to information in the symbol table.

    Each Mach-O file is made up of one Mach-O header, followed by a series of load commands, followed by one or more
    segments, each of which contains between 0 and 255 sections. Mach-O uses the REL relocation format to handle
    references to symbols. When looking up symbols Mach-O uses a two-level namespace that encodes each symbol into an
    'object/symbol name' pair that is then linearly searched for by first the object and then the symbol name.

    The basic structure—a list of variable-length "load commands" that reference pages of data elsewhere in the file—was
    also used in the executable file format for Accent. The Accent file format was in turn, based on an idea from Spice
    Lisp.

    With the introduction of Mac OS X 10.6 platform the Mach-O file underwent a significant modification that causes
    binaries compiled on a computer running 10.6 or later to be (by default) executable only on computers running Mac
    OS X 10.6 or later. The difference stems from load commands that the dynamic linker, in previous Mac OS X versions,
    does not understand. Another significant change to the Mach-O format is the change in how the Link Edit tables
    (found in the __LINKEDIT section) function. In 10.6 these new Link Edit tables are compressed by removing unused and
    unneeded bits of information, however Mac OS X 10.5 and earlier cannot read this new Link Edit table format.
    z"change Mach-O for %s from %s to %szSCould not call _builtin_change_mac_o: %s. Trying to call install_name_tool instead.�install_name_toolz-changezUCould not call install_name_tool -- you must have Apple's development tools installedN)r|r}�_builtin_change_mach_or��warningr�r�r�)r6r3�newr1�er�s      rr/r/�s���0
��
�:�C��#�N�N�N�(��x�(�(��g�s�;�;�;�;�;��������p�rs�t�t�t�	�&�	�7�C��E�C��!�#�&�&�&�&���	�	�	��M�t�u�u�u��	����
'�&�&�&�&�&�����	���s,�15�
B�B�A1�0B�1 B�B�Bc����������	�
��d�	d�d�
d�d�d�d�d�G��fd	�d
���dd����������	�
��fd
�}|S)Nl�z�}l�m�l�z�}l�m�l�:��>�<�c�N��eZdZdZd�f�fd�	Zd�Zd�Zd�Zdd�Zd�Z	�fd	�Z
d
S)�(_builtin_change_mach_o.<locals>.FileViewzZA proxy for file-like objects that exposes a given view of a file. Modified from macholib.rc���t|���r
|j|_n||_||_||z|_d|_dS)Nr)r(�	_file_obj�_start�_end�_pos)r"�file_obj�start�size�FileViews    �r�__init__z1_builtin_change_mach_o.<locals>.FileView.__init__�sE����(�H�-�-�
*�!)�!3����!)����D�K����D�I��D�I�I�Irc�<�d|jd�d|jd�d|j�d�S)Nz<fileview [�d�, z] r�)r�r�r�rEs r�__repr__z1_builtin_change_mach_o.<locals>.FileView.__repr__�s/��T���T�T�T�$�)�T�T�T���T�T�T�Trc��|jSr)r�rEs r�tellz-_builtin_change_mach_o.<locals>.FileView.tell�s
���9�rc��|j|cxkr|jks,n|�d|d�d|jd�d|jd�d�}t|���dS)Nz to offset r�z is outside window [r��])r�r��OSError)r"�seek_to�op�msgs    r�_checkwindowz5_builtin_change_mach_o.<locals>.FileView._checkwindow�sn���K�7�7�7�7�7�d�i�7�7�7�7��f�f��f�f�f�t�{�f�f�f�X\�Xa�f�f�f�f���c�l�l�"�8�7rc�^�|}|tjkr||jz
}nP|tjkr||j|jzz
}n-|tjkr||jz
}ntd|�����|�|d��|j	�
|��||jz
|_dS)Nz!Invalid whence argument to seek: �seek)rV�SEEK_SETr��SEEK_CURr��SEEK_ENDr�r�r�r�r�)r"�offset�whencer�s    rr�z-_builtin_change_mach_o.<locals>.FileView.seek�s����G����$�$��4�;�&����2�;�&�&��4�;���2�2����2�;�&�&��4�9�$����L�&�L�L�M�M�M����g�v�.�.�.��N����(�(�(��$�+�-�D�I�I�Irc�T�|j|jz}|�|d��|�|t|��zd��|j�|tj��|j�|��|xjt|��z
c_dS)N�write)	r�r�r��lenr�r�rVr�r�)r"�content�heres   rr�z._builtin_change_mach_o.<locals>.FileView.writes����;���*�D����d�G�,�,�,����d�S��\�\�1�7�;�;�;��N����b�k�2�2�2��N� � ��)�)�)��I�I��W���%�I�I�I�Irc�H�|dksJ�|j|jz}|�|d��t||j|z
��}|j�|tj��|j�	|��}|xjt|��z
c_|S)Nr�read)r�r�r��minr�r�r�rVr�r�r�)r"r�r��
read_bytess    rr�z-_builtin_change_mach_o.<locals>.FileView.reads����1�9�9�9�9��;���*�D����d�F�+�+�+��t�T�Y��-�.�.�D��N����b�k�2�2�2���,�,�T�2�2�J��I�I��Z���(�I�I��rN)r)rHrIrJ�__doc__r�r�r�r�r�r�r�)r��maxints��rr�r��s��������h�h�+,�6�	�	�	�	�	�	�	U�	U�	U�	�	�	�	#�	#�	#�
	.�	.�	.�	.�	&�	&�	&�#�	�	�	�	�	�	rr�rc��tj|d|zz|�|dz����}t|��dkr|dS|S)z_Read a given number of 32-bits unsigned integers from the given file with the given endianness.�L�rr)�struct�unpackr�r�)�file�endian�num�ress    r�	read_dataz)_builtin_change_mach_o.<locals>.read_datasI���m�F�S�3�Y�.��	�	�#��'�0B�0B�C�C���s�8�8�q�=�=��q�6�M��
rc���������	���fd��d�f����
���
����fd�	�t���t���ksJ�t|d��5}�|��ddd��dS#1swxYwYdS)z�Replace a given name (what) in any LC_LOAD_DYLIB command found in the given binary with a new name (value),
        provided it's shorter.c����||d��\}}}}}}|dkr�||��t|��D�]}	|���}
�||d��\}}|�kr��||��}
|�|
|
ztj��|�||
z
�����}|d|�d���}|�krM|�|
|
ztj��|���	��dz��|�|
|ztj����dS)N��@���)
�ranger�r�rVr�r��decode�indexr��encode)r��bitsr��cpu_type�cpu_sub_type�	file_type�
n_commands�size_of_commands�flagsr>�wherer��cmd_size�name_offset�load�
LC_LOAD_DYLIBr��value�whats               ����r�do_machoz?_builtin_change_mach_o.<locals>.mach_o_change.<locals>.do_macho!s`���U^�U^�_c�ek�mn�Uo�Uo�R�H�l�I�z�;K�U��r�z�z��	�$��'�'�'��:�&�&�
9�
9���	�	���� )�	�$��� :� :�
��X��-�'�'�#,�)�D�&�"9�"9�K��I�I�e�k�1�2�;�?�?�?��9�9�X��%;�<�<�C�C�E�E�D�� 2�$�*�*�T�"2�"2� 2�3�D��t�|�|��	�	�%�+�"5�r�{�C�C�C��
�
�5�<�<�>�>�E�#9�:�:�:��	�	�%�(�*�B�K�8�8�8�8�#
9�
9rrc�n���|||��}�|�	��}|�
kr@�|�	��}t|��D]"}�|�	d��\}}}}}�|||���#dS|�kr�|d�	��dS|�
kr�|d���dS|�kr�|d�	��dS|�kr�|d���dSdS)N�� r�)r�)r�r�r��magic�
n_fat_archr>r�r��align�
BIG_ENDIAN�	FAT_MAGICr��
LITTLE_ENDIAN�MH_CIGAM�MH_CIGAM_64�MH_MAGIC�MH_MAGIC_64�do_filer�r�s         �����������rr�z>_builtin_change_mach_o.<locals>.mach_o_change.<locals>.do_file;s9����8�D�&�$�/�/�D��I�d�J�/�/�E��	�!�!�&�Y�t�Z�8�8�
��z�*�*�0�0�A�BK�)�D�R\�^_�B`�B`�?�H�l�F�D�%��G�D�&�$�/�/�/�/�0�0��(�"�"����r�:�.�.�.�.�.��(�"�"����r�=�1�1�1�1�1��+�%�%����r�:�.�.�.�.�.��+�%�%����r�=�1�1�1�1�1�&�%rzr+bN)r��open)�at_pathr�r��fr�r�r�r�r�r�r�r�r�r�r�r�r�s `` @@�����������r�
mach_o_changez-_builtin_change_mach_o.<locals>.mach_o_changes#�������	9�	9�	9�	9�	9�	9�	9�	9�4"#��	2�	2�	2�	2�	2�	2�	2�	2�	2�	2�	2�	2�	2�	2�	2�	2�(�4�y�y�C��J�J�&�&�&�&�
�'�5�
!�
!�	�Q��G�A�J�J�J�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�A+�+A/�2A/)rrZ)r�r�r�r�r�r�r�r�r�r�r�r�s` @@@@@@@@@@rr�r��s���������������H��H��K��K��I��J��M��M�5�5�5�5�5�5�5�5�5�5�5�n����5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�n�r)rrPr�)!r�r|rVr�r��abcrr�pathlibr�textwrapr�,virtualenv.create.via_global_ref.builtin.refrrr	�virtualenv.infor
�commonrr
r�cpython2r�cpython3rrrPrpr�r/r��__all__rZrr�<module>rs���@�@�����	�	�	�	�
�
�
�
�����'�'�'�'�'�'�'�'�����������������������
)�(�(�(�(�(�>�>�>�>�>�>�>�>�>�>�'�'�'�'�'�'�������#"�#"�#"�#"�#"�G�w�#"�#"�#"�#"�L,�,�,�,�,�2�4E�,�,�,�^!�!�!�!�!� 6�8M�O`�!�!�!�H�����2�H�l����B"�"�"�J���D�����rPK鼷\�N~
44Cvia_global_ref/builtin/cpython/__pycache__/cpython2.cpython-311.pycnu�[����

�|oi�
����ddlZddlZddlmZddlmZddlmZddlm	Z	m
Z
mZmZGd�d	e	eej
�
��ZGd�dee
ej
�
��ZGd
�de��ZGd�dee��Zgd�ZdS)�N)�Path)�
PathRefToDest�)�Python2�)�CPython�CPythonPosix�CPythonWindows�is_mac_os_frameworkc���eZdZdZe�fd���Zed���Zed���Zed���Z	ed���Z
�fd�Z�xZS)�CPython2z/Create a CPython version 2  virtual environmentc#���K�t���|��Ed{V��|�|��}|���rt	|jd����V�dSdS)Nc��|jS�N)�include)�self�_s  ��/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/builtin/cpython/cpython2.py�<lambda>z"CPython2.sources.<locals>.<lambda>s
��QU�Q]����dest)�super�sources�host_include_marker�existsr�parent)�cls�interpreterr�	__class__s   �rrzCPython2.sourcess�������7�7�?�?�;�/�/�/�/�/�/�/�/�/�!�5�5�k�B�B���%�%�'�'�	_�� 3� :�A]�A]�^�^�^�^�^�^�^�^�	_�	_rc��dS�NF��rs r�needs_stdlib_py_modulezCPython2.needs_stdlib_py_modules���urc�0�t|j��dzS)NzPython.h)r�system_include)rrs  rrzCPython2.host_include_markers���K�.�/�/�*�<�<rc�P�|j|j�d��zjS)N�headers)rr�install_pathr)rs rrzCPython2.includes%���	�D�,�9�9�)�D�D�D�L�Lrc��dgS)N�osr#r$s r�moduleszCPython2.modules#s	���v�
rc���t�����}|�|j��}|���r |�|jj��ntj	d|��|S)Nz2no include folders as can't find include marker %s)
r�ensure_directoriesrrr�addrr�logging�debug)r�dirsrr s   �rr/zCPython2.ensure_directories'sw����w�w�)�)�+�+��"�6�6�t�7G�H�H���%�%�'�'�	e��H�H�T�\�(�)�)�)�)��M�N�Pc�d�d�d��r)
�__name__�
__module__�__qualname__�__doc__�classmethodrr%r�propertyrr-r/�
__classcell__�r s@rr
r
s��������9�9��_�_�_�_��[�_�����[���=�=��[�=��M�M��X�M�����[����������rr
)�	metaclassc�2��eZdZdZe�fd���Z�xZS)�CPython2PosixBasez9common to macOs framework builds and other posix CPython2c#���K�t���|��Ed{V��t|jd��}|���rft|���|j��rA|�t|j�����t|�fd����V�dSdSdS)N�makefile_filenamec���|j�zSrr)r�s�under_prefixs  �rrz+CPython2PosixBase.sources.<locals>.<lambda><s����	�L�@X�rr)
rrr�	sysconfigr�str�
startswith�prefix�relative_tor)rr�	make_filerCr s   @�rrzCPython2PosixBase.sources4s��������7�7�?�?�;�/�/�/�/�/�/�/�/�/���.�/B�C�D�D�	������	Z�#�i�.�.�";�";�K�<N�"O�"O�	Z�$�0�0��k�6H�1I�1I�J�J�L��	�0X�0X�0X�0X�Y�Y�Y�Y�Y�Y�Y�Y�	Z�	Z�	Z�	Zr�r4r5r6r7r8rr:r;s@rr>r>1sQ�������C�C��Z�Z�Z�Z��[�Z�Z�Z�Z�Zrr>c�L��eZdZdZe�fd���Ze�fd���Z�xZS)�
CPython2Posixz5CPython 2 on POSIX (excluding macOs framework builds)c�h��t|��duo t���|��Sr")rr�can_describe)rrr s  �rrNzCPython2Posix.can_describeBs.���"�;�/�/�5�8�^�U�W�W�=Q�=Q�R]�=^�=^�^rc#���K�t���|��Ed{V��|�|�|��d��\}}}t	||���V�dS)Nzlib-dynloadr)rr�from_stdlib�mappingsr)rr�exec_marker_file�to_pathrr s     �rrzCPython2Posix.sourcesFsw������7�7�?�?�;�/�/�/�/�/�/�/�/�/�'*���s�|�|�K�7P�7P�R_�'`�'`�$��'�1��,�7�;�;�;�;�;�;�;�;r)r4r5r6r7r8rNrr:r;s@rrLrL?sr�������?�?��_�_�_�_��[�_��<�<�<�<��[�<�<�<�<�<rrLc�2��eZdZdZe�fd���Z�xZS)�CPython2WindowszCPython 2 on Windowsc#�l�K�t���|��Ed{V��t|j��jdz}|���rt
||j���V�t|j��dz}|���rt
|d����V�dSdS)Nzpython27.dllr�libsc� �|j|jzSr)r�name)rrBs  rrz)CPython2Windows.sources.<locals>.<lambda>Zs��4�9�q�v�;M�r)	rrr�system_executablerrr�to_bin�
system_prefix)rr�py27_dllrWr s    �rrzCPython2Windows.sourcesQs�������7�7�?�?�;�/�/�/�/�/�/�/�/�/���5�6�6�=��N���?�?���	;���s�z�:�:�:�:�:�:��K�-�.�.��7���;�;�=�=�	O���+M�+M�N�N�N�N�N�N�N�N�	O�	OrrJr;s@rrUrUNsQ����������O�O�O�O��[�O�O�O�O�OrrU)r
r>rLrU)�abcr1�pathlibr�,virtualenv.create.via_global_ref.builtin.refr�python2.python2r�commonrr	r
r�ABCMetar
r>rLrU�__all__r#rr�<module>resY��
�
�
�
�����������F�F�F�F�F�F�%�%�%�%�%�%�N�N�N�N�N�N�N�N�N�N�N�N�#�#�#�#�#�w��3�;�#�#�#�#�LZ�Z�Z�Z�Z��,�#�+�Z�Z�Z�Z�<�<�<�<�<�%�<�<�<�O�O�O�O�O�h��O�O�O������rPK鼷\a_����Cvia_global_ref/builtin/cpython/__pycache__/__init__.cpython-311.pycnu�[����

�|oi���dS)N�r���/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/builtin/cpython/__init__.py�<module>rs���rPK鼷\�(V��Cvia_global_ref/builtin/cpython/__pycache__/cpython3.cpython-311.pycnu�[����

�|oi����ddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZddlmZd	d
lmZmZmZmZGd�deeej�
��ZGd�dee��ZGd�dee��Zgd�ZdS)�N)�chain)�methodcaller)�Path)�dedent)�Python3Supports)�
PathRefToDest)�is_store_python�)�CPython�CPythonPosix�CPythonWindows�is_mac_os_frameworkc��eZdZdZdS)�CPython3zCPython 3 or laterN)�__name__�
__module__�__qualname__�__doc__����/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/builtin/cpython/cpython3.pyrrs���������rr)�	metaclassc�N��eZdZe�fd���Z�fd�Zed���Z�xZS)�
CPython3Posixc�h��t|��duo t���|��S)NF)r�super�can_describe��cls�interpreter�	__class__s  �rrzCPython3Posix.can_describes.���"�;�/�/�5�8�^�U�W�W�=Q�=Q�R]�=^�=^�^rc���t�����}|�|j��r|t	d��z
}|S)Na
                # for https://github.com/python/cpython/pull/9516, see https://github.com/pypa/virtualenv/issues/1704
                import os
                if "__PYVENV_LAUNCHER__" in os.environ:
                    del os.environ["__PYVENV_LAUNCHER__"]
                )r�env_patch_text�pyvenv_launch_patch_activer r)�self�textr!s  �rr#zCPython3Posix.env_patch_textsS����w�w�%�%�'�'���*�*�4�+;�<�<�	��F����
�D��rc�f�|j}|jdkod|cxkodkncpd|cxkodkncS)N�darwin)���)r)r*)r)r+r))r)r+)�version_info�platform)rr �vers   rr$z(CPython3Posix.pyvenv_launch_patch_active%s]���&���#�x�/�l�Y��5N�5N�5N�5N��5N�5N�5N�5N�5k�R[�^a�Rk�Rk�Rk�Rk�ek�Rk�Rk�Rk�Rk�lr)rrr�classmethodrr#r$�
__classcell__�r!s@rrrs���������_�_�_�_��[�_�������m�m��[�m�m�m�m�mrrc����eZdZdZe�fd���Zed���Ze�fd���Zed���Zed���Z	e�fd���Z
ed���Zed	���Z�xZ
S)
�CPython3Windows� c�h��t|��rdSt���|��S�N)r	r�
setup_metars  �rr7zCPython3Windows.setup_meta.s0����;�'�'�	��4��w�w�!�!�+�.�.�.rc#�K�|�|��r|�|��}nJt|�|��|�|��|�|����}|Ed{V��dSr6)�has_shim�executablesr�dll_and_pyd�
python_zip)rr �refss   r�sourceszCPython3Windows.sources4s������<�<��$�$�	��?�?�;�/�/�D�D������,�,�����,�,����{�+�+���D�
���������rc�F��t���|��Sr6)rr>rs  �rr:zCPython3Windows.executables@s����w�w���{�+�+�+rc�P�|jjdko|�|��duS)Nr*)r,�minor�shim)rr s  rr9zCPython3Windows.has_shimDs*���'�-��2�X�s�x�x��7L�7L�TX�7X�Xrc�r�t|j��dzdzdzdz}|���r|SdS)N�venv�scripts�ntz
python.exe)r�
system_stdlib�exists)rr rBs   rrBzCPython3Windows.shimHs@���K�-�.�.��7�)�C�d�J�\�Y���;�;�=�=�	��K��trc���|�|��r|�|��St���|��Sr6)r9rBr�host_pythonrs  �rrJzCPython3Windows.host_pythonOsC����<�<��$�$�	)��8�8�K�(�(�(��w�w�"�"�;�/�/�/rc#�6K�t|j��jg}t|j��dz}|���r|�|��|D]9}|���D]"}|jdvrt||j	��V��#�:dS)N�DLLs)z.pydz.dll)
r�system_executable�parent�
system_prefix�is_dir�append�iterdir�suffixr�to_bin)rr �folders�
dll_folder�folder�files      rr;zCPython3Windows.dll_and_pydWs�������5�6�6�=�>���+�3�4�4�v�=�
������	'��N�N�:�&�&�&��	:�	:�F����(�(�
:�
:���;�"2�2�2�'��c�j�9�9�9�9�9��
:�	:�	:rc#�K�d|j�d�}tj|j|��}t	t
|��}tt
d��|��}t|d��}|�t||j	��V�dSdS)a�
        "python{VERSION}.zip" contains compiled *.pyc std lib packages, where
        "VERSION" is `py_version_nodot` var from the `sysconfig` module.
        :see: https://docs.python.org/3/using/windows.html#the-embeddable-package
        :see: `discovery.py_info.PythonInfo` class (interpreter).
        :see: `python -m sysconfig` output.

        :note: The embeddable Python distribution for Windows includes
        "python{VERSION}.zip" and "python{VERSION}._pth" files. User can
        move/rename *zip* file and edit `sys.path` by editing *_pth* file.
        Here the `pattern` is used only for the default *zip* file name!
        z*pythonz.ziprHN)
�
version_nodot�fnmatch�filter�path�mapr�method�nextrrT)rr �pattern�matches�
matched_paths�existing_pathsr]s       rr<zCPython3Windows.python_zipfs�����<�K�5�;�;�;���.��!1�7�;�;���D�'�*�*�
���x� 0� 0�-�@�@���N�D�)�)������c�j�1�1�1�1�1�1�1��r)rrrrr/r7r>r:r9rBrJr;r<r0r1s@rr3r3+s��������G��/�/�/�/��[�/�
�	�	��[�	��,�,�,�,��[�,��Y�Y��[�Y�����[���0�0�0�0��[�0��:�:��[�:��2�2��[�2�2�2�2�2rr3)rrr3)�abcr[�	itertoolsr�operatorrr_�pathlibr�textwrapr�virtualenv.create.describer�,virtualenv.create.via_global_ref.builtin.refr�&virtualenv.create.via_global_ref.storer	�commonrrr
r�ABCMetarrr3�__all__rrr�<module>rpsl��
�
�
�
�����������+�+�+�+�+�+�������������6�6�6�6�6�6�F�F�F�F�F�F�B�B�B�B�B�B�N�N�N�N�N�N�N�N�N�N�N�N������w��3�;�����m�m�m�m�m�L�(�m�m�m�0O2�O2�O2�O2�O2�n�h�O2�O2�O2�d�����rPK鼷\������Avia_global_ref/builtin/cpython/__pycache__/common.cpython-311.pycnu�[����

�|oi	����ddlmZddlmZddlmZddlmZmZddl	m
Z
mZddlm
Z
Gd�d	e
e�
��ZGd�deee�
��ZGd
�deee�
��Zd�Zgd�ZdS)�)�ABCMeta)�OrderedDict)�Path)�
PosixSupports�WindowsSupports)�RefMust�RefWhen�)�ViaGlobalRefVirtualenvBuiltinc�D��eZdZe�fd���Zed���Z�xZS)�CPythonc�\��|jdko t���|��S)Nr
)�implementation�super�can_describe)�cls�interpreter�	__class__s  ���/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/builtin/cpython/common.pyrzCPython.can_describes)����)�Y�6�\�5�7�7�;O�;O�P[�;\�;\�\�c��dS)N�python�)rs r�exe_stemzCPython.exe_stems���xr)�__name__�
__module__�__qualname__�classmethodrr�
__classcell__)rs@rr
r
sb��������]�]�]�]��[�]�����[�����rr
)�	metaclassc�(�eZdZdZed���ZdS)�CPythonPosixz7Create a CPython virtual environment on POSIX platformsc	#�jK�t|j��}|jj|jj}}td�dd|��d|�d|��|jfD����}|jjdkrtjntj	}|t|�����|tj
fV�dS)Nc3�K�|]}|dfV��	dS�Nr)�.0�is  r�	<genexpr>z,CPythonPosix._executables.<locals>.<genexpr>s&����w�w�A�q�$�i�w�w�w�w�w�wrr�.r
)r�system_executable�version_info�major�minorr�namer�COPY�NA�list�keysr	�ANY)rr�host_exer,r-�targets�musts       r�_executableszCPythonPosix._executabless�������5�6�6��"�/�5�{�7O�7U�u���w�w�(�<L�U�<L�<L�Nf�W\�Nf�Nf�_d�Nf�Nf�hp�hu�1v�w�w�w�w�w��*�7�=��B�B�w�|�|��
����W�\�\�^�^�,�,�d�G�K�?�?�?�?�?�?rN)rrr�__doc__rr7rrrr"r"s8������A�A��@�@��[�@�@�@rr"c�:�eZdZed���Zed���ZdS)�CPythonWindowsc#��K�|�|����fd�d�jhD��D]$}�|jgtjtjfV��%�jdz}||jgtjtjfV�dS)Nc3�,�K�|]}�j|zV��dSr%)�parent)r&�n�hosts  �rr(z.CPythonWindows._executables.<locals>.<genexpr>(s)�����H�H��T�[�1�_�H�H�H�H�H�Hrz
python.exezpythonw.exe)�host_pythonr.rr/r	r3r=)rr�path�python_wr?s    @rr7zCPythonWindows._executables"s������
���{�+�+��H�H�H�H�|�T�Y�.G�H�H�H�	?�	?�D�����W�\�7�;�>�>�>�>�>��;��.��������w�{�B�B�B�B�B�Brc�*�t|j��Sr%)rr*)rrs  rr@zCPythonWindows.host_python.s���K�1�2�2�2rN)rrrrr7r@rrrr:r:!sK�������	C�	C��[�	C��3�3��[�3�3�3rr:c��|jdkr4|j�d��}|jjdkrdnd}||kSdS)N�darwin�PYTHONFRAMEWORK��Python3�PythonF)�platform�sysconfig_vars�getr+r,)r�
framework_var�values   r�is_mac_os_frameworkrO3sP����x�'�'�#�2�6�6�7H�I�I�
�(�5�;�q�@�@�	�	�h����%�%��5r)r
r"r:rON)�abcr�collectionsr�pathlibr�virtualenv.create.describerr�,virtualenv.create.via_global_ref.builtin.refrr	�via_global_self_dorr
r"r:rO�__all__rrr�<module>rWsB��������#�#�#�#�#�#�������E�E�E�E�E�E�E�E�I�I�I�I�I�I�I�I�>�>�>�>�>�>������+�w�����	@�	@�	@�	@�	@�7�M�W�	@�	@�	@�	@�3�3�3�3�3�W�o��3�3�3�3�$��������rPK鼷\�yƟ*via_global_ref/builtin/cpython/cpython3.pynu�[���import abc
import fnmatch
from itertools import chain
from operator import methodcaller as method
from pathlib import Path
from textwrap import dedent

from virtualenv.create.describe import Python3Supports
from virtualenv.create.via_global_ref.builtin.ref import PathRefToDest
from virtualenv.create.via_global_ref.store import is_store_python

from .common import CPython, CPythonPosix, CPythonWindows, is_mac_os_framework


class CPython3(CPython, Python3Supports, metaclass=abc.ABCMeta):
    """CPython 3 or later"""


class CPython3Posix(CPythonPosix, CPython3):
    @classmethod
    def can_describe(cls, interpreter):
        return is_mac_os_framework(interpreter) is False and super().can_describe(interpreter)

    def env_patch_text(self):
        text = super().env_patch_text()
        if self.pyvenv_launch_patch_active(self.interpreter):
            text += dedent(
                """
                # for https://github.com/python/cpython/pull/9516, see https://github.com/pypa/virtualenv/issues/1704
                import os
                if "__PYVENV_LAUNCHER__" in os.environ:
                    del os.environ["__PYVENV_LAUNCHER__"]
                """,
            )
        return text

    @classmethod
    def pyvenv_launch_patch_active(cls, interpreter):
        ver = interpreter.version_info
        return interpreter.platform == "darwin" and ((3, 7, 8) > ver >= (3, 7) or (3, 8, 3) > ver >= (3, 8))


class CPython3Windows(CPythonWindows, CPython3):
    """ """

    @classmethod
    def setup_meta(cls, interpreter):
        if is_store_python(interpreter):  # store python is not supported here
            return None
        return super().setup_meta(interpreter)

    @classmethod
    def sources(cls, interpreter):
        if cls.has_shim(interpreter):
            refs = cls.executables(interpreter)
        else:
            refs = chain(
                cls.executables(interpreter),
                cls.dll_and_pyd(interpreter),
                cls.python_zip(interpreter),
            )
        yield from refs

    @classmethod
    def executables(cls, interpreter):
        return super().sources(interpreter)

    @classmethod
    def has_shim(cls, interpreter):
        return interpreter.version_info.minor >= 7 and cls.shim(interpreter) is not None

    @classmethod
    def shim(cls, interpreter):
        shim = Path(interpreter.system_stdlib) / "venv" / "scripts" / "nt" / "python.exe"
        if shim.exists():
            return shim
        return None

    @classmethod
    def host_python(cls, interpreter):
        if cls.has_shim(interpreter):
            # starting with CPython 3.7 Windows ships with a venvlauncher.exe that avoids the need for dll/pyd copies
            # it also means the wrapper must be copied to avoid bugs such as https://bugs.python.org/issue42013
            return cls.shim(interpreter)
        return super().host_python(interpreter)

    @classmethod
    def dll_and_pyd(cls, interpreter):
        folders = [Path(interpreter.system_executable).parent]

        # May be missing on some Python hosts.
        # See https://github.com/pypa/virtualenv/issues/2368
        dll_folder = Path(interpreter.system_prefix) / "DLLs"
        if dll_folder.is_dir():
            folders.append(dll_folder)

        for folder in folders:
            for file in folder.iterdir():
                if file.suffix in (".pyd", ".dll"):
                    yield PathRefToDest(file, cls.to_bin)

    @classmethod
    def python_zip(cls, interpreter):
        """
        "python{VERSION}.zip" contains compiled *.pyc std lib packages, where
        "VERSION" is `py_version_nodot` var from the `sysconfig` module.
        :see: https://docs.python.org/3/using/windows.html#the-embeddable-package
        :see: `discovery.py_info.PythonInfo` class (interpreter).
        :see: `python -m sysconfig` output.

        :note: The embeddable Python distribution for Windows includes
        "python{VERSION}.zip" and "python{VERSION}._pth" files. User can
        move/rename *zip* file and edit `sys.path` by editing *_pth* file.
        Here the `pattern` is used only for the default *zip* file name!
        """
        pattern = f"*python{interpreter.version_nodot}.zip"
        matches = fnmatch.filter(interpreter.path, pattern)
        matched_paths = map(Path, matches)
        existing_paths = filter(method("exists"), matched_paths)
        path = next(existing_paths, None)
        if path is not None:
            yield PathRefToDest(path, cls.to_bin)


__all__ = [
    "CPython3",
    "CPython3Posix",
    "CPython3Windows",
]
PK鼷\*via_global_ref/builtin/cpython/__init__.pynu�[���PK鼷\.�%���0via_global_ref/__pycache__/store.cpython-311.pycnu�[����

�|oif��&�ddlmZd�Zd�ZddgZdS)�)�Pathc�2�t|��rd|_|S)NzFWindows Store Python does not support virtual environments via symlink)�is_store_python�
symlink_error)�meta�interpreters  �x/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/store.py�handle_store_pythonr
s ���{�#�#�f�e����K�c��t|j��j}t|��dkoM|ddkoA|ddko5|d�d��o|d�d	��S)
N�����	Microsoft����WindowsApps���z"PythonSoftwareFoundation.Python.3.����python)r�system_executable�parts�len�
startswith)rrs  r	rr
s�����.�/�/�5�E��E�
�
�Q��	+��"�I��$�	+��"�I��&�	+�
�"�I� � �!E�F�F�	+�
�"�I� � ��*�*�rr
rN)�pathlibrr
r�__all__�rr	�<module>rsH�������������������rPK鼷\�aG��3via_global_ref/__pycache__/__init__.cpython-311.pycnu�[����

�|oi���dS)N�r��{/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/__init__.py�<module>rs���rPK鼷\r�B__.via_global_ref/__pycache__/api.cpython-311.pycnu�[����

�|oiT���ddlZddlZddlmZddlmZddlmZddlm	Z	m
Z
Gd�de
��ZGd	�d
e	e���Zdd
gZ
dS)�N)�ABCMeta)�Path)�fs_supports_symlink�)�Creator�CreatorMetac�J��eZdZ�fd�Zed���Zed���Z�xZS)�ViaGlobalRefMetac���t�����d|_d|_t	��s	d|_dSdS)Nz(the filesystem does not supports symlink)�super�__init__�
copy_error�
symlink_errorr��self�	__class__s ��v/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/api.pyr
zViaGlobalRefMeta.__init__sQ���
�����������!���"�$�$�	L�!K�D����	L�	L�c��|jS�N)r�rs r�can_copyzViaGlobalRefMeta.can_copys
���?�"�"rc��|jSr)rrs r�can_symlinkzViaGlobalRefMeta.can_symlinks���%�%�%r)�__name__�
__module__�__qualname__r
�propertyrr�
__classcell__�rs@rr
r
ss�������L�L�L�L�L��#�#��X�#��&�&��X�&�&�&�&�&rr
c�t��eZdZ�fd�Zed���Ze�fd���Zd�Zd�Z	d�Z
�fd�Z�fd�Z�xZ
S)	�ViaGlobalRefApic���t���||��|�|��|_|j|_dSr)rr
�_should_symlink�symlinks�system_site�enable_system_site_package)r�options�interpreterrs   �rr
zViaGlobalRefApi.__init__sC���
������+�.�.�.��,�,�W�5�5��
�*1�*=��'�'�'rc��t|dd��t|dd��}}|�d��|�d��}}dD]/}||kr|nd}||kr|nd}|dur|durdS|durdS|durdS�0dS)N�copiesFr%)�clizenv var�file�defaultT)�getattr�
get_source)r(r+r%�copy_src�sym_src�level�s_opt�c_opts        rr$zViaGlobalRefApi._should_symlink"s���#�7�H�e�<�<�g�g�z�[`�>a�>a���#�.�.�x�8�8�'�:L�:L�Z�:X�:X�'��:�	�	�E� '�5� 0� 0�H�H�d�E�&�%�/�/�F�F�T�E���}�}��$����u�u���}�}��t�t���}�}��u�u���urc�|��t���||||��|�ddddd���|���}|js|jst
d���|jr|�dd	dd
d���|jr#|�dd
|jddd���dSdS)Nz--system-site-packagesF�
store_truer&zCgive the virtual environment access to the system site-packages dir)r.�action�dest�helpz(neither symlink or copy method supportedz
--symlinksTr%zZtry to use symlinks rather than copies, when symlinks are not the default for the platformz--copiesz
--always-copyr+z[try to use copies rather than symlinks, even when symlinks are the default for the platform)r�add_parser_arguments�add_argument�add_mutually_exclusive_grouprr�RuntimeError)�cls�parserr)�meta�app_data�grouprs      �rr;z$ViaGlobalRefApi.add_parser_arguments3s���
���$�$�V�[�$��I�I�I����$����V�	�	
�	
�	
��3�3�5�5����	K��
�	K��I�J�J�J���	������#��q�
�
�
�
��=�	������ �,�,�#��r�

�
�
�
�
�
�	�	rc�.�|���dSr)�
install_patchrs r�createzViaGlobalRefApi.createRs���������rc��|���}|rn|jdz}tjd|��|�dd���|jdz}tjd|��|�|d���dSdS)Nz_virtualenv.pthz%create virtualenv import hook file %szimport _virtualenv�utf-8��encoding�_virtualenv.pyz	create %s)�env_patch_text�purelib�logging�debug�
write_text)r�text�pth�	dest_paths    rrEzViaGlobalRefApi.install_patchUs����"�"�$�$���	9��,�!2�2�C��M�A�3�G�G�G��N�N�/�'�N�B�B�B���'7�7�I��M�+�y�1�1�1�� � ��� �8�8�8�8�8�
	9�	9rc��|j�tt��jdz��5}|�d���}|�dttj	�
t|j��t|j
��������cddd��S#1swxYwYdS)zIPatch the distutils package to not be derailed by its configuration filesrKrHrIz"__SCRIPT_DIR__"N)rB�ensure_extractedr�__file__�parent�	read_text�replace�repr�os�path�relpath�str�
script_dirrM)r�
resolved_pathrQs   rrLzViaGlobalRefApi.env_patch_text_s���
�]�
+�
+�D��N�N�,A�DT�,T�
U�
U�	t�Yf� �*�*�G�*�<�<�D��<�<� 2�D������T�_�I]�I]�_b�cg�co�_p�_p�9q�9q�4r�4r�s�s�	t�	t�	t�	t�	t�	t�	t�	t�	t�	t�	t�	t����	t�	t�	t�	t�	t�	ts�A;B=�=C�Cc�Z��t�����d|jfgzS)N�global)r�_argsr'rs �rrczViaGlobalRefApi._argses%����w�w�}�}���8�T�-L�"M�!N�N�Nrc�n��t�����|jrdnd|jd<dS)N�true�falsezinclude-system-site-packages)r�
set_pyenv_cfgr'�	pyenv_cfgrs �rrgzViaGlobalRefApi.set_pyenv_cfghs9���
��������CG�Cb�9o���ho���5�6�6�6r)rrrr
�staticmethodr$�classmethodr;rFrErLrcrgrr s@rr"r"s��������>�>�>�>�>�
����\�� ������[��<���9�9�9�t�t�t�O�O�O�O�O�p�p�p�p�p�p�p�p�prr")�	metaclass)rNr[�abcr�pathlibr�virtualenv.infor�creatorrrr
r"�__all__�rr�<module>rrs�������	�	�	�	�������������/�/�/�/�/�/�*�*�*�*�*�*�*�*�&�&�&�&�&�{�&�&�&�"Np�Np�Np�Np�Np�g��Np�Np�Np�Np�d�����rPK鼷\��Oq::6via_global_ref/__pycache__/_virtualenv.cpython-311.pycnu�[����

�|oi��n�dZddlZddlZej�e��Zd�ZdZej	dkr2Gd�d��Z
ej�de
����dSddl
mZdd	lmZmZGd
�dee��ZGd�d
ee��Zej�e����dS)z>Patches that are applied at runtime to the virtual environment�Nc�B��|jj��fd�}||j_dS)a
    Distutils allows user to configure some arguments via a configuration file:
    https://docs.python.org/3/install/index.html#distutils-configuration-files

    Some of this arguments though don't make sense in context of the virtual environment files, let's fix them up.
    c� ���|g|�Ri|��}|�d��}d|vr3ttj�t
j��f|d<dD]1}d�|��}||vr|�|d���2|S)N�install�prefix)�purelib�platlib�headers�scripts�dataz
install_{})	�get_option_dict�VIRTUALENV_PATCH_FILE�os�path�abspath�sysr�format�pop)�self�args�kwargs�resultr�base�key�old_parse_config_filess       ��~/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/_virtualenv.py�parse_config_filesz&patch_dist.<locals>.parse_config_filess����'�'��>�t�>�>�>�v�>�>���&�&�y�1�1���w��� 5�r�w���s�z�7R�7R� R�G�H��H�	'�	'�D��%�%�d�+�+�C��g�~�~����C��&�&�&���
�N)�Distributionr)�distrrs  @r�
patch_distr 
s=���"�.�A��
�
�
�
�
�,>�D��(�(�(r)zdistutils.distzsetuptools.dist)��c�N�eZdZdZdZgZdd�Zed���Zed���Z	dS)�_FinderzFA meta path finder that allows patching the imported distutils modulesNc	��|tv�r=|j��7t|j��dkr2ddl}|���}|j�|��ddlm}ddl	m
}|jd5||_	|||��}|��t|jd��}	|	rdnd}
t|j|
��}|	r|jn|j}||ur2	t!|j|
|||����n#t"$rYnwxYw|d|_cddd��S	d|_n#d|_wxYw	ddd��dS#1swxYwYdSdSdS)Nr)�partial)�	find_spec�exec_module�load_module)�_DISTUTILS_PATCH�fullname�len�lock�	threading�Lock�append�	functoolsr&�importlib.utilr'�hasattr�loader�getattrr(r)�setattr�AttributeError)
rr+r�targetr.r-r&r'�spec�
is_new_api�	func_name�old�funcs
             rr'z_Finder.find_spec3s���+�+�+��
�0E��t�y�>�>�Q�&�&�$�$�$�$�$�>�>�+�+�D��I�$�$�T�*�*�*�-�-�-�-�-�-�4�4�4�4�4�4��Y�q�\�-�-�$,�D�M�-�(�y��4�8�8���+�)0���m�)L�)L�J�9C�(V�
�
��I�")�$�+�y�"A�"A�C�7A�#W�4�#3�#3�t�GW�D�"�$���!)�$+�D�K��G�G�D�RU�DV�DV�$W�$W�$W�$W��'5�!)�!)�!)�$(�D�!)����#'�(,��
�#-�-�-�-�-�-�-�-�,�)-��
�
����
�,�,�,�,�
�#-�-�-�-�-�-�-�-�-�-�-�-����-�-�-�-�-�-�!,�+�0E�0EsU�6D;�?AD!� C3�2D!�3
D�=D!�?D�D!�D;�D;�!	D*�*D;�;D?�D?c�Z�||��|jtvrt|��dSdS�N��__name__r*r )r<�modules  rr(z_Finder.exec_moduleWs9���C��K�K�K���"2�2�2��6�"�"�"�"�"�3�2rc�V�||��}|jtvrt|��|Sr?r@)r<�namerBs   rr)z_Finder.load_module]s0���S��Y�Y�F���"2�2�2��6�"�"�"��Mrr?)
rA�
__module__�__qualname__�__doc__r+r-r'�staticmethodr(r)�rrr$r$)sq������T�T���
��"	-�"	-�"	-�"	-�H
�	#�	#�
��	#�

�	�	�
��	�	�	rr$)�find_module)�ImpImporter�	ImpLoaderc��eZdZdd�Zdd�ZdS)�_VirtualenvImporterNc�d�t�|��tj||��dSr?)�object�__init__rK)rrs  rrQz_VirtualenvImporter.__init__ks-���O�O�D�!�!�!�� ��t�,�,�,�,�,rc��|tvrE	t|gt|�d��d|���R�S#t$rYnwxYwdS)N�.���)r*�_VirtualenvLoaderrJ�split�ImportError)rr+rs   rrJz_VirtualenvImporter.find_moduleosl���+�+�+��,�X�c��H�N�N�SV�DW�DW�XZ�D[�]a�8b�8b�c�c�c�c��"�����D������4s�3?�
A�Ar?)rArErFrQrJrIrrrNrNjs<������	-�	-�	-�	-�	�	�	�	�	�	rrNc�$��eZdZd�Z�fd�Z�xZS)rUc�j�t�|��tj|||||��dSr?)rPrQrL)rr+�file�filename�etcs     rrQz_VirtualenvLoader.__init__xs3���O�O�D�!�!�!���t�X�t�X�s�C�C�C�C�Crc���tt|���|��}t|��d|_|Sr?)�superrUr)r �
__loader__)rr+rB�	__class__s   �rr)z_VirtualenvLoader.load_module|s<����,�d�3�3�?�?��I�I�F��v���� $�F���Mr)rArErFrQr)�
__classcell__)r`s@rrUrUwsJ�������	D�	D�	D�	�	�	�	�	�	�	�	�	rrU)rGrrr�join�__file__r
r r*�version_infor$�	meta_path�insert�imprJ�pkgutilrKrLrPrNrUr0rIrr�<module>risS��D�D�
�	�	�	�
�
�
�
�����X�.�.��>�>�>�67����f���9�9�9�9�9�9�9�9�v�M����G�G�I�I�&�&�&�&�&� ������.�.�.�.�.�.�.�.������f�k����	�	�	�	�	�F�I�	�	�	��M���,�,�.�.�/�/�/�/�/rPK鼷\G.����/via_global_ref/__pycache__/venv.cpython-311.pycnu�[����

�|oiw
���ddlZddlmZddlmZddlmZddlmZddlm	Z	ddl
mZdd	lm
Z
mZdd
lmZGd�de
��ZdgZdS)
�N)�copy)�handle_store_python)�
PythonInfo)�ProcessCallFailed)�
ensure_dir)�run_cmd�)�ViaGlobalRefApi�ViaGlobalRefMeta)�Pypy3Windowsc�p��eZdZ�fd�Z�fd�Zed���Z�fd�Zd�Zd�Z	d�Z
d�Z�fd	�Zd
�Z
�xZS)�Venvc����|j|_t���||��tj��}||uo|j|jk|_d|_dS�N)	�describe�super�__init__r�current�
executable�system_executable�
can_be_inline�_context)�self�options�interpreterr�	__class__s    ��w/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/via_global_ref/venv.pyrz
Venv.__init__s^����(��
�
������+�.�.�.��$�&�&��(�G�3�o��8N�R]�Ro�8o�����
�
�
�c���t�����|jrd|jjjfgngzS)Nr)r�_argsrr�__name__)rrs �rr z
Venv._argss9����w�w�}�}���VZ�Vc�"k�J��
�0G�0P�#Q�"R�"R�ik�l�lrc��|jr;t��}|jdkr |jjdkrt||��}|SdS)N�win32�)�has_venvr�platform�version_info�majorr)�clsr�metas   r�
can_createzVenv.can_createsP����	�#�%�%�D��#�w�.�.�;�3K�3Q�UV�3V�3V�*�4��=�=���K��trc���|jr|���n|���|jD]}t	|���t�����|���dSr)r�
create_inline�create_via_sub_process�libsrr�create�!executables_for_win_pypy_less_v37)r�librs  �rr0zVenv.create"s�����	*���� � � � ��'�'�)�)�)��9�	�	�C��s�O�O�O�O�
���������.�.�0�0�0�0�0rc���|j}t|t��r?|jr:|�|j��D]!}|�||j���dSdSdS)z�
        PyPy <= 3.6 (v7.3.3) for Windows contains only pypy3.exe and pypy3w.exe
        Venv does not handle non-existing exe sources, e.g. python.exe, so this
        patch does it.
        N)r�
isinstancer�less_v37�executablesr�run�symlinks)r�creator�exes   rr1z&Venv.executables_for_win_pypy_less_v37,s~���-���g�|�,�,�	0��1A�	0��*�*�4�+;�<�<�
0�
0��������/�/�/�/�	0�	0�	0�	0�
0�
0rc��ddlm}||jd|jd���}|�t|j����dS)Nr)�
EnvBuilderF)�system_site_packages�clearr8�with_pip)�venvr<�enable_system_site_packager8r0�str�dest)rr<�builders   rr-zVenv.create_inline7s]��#�#�#�#�#�#��*�!%�!@���]��	
�
�
��	���s�4�9�~�~�&�&�&�&�&rc���|���}tjdd�|����t	|��\}}}|dkrt||||���dS)Nz)using host built-in venv to create via %s� r)�get_host_create_cmd�logging�info�joinrr)r�cmd�code�out�errs     rr.zVenv.create_via_sub_processBse���&�&�(�(����@�#�(�(�3�-�-�P�P�P� ������c�3��1�9�9�#�D�#�s�C�8�8�8��9rc���|jjdddg}|jr|�d��|�|jrdnd��|�t|j����|S)Nz-mr@z
--without-pipz--system-site-packagesz
--symlinksz--copies)rrrA�appendr8rBrC)rrKs  rrGzVenv.get_host_create_cmdIsp����1�4���Q���*�	1��J�J�/�0�0�0��
�
�4�=�@�<�<�j�A�A�A��
�
�3�t�y�>�>�"�"�"��
rc����t|j�����}t�����|j�|��dSr)r�	pyenv_cfg�refreshr�
set_pyenv_cfg�update)r�venv_contentrs  �rrTzVenv.set_pyenv_cfgQsP����D�N�2�2�4�4�5�5��
������������l�+�+�+�+�+rc���t�|d��}|�5t||��r%t||��}t	|��r|dvr|St�||��S)Nr)�script)�object�__getattribute__�hasattr�getattr�callable)r�itemr�elements    rrZzVenv.__getattribute__Wsp���*�*�4��<�<����G�H�d�$;�$;���h��-�-�G��G�$�$�
���(;�(;����&�&�t�T�2�2�2r)r!�
__module__�__qualname__rr �classmethodr+r0r1r-r.rGrTrZ�
__classcell__)rs@rrrs�������������m�m�m�m�m�����[��1�1�1�1�1�	0�	0�	0�	'�	'�	'�9�9�9����,�,�,�,�,�3�3�3�3�3�3�3rr)rHr�&virtualenv.create.via_global_ref.storer�virtualenv.discovery.py_infor�virtualenv.util.errorr�virtualenv.util.pathr�virtualenv.util.subprocessr�apir
r�builtin.pypy.pypy3rr�__all__�rr�<module>rms�������������F�F�F�F�F�F�3�3�3�3�3�3�3�3�3�3�3�3�+�+�+�+�+�+�.�.�.�.�.�.�2�2�2�2�2�2�2�2�,�,�,�,�,�,�O3�O3�O3�O3�O3�?�O3�O3�O3�f����rPK鼷\���w
w
via_global_ref/venv.pynu�[���import logging
from copy import copy

from virtualenv.create.via_global_ref.store import handle_store_python
from virtualenv.discovery.py_info import PythonInfo
from virtualenv.util.error import ProcessCallFailed
from virtualenv.util.path import ensure_dir
from virtualenv.util.subprocess import run_cmd

from .api import ViaGlobalRefApi, ViaGlobalRefMeta
from .builtin.pypy.pypy3 import Pypy3Windows


class Venv(ViaGlobalRefApi):
    def __init__(self, options, interpreter):
        self.describe = options.describe
        super().__init__(options, interpreter)
        current = PythonInfo.current()
        self.can_be_inline = interpreter is current and interpreter.executable == interpreter.system_executable
        self._context = None

    def _args(self):
        return super()._args() + ([("describe", self.describe.__class__.__name__)] if self.describe else [])

    @classmethod
    def can_create(cls, interpreter):
        if interpreter.has_venv:
            meta = ViaGlobalRefMeta()
            if interpreter.platform == "win32" and interpreter.version_info.major == 3:
                meta = handle_store_python(meta, interpreter)
            return meta
        return None

    def create(self):
        if self.can_be_inline:
            self.create_inline()
        else:
            self.create_via_sub_process()
        for lib in self.libs:
            ensure_dir(lib)
        super().create()
        self.executables_for_win_pypy_less_v37()

    def executables_for_win_pypy_less_v37(self):
        """
        PyPy <= 3.6 (v7.3.3) for Windows contains only pypy3.exe and pypy3w.exe
        Venv does not handle non-existing exe sources, e.g. python.exe, so this
        patch does it.
        """
        creator = self.describe
        if isinstance(creator, Pypy3Windows) and creator.less_v37:
            for exe in creator.executables(self.interpreter):
                exe.run(creator, self.symlinks)

    def create_inline(self):
        from venv import EnvBuilder

        builder = EnvBuilder(
            system_site_packages=self.enable_system_site_package,
            clear=False,
            symlinks=self.symlinks,
            with_pip=False,
        )
        builder.create(str(self.dest))

    def create_via_sub_process(self):
        cmd = self.get_host_create_cmd()
        logging.info("using host built-in venv to create via %s", " ".join(cmd))
        code, out, err = run_cmd(cmd)
        if code != 0:
            raise ProcessCallFailed(code, out, err, cmd)

    def get_host_create_cmd(self):
        cmd = [self.interpreter.system_executable, "-m", "venv", "--without-pip"]
        if self.enable_system_site_package:
            cmd.append("--system-site-packages")
        cmd.append("--symlinks" if self.symlinks else "--copies")
        cmd.append(str(self.dest))
        return cmd

    def set_pyenv_cfg(self):
        # prefer venv options over ours, but keep our extra
        venv_content = copy(self.pyenv_cfg.refresh())
        super().set_pyenv_cfg()
        self.pyenv_cfg.update(venv_content)

    def __getattribute__(self, item):
        describe = object.__getattribute__(self, "describe")
        if describe is not None and hasattr(describe, item):
            element = getattr(describe, item)
            if not callable(element) or item in ("script",):
                return element
        return object.__getattribute__(self, item)


__all__ = [
    "Venv",
]
PK鼷\via_global_ref/__init__.pynu�[���PK鼷\��@@pyenv_cfg.pynu�[���import logging
from collections import OrderedDict


class PyEnvCfg:
    def __init__(self, content, path):
        self.content = content
        self.path = path

    @classmethod
    def from_folder(cls, folder):
        return cls.from_file(folder / "pyvenv.cfg")

    @classmethod
    def from_file(cls, path):
        content = cls._read_values(path) if path.exists() else OrderedDict()
        return PyEnvCfg(content, path)

    @staticmethod
    def _read_values(path):
        content = OrderedDict()
        for line in path.read_text(encoding="utf-8").splitlines():
            equals_at = line.index("=")
            key = line[:equals_at].strip()
            value = line[equals_at + 1 :].strip()
            content[key] = value
        return content

    def write(self):
        logging.debug("write %s", self.path)
        text = ""
        for key, value in self.content.items():
            line = f"{key} = {value}"
            logging.debug("\t%s", line)
            text += line
            text += "\n"
        self.path.write_text(text, encoding="utf-8")

    def refresh(self):
        self.content = self._read_values(self.path)
        return self.content

    def __setitem__(self, key, value):
        self.content[key] = value

    def __getitem__(self, key):
        return self.content[key]

    def __contains__(self, item):
        return item in self.content

    def update(self, other):
        self.content.update(other)
        return self

    def __repr__(self):
        return f"{self.__class__.__name__}(path={self.path})"


__all__ = [
    "PyEnvCfg",
]
PK鼷\��d

debug.pynu�[���"""Inspect a target Python interpreter virtual environment wise"""
import sys  # built-in

PYPY2_WIN = hasattr(sys, "pypy_version_info") and sys.platform != "win32" and sys.version_info[0] == 2


def encode_path(value):
    if value is None:
        return None
    if not isinstance(value, (str, bytes)):
        if isinstance(value, type):
            value = repr(value)
        else:
            value = repr(type(value))
    if isinstance(value, bytes) and not PYPY2_WIN:
        value = value.decode(sys.getfilesystemencoding())
    return value


def encode_list_path(value):
    return [encode_path(i) for i in value]


def run():
    """print debug data about the virtual environment"""
    try:
        from collections import OrderedDict
    except ImportError:  # pragma: no cover
        # this is possible if the standard library cannot be accessed
        # noinspection PyPep8Naming
        OrderedDict = dict  # pragma: no cover  # noqa: N806
    result = OrderedDict([("sys", OrderedDict())])
    path_keys = (
        "executable",
        "_base_executable",
        "prefix",
        "base_prefix",
        "real_prefix",
        "exec_prefix",
        "base_exec_prefix",
        "path",
        "meta_path",
    )
    for key in path_keys:
        value = getattr(sys, key, None)
        if isinstance(value, list):
            value = encode_list_path(value)
        else:
            value = encode_path(value)
        result["sys"][key] = value
    result["sys"]["fs_encoding"] = sys.getfilesystemencoding()
    result["sys"]["io_encoding"] = getattr(sys.stdout, "encoding", None)
    result["version"] = sys.version

    try:
        import sysconfig

        # https://bugs.python.org/issue22199
        makefile = getattr(sysconfig, "get_makefile_filename", getattr(sysconfig, "_get_makefile_filename", None))
        result["makefile_filename"] = encode_path(makefile())
    except ImportError:
        pass

    import os  # landmark

    result["os"] = repr(os)

    try:
        # noinspection PyUnresolvedReferences
        import site  # site

        result["site"] = repr(site)
    except ImportError as exception:  # pragma: no cover
        result["site"] = repr(exception)  # pragma: no cover

    try:
        # noinspection PyUnresolvedReferences
        import datetime  # site

        result["datetime"] = repr(datetime)
    except ImportError as exception:  # pragma: no cover
        result["datetime"] = repr(exception)  # pragma: no cover

    try:
        # noinspection PyUnresolvedReferences
        import math  # site

        result["math"] = repr(math)
    except ImportError as exception:  # pragma: no cover
        result["math"] = repr(exception)  # pragma: no cover

    # try to print out, this will validate if other core modules are available (json in this case)
    try:
        import json

        result["json"] = repr(json)
    except ImportError as exception:
        result["json"] = repr(exception)
    else:
        try:
            content = json.dumps(result, indent=2)
            sys.stdout.write(content)
        except (ValueError, TypeError) as exception:  # pragma: no cover
            sys.stderr.write(repr(exception))
            sys.stdout.write(repr(result))  # pragma: no cover
            raise SystemExit(1)  # pragma: no cover


if __name__ == "__main__":
    run()
PK鼷\�X�$__pycache__/describe.cpython-311.pycnu�[����

�|oi
����ddlmZddlmZddlmZddlmZGd�de���ZGd�d	ee���Z	Gd
�dee���Z
Gd�d
ee���ZGd�dee���Zgd�Z
dS)�)�ABCMeta)�OrderedDict)�Path)�IS_WINc�8�eZdZdZerdndZd�Zed���Zed���Z	ed���Z
ed���Zed	���Zed
���Z
ed���Zed���Zd
�Zed���Zed���Zed���Zed���Zd�ZdS)�Describez_Given a host interpreter tell us information about what the created interpreter might look likez.exe�c�Z�||_||_d|_d|_d|_d|_dS�N)�interpreter�dest�_stdlib�_stdlib_platform�_system_stdlib�
_conf_vars)�selfr
rs   �l/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/describe.py�__init__zDescribe.__init__
s3��&�����	���� $���"��������c��|jSr)�
script_dir�rs r�bin_dirzDescribe.bin_dirs
����rc�F�|j|j�d��zS)N�scripts�r
r�install_pathrs rrzDescribe.script_dir� ���y�4�+�8�8��C�C�C�Crc�F�|j|j�d��zS)N�purelibrrs rr zDescribe.purelibrrc�F�|j|j�d��zS)N�platlibrrs rr"zDescribe.platlib!rrc�~�tt|jdf|jdff�������Sr)�listrr"r �keysrs r�libsz
Describe.libs%s7���K�$�,��!5���d�7K� L�M�M�R�R�T�T�U�U�Urc��|j�3t|j�d|j�����|_|jS)N�stdlib��
config_var)rrr�sysconfig_path�_config_varsrs rr(zDescribe.stdlib)s;���<���� 0� ?� ?��UY�Uf� ?� g� g�h�h�D�L��|�rc��|j�3t|j�d|j�����|_|jS)N�
platstdlibr))rrrr+r,rs r�stdlib_platformzDescribe.stdlib_platform/s>��� �(�$(��)9�)H�)H��bf�bs�)H�)t�)t�$u�$u�D�!��$�$rc�\�|j�|�|j��|_|jSr)r�_calc_config_varsr
rs rr,zDescribe._config_vars5s)���?�"�"�4�4�T�Y�?�?�D�O���rc�`����jj}��fd�|���D��S)Nc�^��i|])\}}||��jj��r�n|��*S�)�
startswithr�prefix)�.0�k�vr�tos   ��r�
<dictcomp>z.Describe._calc_config_vars.<locals>.<dictcomp>=s:���e�e�e�D�A�q��!�,�,�t�'7�'>�?�?�F�B�B�Q�e�e�er)r�sysconfig_vars�items)rr:�sys_varss`` rr1zDescribe._calc_config_vars;s9�����#�2��e�e�e�e�e�T\�Tb�Tb�Td�Td�e�e�e�erc��dS)z-Knows means it knows how the output will lookTr4)�clsrs  r�can_describezDescribe.can_describe?s	���trc�&�|jjdS)N���)r
�partsrs r�env_namezDescribe.env_nameDs���y��r�"�"rc�L�|j|����|j��zSr)r�exe_stem�suffixrs r�exezDescribe.exeHs$���|������?�$�+�?�?�?�?rc��t�)zbexecutable name without suffix - there seems to be no standard way to get this without creating it)�NotImplementedError)r@s rrGzDescribe.exe_stemLs
��"�!rc�(�|j|�|j��zSr)rrH)r�names  r�scriptzDescribe.scriptQs����D�!7�$�+�!7�!7�7�7rN)�__name__�
__module__�__qualname__�__doc__rrHr�propertyrrr r"r&r(r/r,r1�classmethodrArErIrGrNr4rrrrs�������i�i��
%�V�V�2�F��������X���D�D��X�D��D�D��X�D��D�D��X�D��V�V��X�V�����X��
�%�%��X�%�
����X��
f�f�f�����[���#�#��X�#��@�@��X�@��"�"��[�"�8�8�8�8�8rr)�	metaclassc�.��eZdZe�fd���Z�xZS)�Python2Supportsc�f��|jjdko t���|��S)N���version_info�major�superrA�r@r�	__class__s  �rrAzPython2Supports.can_describeV�+����'�-��2�X�u�w�w�7K�7K�K�7X�7X�Xr�rOrPrQrTrA�
__classcell__�r_s@rrWrWU�K��������Y�Y�Y�Y��[�Y�Y�Y�Y�YrrWc�.��eZdZe�fd���Z�xZS)�Python3Supportsc�f��|jjdko t���|��S)N�rZr^s  �rrAzPython3Supports.can_describe\r`rrarcs@rrfrf[rdrrfc�.��eZdZe�fd���Z�xZS)�
PosixSupportsc�\��|jdko t���|��S)N�posix��osr]rAr^s  �rrAzPosixSupports.can_describebs'����~��(�N�U�W�W�-A�-A�+�-N�-N�Nrrarcs@rrjrjasK��������O�O�O�O��[�O�O�O�O�Orrjc�.��eZdZe�fd���Z�xZS)�WindowsSupportsc�\��|jdko t���|��S)N�ntrmr^s  �rrAzWindowsSupports.can_describehs'����~��%�K�%�'�'�*>�*>�{�*K�*K�Krrarcs@rrprpgsK��������L�L�L�L��[�L�L�L�L�Lrrp)rrWrfrjrpN)�abcr�collectionsr�pathlibr�virtualenv.inforrrWrfrjrp�__all__r4rr�<module>rxs���������#�#�#�#�#�#�������"�"�"�"�"�"�J8�J8�J8�J8�J8��J8�J8�J8�J8�ZY�Y�Y�Y�Y�h�'�Y�Y�Y�Y�Y�Y�Y�Y�Y�h�'�Y�Y�Y�Y�O�O�O�O�O�H��O�O�O�O�L�L�L�L�L�h�'�L�L�L�L������rPK鼷\�0�r��$__pycache__/__init__.cpython-311.pycnu�[����

�|oi���dS)N�r��l/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/__init__.py�<module>rs���rPK鼷\�*�@1@1#__pycache__/creator.cpython-311.pycnu�[����

�|oi< ��B�ddlZddlZddlZddlZddlmZmZddlmZddl	m
Z
ddlmZddl
mZddlmZddlmZdd	lmZdd
lmZddlmZeej�e����jZed
zZGd�d��ZGd�de���Z d�Z!ddgZ"dS)�N)�ABCMeta�abstractmethod)�ArgumentTypeError)�literal_eval)�OrderedDict)�Path)�LogCmd)�safe_delete)�run_cmd)�__version__�)�PyEnvCfgzdebug.pyc��eZdZd�ZdS)�CreatorMetac��d|_dS�N)�error��selfs �k/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/creator.py�__init__zCreatorMeta.__init__s
����
�
�
�N)�__name__�
__module__�__qualname__r�rrrrs#����������rrc��eZdZdZd�Zd�Zd�Zed���Zed���Z	e
d���Zed���Zd	�Z
d
�Zd�Zed���Zed
���ZdS)�CreatorzEA class that given a python Interpreter creates a virtual environmentc���||_d|_t|j��|_|j|_|j|_t
j|j��|_|j	|_	|j
|_
dS)z�Construct a new virtual environment creator.

        :param options: the CLI option as parsed from :meth:`add_parser_arguments`
        :param interpreter: the interpreter to create virtual environment from
        N)�interpreter�_debugr�dest�clear�
no_vcs_ignorer�from_folder�	pyenv_cfg�app_data�env)r�optionsr s   rrzCreator.__init__sc��'���������&�&��	��]��
�$�2���!�-�d�i�8�8����(��
��;����rc��|jj�dd�d�|���D�����d�S)N�(z, c3�*K�|]\}}|�d|��V��dS)�=Nr)�.0�k�vs   r�	<genexpr>z#Creator.__repr__.<locals>.<genexpr>.s0����5Z�5Z�T�Q���j�j�Q�j�j�5Z�5Z�5Z�5Z�5Z�5Zr�))�	__class__r�join�_argsrs r�__repr__zCreator.__repr__-sA���.�)�]�]�D�I�I�5Z�5Z�T�Z�Z�\�\�5Z�5Z�5Z�,Z�,Z�]�]�]�]rc�P�dt|j��fd|jfd|jfgS)Nr"r#r$)�strr"r#r$rs rr5z
Creator._args0s1��
�S���^�^�$�
�d�j�!�
�d�0�1�
�	
rc��dS)aDetermine if we can create a virtual environment.

        :param interpreter: the interpreter in question
        :return: ``None`` if we can't create, any other object otherwise that will be forwarded to                   :meth:`add_parser_arguments`
        Tr)�clsr s  r�
can_createzCreator.can_create7s	���trc��|�dd|j���|�ddddd�	��|�d
dddd�	��d
S)aAdd CLI arguments for the creator.

        :param parser: the CLI parser
        :param app_data: the application data folder
        :param interpreter: the interpreter we're asked to create virtual environment for
        :param meta: value as returned by :meth:`can_create`
        r"z!directory to create virtualenv at)�help�typez--clearr#�
store_truezZremove the destination directory if exist before starting (will overwrite files otherwise)F)r"�actionr=�defaultz--no-vcs-ignorer$z>don't create VCS ignore directive in the destination directoryN)�add_argument�
validate_dest)r:�parserr �metar's     r�add_parser_argumentszCreator.add_parser_argumentsAs���	����4��"�	�	
�	
�	
�
	������m��	�	
�	
�	
�	���� ��Q��	�	
�	
�	
�	
�	
rc��t�)z)Perform the virtual environment creation.)�NotImplementedErrorrs r�createzCreator.create^s
��"�!rc�<�d�}tj��}t��}|dkrddini}t|��D]N}	|j|fi|���|��}||kr�+t
|���#t$rd||<Y�KwxYw|rAd�|�����}d|�d|�d	|��}	t|	���tj|vr%d
|�dtj�d�}	t|	�d
����t|��}
|
�
��r'|
���rtd|
�d����ttj�t|
���������}|}
|rq|�
��r9tjt|��tj��rn0|||
��|j|j}
}||kr|||
��|}|�qt|
��S)zANo path separator in the path, valid chars and must be write-ablec��ttj�|j|jg���}td|�|���d|�����)N�the destination z is not write-able at )r�os�path�commonprefix�partsr�relative_to)r"�value�commons   r�non_write_ablez-Creator.validate_dest.<locals>.non_write_ablegsS���2�7�/�/���d�j�0I�J�J�K�F�#�$o�t�7G�7G��7O�7O�$o�$o�gm�$o�$o�p�p�pr�mbcs�errors�ignoreN�zthe file system codec (z) cannot handle characters z within zdestination z& must not contain the path separator (r2z+ as this would break the activation scriptsrLz already exists and is a file)�sys�getfilesystemencodingrr8�encode�decode�
ValueErrorr4�keysrrM�pathsepr�exists�is_filerN�abspath�resolve�access�W_OK�parent�name)r:�	raw_valuerT�encoding�refused�kwargs�char�trip�bad�msgrRr"�base�_s              rrCzCreator.validate_destcs]��	q�	q�	q��,�.�.���-�-��)1�V�);�);�(�H�%�%����	�N�N�	%�	%�D�
%�"�t�{�8�6�6�v�6�6�=�=�h�G�G���4�<�<�� ��&�&�&���
%�
%�
%� $���
�
�
�
%�����	)��'�'�'�,�,�.�.�)�)�C�m�H�m�m�QT�m�m�`i�m�m�C�#�C�(�(�(�
�:��"�"�a��a�a�TV�T^�a�a�a�C�#�s�$W�$W�$W�X�X�X��Y�����<�<�>�>�	]�e�m�m�o�o�	]�#�$[�u�$[�$[�$[�\�\�\��B�G�O�O�C��J�J�/�/�0�0�8�8�:�:�����		��{�{�}�}�
0��9�S��Y�Y���0�0�0��"�N�4��/�/�/��k�4�9�!�D��t�|�|���t�U�+�+�+��D��		��5�z�z�s�'A:�+A:�:B�Bc�,�|j���r5|jr.tjd|j��t|j��|���|���|js|�	��dSdS)Nz	delete %s)
r"r`r#�logging�debugr
rI�
set_pyenv_cfgr$�setup_ignore_vcsrs r�runzCreator.run�s����9�����	#�$�*�	#��M�+�t�y�1�1�1���	�"�"�"����
�
�
��������!�	$��!�!�#�#�#�#�#�	$�	$rc�z�t��|j_tj�tj�|jj����|jd<|jj	|jd<d�
d�|jjD����|jd<t|jd<dS)N�home�implementation�.c3�4K�|]}t|��V��dSr)r8)r.�is  rr1z(Creator.set_pyenv_cfg.<locals>.<genexpr>�s(����1`�1`�Q�#�a�&�&�1`�1`�1`�1`�1`�1`r�version_info�
virtualenv)
rr&�contentrMrN�dirnamerbr �system_executablerzr4r~rrs rruzCreator.set_pyenv_cfg�s���!,������!#���������AQ�Ac�1d�1d�!e�!e���v��+/�+;�+J���'�(�),���1`�1`�$�BR�B_�1`�1`�1`�)`�)`���~�&�'2���|�$�$�$rc�t�|jdz}|���s|�dd���dSdS)z9Generate ignore instructions for version control systems.z
.gitignorez(# created by virtualenv automatically
*
zutf-8)riN)r"r`�
write_text)r�
git_ignores  rrvzCreator.setup_ignore_vcs�sR���Y��-�
�� � �"�"�	b��!�!�"N�Y`�!�a�a�a�a�a�	b�	brc��|j�?|j�8t|j|���|j|j��|_|jS)zt
        :return: debug information about the virtual environment (only valid after :meth:`create` has run)
        )r!�exe�get_env_debug_info�debug_scriptr'r(rs rrtz
Creator.debug�sD��
�;��4�8�#7�,�T�X�t�7H�7H�7J�7J�D�M�[_�[c�d�d�D�K��{�rc��tSr)�DEBUG_SCRIPTrrrr�zCreator.debug_script�s���rN)rrr�__doc__rr6r5�classmethodr;rFrrIrCrwrurv�propertyrt�staticmethodr�rrrrrs������O�O�
�
�
�^�^�^�
�
�
�����[���
�
��[�
�8�"�"��^�"��+�+��[�+�Z$�$�$�3�3�3�b�b�b�����X������\���rr)�	metaclassc��|���}|�dd��|�|��5}t|��t|��g}t	jdt
|����t|��\}}}ddd��n#1swxYwY	|dkr:|rt|��}n<|dkrd|vrt|���t|���tj|��}|r||d<n+#t$r}	|||t|	��d�cYd}	~	Sd}	~	wwxYwd|vrd	|dvr|dd	d=|S)
N�
PYTHONPATHzdebug via %rr��file�err)�outr��
returncode�	exceptionrYrN)�copy�pop�ensure_extractedr8rsrtr	rr�OSError�	Exception�json�loads�repr)
�env_exer�r'r(�cmd�coder�r��resultr�s
          rr�r��s���

�(�(�*�*�C��G�G�L�$����	�	"�	"�<�	0�	0�&�L��7�|�|�S��.�.�/���
�n�f�S�k�k�2�2�2� ������c�3�&�&�&�&�&�&�&�&�&�&�&����&�&�&�&�
Z��1�9�9��
%�%�c�*�*����1�9�9��3���!�#�,�,�&���n�n�$��Z��_�_�F��	 ��F�5�M����Z�Z�Z��3�d��i���Y�Y�Y�Y�Y�Y�Y�Y�����Z��������6�V�E�]�2�2��5�M�&�!�!�$��Ms2�AB � B$�'B$�,AD�
D0�D+�%D0�+D0)#r�rsrMrY�abcrr�argparser�astr�collectionsr�pathlibr�#virtualenv.discovery.cached_py_infor	�virtualenv.util.pathr
�virtualenv.util.subprocessr�virtualenv.versionrr&rrNrb�__file__rf�HEREr�rrr��__all__rrr�<module>r�s�����������	�	�	�	�
�
�
�
�'�'�'�'�'�'�'�'�&�&�&�&�&�&�������#�#�#�#�#�#�������6�6�6�6�6�6�,�,�,�,�,�,�.�.�.�.�.�.�*�*�*�*�*�*��������t�B�G�O�O�H�%�%�&�&�-���j� ����������
]�]�]�]�]��]�]�]�]�@���<�����rPK鼷\;�H�qq!__pycache__/debug.cpython-311.pycnu�[����

�|oi
���dZddlZeed��oejdkoejddkZd�Zd�Zd�Ze	d	kre��dSdS)
z<Inspect a target Python interpreter virtual environment wise�N�pypy_version_info�win32�c�L�|�dSt|ttf��sAt|t��rt	|��}nt	t|����}t|t��r-t
s&|�tj����}|S)N)	�
isinstance�str�bytes�type�repr�	PYPY2_WIN�decode�sys�getfilesystemencoding��values �i/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/debug.py�encode_pathrs����}��t��e�c�5�\�*�*�&��e�T�"�"�	&���K�K�E�E���e���%�%�E��%����:�	�:����S�6�8�8�9�9���L�c��d�|D��S)Nc�,�g|]}t|����S�)r)�.0�is  r�
<listcomp>z$encode_list_path.<locals>.<listcomp>s��*�*�*�q�K��N�N�*�*�*rrrs r�encode_list_pathrs��*�*�E�*�*�*�*rc	��	ddlm}n#t$r
t}YnwxYw|d|��fg��}d}|D]W}t	t
|d��}t
|t��rt|��}nt|��}||d|<�Xtj
��|dd<t	t
jdd��|dd<t
j|d	<	ddl
}t	|d
t	|dd����}t|����|d<n#t$rYnwxYwddl}t|��|d
<	ddl}t|��|d<n)#t$r}	t|	��|d<Yd}	~	nd}	~	wwxYw	ddl}
t|
��|d<n)#t$r}	t|	��|d<Yd}	~	nd}	~	wwxYw	ddl}t|��|d<n)#t$r}	t|	��|d<Yd}	~	nd}	~	wwxYw	ddl}t|��|d<	|�|d���}
t
j�|
��dS#t,t.f$rl}	t
j�t|	����t
j�t|����t3d���d}	~	wwxYw#t$r}	t|	��|d<Yd}	~	dSd}	~	wwxYw)z.print debug data about the virtual environmentr)�OrderedDictr)	�
executable�_base_executable�prefix�base_prefix�real_prefix�exec_prefix�base_exec_prefix�path�	meta_pathN�fs_encoding�encoding�io_encoding�version�get_makefile_filename�_get_makefile_filename�makefile_filename�os�site�datetime�math�jsonr)�indent�)�collectionsr�ImportError�dict�getattrrr�listrrr�stdoutr*�	sysconfigr.rr/r0r1r2�dumps�write�
ValueError�	TypeError�stderr�
SystemExit)r�result�	path_keys�keyrr;�makefiler.r/�	exceptionr0r1r2�contents              r�runrHs����+�+�+�+�+�+�+���������������[�5�+�+�-�-�0�1�
2�
2�F�
�I��#�#����S�$�'�'���e�T�"�"�	'�$�U�+�+�E�E���&�&�E�"��u�
�c���#&�#<�#>�#>�F�5�M�-� �#*�3�:�z�4�#H�#H�F�5�M�-� ���F�9��
������9�&=�w�y�Rj�lp�?q�?q�r�r��&1�(�(�*�*�&=�&=��"�#�#���
�
�
���
�����I�I�I���8�8�F�4�L�)������d����v�����)�)�)��i����v�����������)����-�����!�(�^�^��z�����-�-�-�!�)�_�_��z�����������-����)������d����v�����)�)�)��i����v�����������)����
 ������d����v��	 ��j�j���j�2�2�G��J���W�%�%�%�%�%���I�&�	 �	 �	 ��J���T�)�_�_�-�-�-��J���T�&�\�\�*�*�*��Q�-�-������	 �����
�)�)�)��i����v������������)���s��	���">D!�!
D.�-D.�E�
F�)F�F�	F � 
G�*G�G�
G!�!
H�+H�H�K�"6I�K�+A'K�K�
L�$K<�<L�__main__)
�__doc__r�hasattr�platform�version_inforrrrH�__name__rrr�<module>rOs���B�B�
�
�
�
��G�C�,�-�-�f�#�,�'�2I�f�c�N^�_`�Na�ef�Nf�	�
�
�
�+�+�+�R �R �R �j�z����C�E�E�E�E�E��rPK鼷\�>���%__pycache__/pyenv_cfg.cpython-311.pycnu�[����

�|oi@��:�ddlZddlmZGd�d��ZdgZdS)�N)�OrderedDictc��eZdZd�Zed���Zed���Zed���Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�ZdS)
�PyEnvCfgc�"�||_||_dS�N)�content�path)�selfrr	s   �m/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/virtualenv/create/pyenv_cfg.py�__init__zPyEnvCfg.__init__s�������	�	�	�c�2�|�|dz��S)Nz
pyvenv.cfg)�	from_file)�cls�folders  r�from_folderzPyEnvCfg.from_folder
s���}�}�V�l�2�3�3�3r
c��|���r|�|��n
t��}t||��Sr)�exists�_read_valuesrr)rr	rs   rrzPyEnvCfg.from_files;��,0�K�K�M�M�L�#�"�"�4�(�(�(�{�}�}�����&�&�&r
c�"�t��}|�d������D]W}|�d��}|d|����}||dzd����}|||<�X|S)N�utf-8��encoding�=�)r�	read_text�
splitlines�index�strip)r	r�line�	equals_at�key�values      rrzPyEnvCfg._read_valuess����-�-���N�N�G�N�4�4�?�?�A�A�	!�	!�D��
�
�3���I��z�	�z�"�(�(�*�*�C���Q����)�/�/�1�1�E� �G�C�L�L��r
c��tjd|j��d}|j���D]+\}}|�d|��}tjd|��||z
}|dz
}�,|j�|d���dS)Nzwrite %s�z = z	%s�
rr)�logging�debugr	r�items�
write_text)r
�textr"r#r s     r�writezPyEnvCfg.writes����
�j�$�)�,�,�,����,�,�,�.�.�	�	�J�C���%�%�e�%�%�D��M�&�$�'�'�'��D�L�D��D�L�D�D��	���T�G��4�4�4�4�4r
c�N�|�|j��|_|jSr)rr	r�r
s r�refreshzPyEnvCfg.refresh's!���(�(���3�3����|�r
c��||j|<dSr�r)r
r"r#s   r�__setitem__zPyEnvCfg.__setitem__+s��!���S���r
c��|j|Srr1)r
r"s  r�__getitem__zPyEnvCfg.__getitem__.s���|�C� � r
c��||jvSrr1)r
�items  r�__contains__zPyEnvCfg.__contains__1s���t�|�#�#r
c�:�|j�|��|Sr)r�update)r
�others  rr9zPyEnvCfg.update4s������E�"�"�"��r
c�0�|jj�d|j�d�S)Nz(path=�))�	__class__�__name__r	r.s r�__repr__zPyEnvCfg.__repr__8s ���.�)�=�=���=�=�=�=r
N)r>�
__module__�__qualname__r�classmethodrr�staticmethodrr,r/r2r4r7r9r?�r
rrrs�����������4�4��[�4��'�'��[�'�����\��5�5�5����"�"�"�!�!�!�$�$�$����>�>�>�>�>r
r)r'�collectionsrr�__all__rDr
r�<module>rGsY������#�#�#�#�#�#�4>�4>�4>�4>�4>�4>�4>�4>�p����r
PK鼷\__init__.pynu�[���PK鼷\pQ'

describe.pynu�[���from abc import ABCMeta
from collections import OrderedDict
from pathlib import Path

from virtualenv.info import IS_WIN


class Describe(metaclass=ABCMeta):
    """Given a host interpreter tell us information about what the created interpreter might look like"""

    suffix = ".exe" if IS_WIN else ""

    def __init__(self, dest, interpreter):
        self.interpreter = interpreter
        self.dest = dest
        self._stdlib = None
        self._stdlib_platform = None
        self._system_stdlib = None
        self._conf_vars = None

    @property
    def bin_dir(self):
        return self.script_dir

    @property
    def script_dir(self):
        return self.dest / self.interpreter.install_path("scripts")

    @property
    def purelib(self):
        return self.dest / self.interpreter.install_path("purelib")

    @property
    def platlib(self):
        return self.dest / self.interpreter.install_path("platlib")

    @property
    def libs(self):
        return list(OrderedDict(((self.platlib, None), (self.purelib, None))).keys())

    @property
    def stdlib(self):
        if self._stdlib is None:
            self._stdlib = Path(self.interpreter.sysconfig_path("stdlib", config_var=self._config_vars))
        return self._stdlib

    @property
    def stdlib_platform(self):
        if self._stdlib_platform is None:
            self._stdlib_platform = Path(self.interpreter.sysconfig_path("platstdlib", config_var=self._config_vars))
        return self._stdlib_platform

    @property
    def _config_vars(self):
        if self._conf_vars is None:
            self._conf_vars = self._calc_config_vars(self.dest)
        return self._conf_vars

    def _calc_config_vars(self, to):
        sys_vars = self.interpreter.sysconfig_vars
        return {k: (to if v.startswith(self.interpreter.prefix) else v) for k, v in sys_vars.items()}

    @classmethod
    def can_describe(cls, interpreter):  # noqa: U100
        """Knows means it knows how the output will look"""
        return True

    @property
    def env_name(self):
        return self.dest.parts[-1]

    @property
    def exe(self):
        return self.bin_dir / f"{self.exe_stem()}{self.suffix}"

    @classmethod
    def exe_stem(cls):
        """executable name without suffix - there seems to be no standard way to get this without creating it"""
        raise NotImplementedError

    def script(self, name):
        return self.script_dir / f"{name}{self.suffix}"


class Python2Supports(Describe, metaclass=ABCMeta):
    @classmethod
    def can_describe(cls, interpreter):
        return interpreter.version_info.major == 2 and super().can_describe(interpreter)


class Python3Supports(Describe, metaclass=ABCMeta):
    @classmethod
    def can_describe(cls, interpreter):
        return interpreter.version_info.major == 3 and super().can_describe(interpreter)


class PosixSupports(Describe, metaclass=ABCMeta):
    @classmethod
    def can_describe(cls, interpreter):
        return interpreter.os == "posix" and super().can_describe(interpreter)


class WindowsSupports(Describe, metaclass=ABCMeta):
    @classmethod
    def can_describe(cls, interpreter):
        return interpreter.os == "nt" and super().can_describe(interpreter)


__all__ = [
    "Describe",
    "Python2Supports",
    "Python3Supports",
    "PosixSupports",
    "WindowsSupports",
]
PK鼷\~�W< < 
creator.pynu�[���PK鼷\����[[v via_global_ref/_virtualenv.pynu�[���PK鼷\XC�ff;via_global_ref/store.pynu�[���PK鼷\k4��TT�=via_global_ref/api.pynu�[���PK鼷\V����&dNvia_global_ref/builtin/python2/site.pynu�[���PK鼷\[�C.��)�ivia_global_ref/builtin/python2/python2.pynu�[���PK鼷\bf�~I'I'?�yvia_global_ref/builtin/python2/__pycache__/site.cpython-311.pycnu�[���PK鼷\�Uv��C��via_global_ref/builtin/python2/__pycache__/__init__.cpython-311.pycnu�[���PK鼷\�$���B�via_global_ref/builtin/python2/__pycache__/python2.cpython-311.pycnu�[���PK鼷\*<�via_global_ref/builtin/python2/__init__.pynu�[���PK鼷\�!l����via_global_ref/builtin/ref.pynu�[���PK鼷\����%��via_global_ref/builtin/builtin_way.pynu�[���PK鼷\�p���%�via_global_ref/builtin/pypy/common.pynu�[���PK鼷\B�ו	�	$B�via_global_ref/builtin/pypy/pypy3.pynu�[���PK鼷\���
�
$+�via_global_ref/builtin/pypy/pypy2.pynu�[���PK鼷\lj(P��@Y�via_global_ref/builtin/pypy/__pycache__/__init__.cpython-311.pycnu�[���PK鼷\��{C>��via_global_ref/builtin/pypy/__pycache__/common.cpython-311.pycnu�[���PK鼷\'��Ϗ�=7	via_global_ref/builtin/pypy/__pycache__/pypy2.cpython-311.pycnu�[���PK鼷\�2�[��=3(via_global_ref/builtin/pypy/__pycache__/pypy3.cpython-311.pycnu�[���PK鼷\':8via_global_ref/builtin/pypy/__init__.pynu�[���PK鼷\��è		,�8via_global_ref/builtin/via_global_self_do.pynu�[���PK鼷\��X��E�Ivia_global_ref/builtin/__pycache__/via_global_self_do.cpython-311.pycnu�[���PK鼷\�q9��;8ivia_global_ref/builtin/__pycache__/__init__.cpython-311.pycnu�[���PK鼷\�q<��(�(6�jvia_global_ref/builtin/__pycache__/ref.cpython-311.pycnu�[���PK鼷\����>��via_global_ref/builtin/__pycache__/builtin_way.cpython-311.pycnu�[���PK鼷\"��via_global_ref/builtin/__init__.pynu�[���PK鼷\̩E�		(�via_global_ref/builtin/cpython/common.pynu�[���PK鼷\����
�
*V�via_global_ref/builtin/cpython/cpython2.pynu�[���PK鼷\5|_r8r8(��via_global_ref/builtin/cpython/mac_os.pynu�[���PK鼷\���;[;[AW�via_global_ref/builtin/cpython/__pycache__/mac_os.cpython-311.pycnu�[���PK鼷\�N~
44CEvia_global_ref/builtin/cpython/__pycache__/cpython2.cpython-311.pycnu�[���PK鼷\a_����C�bvia_global_ref/builtin/cpython/__pycache__/__init__.cpython-311.pycnu�[���PK鼷\�(V��Cdvia_global_ref/builtin/cpython/__pycache__/cpython3.cpython-311.pycnu�[���PK鼷\������A�via_global_ref/builtin/cpython/__pycache__/common.cpython-311.pycnu�[���PK鼷\�yƟ*��via_global_ref/builtin/cpython/cpython3.pynu�[���PK鼷\*��via_global_ref/builtin/cpython/__init__.pynu�[���PK鼷\.�%���0R�via_global_ref/__pycache__/store.cpython-311.pycnu�[���PK鼷\�aG��3��via_global_ref/__pycache__/__init__.cpython-311.pycnu�[���PK鼷\r�B__.�via_global_ref/__pycache__/api.cpython-311.pycnu�[���PK鼷\��Oq::6��via_global_ref/__pycache__/_virtualenv.cpython-311.pycnu�[���PK鼷\G.����/C�via_global_ref/__pycache__/venv.cpython-311.pycnu�[���PK鼷\���w
w
$via_global_ref/venv.pynu�[���PK鼷\�via_global_ref/__init__.pynu�[���PK鼷\��@@+pyenv_cfg.pynu�[���PK鼷\��d

�debug.pynu�[���PK鼷\�X�$�#__pycache__/describe.cpython-311.pycnu�[���PK鼷\�0�r��$WB__pycache__/__init__.cpython-311.pycnu�[���PK鼷\�*�@1@1#�C__pycache__/creator.cpython-311.pycnu�[���PK鼷\;�H�qq!u__pycache__/debug.cpython-311.pycnu�[���PK鼷\�>���%و__pycache__/pyenv_cfg.cpython-311.pycnu�[���PK鼷\��__init__.pynu�[���PK鼷\pQ'

�describe.pynu�[���PK44�B�