File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/setuptools/_distutils/__pycache__/util.cpython-310.pyc
Back
o ;j~D � @ s� d Z ddlmZ ddlZddlZddlZddlZddlZddl Z ddl Z ddlZddlZddl Z ddlmZmZmZ ddlmZmZ ddlmZ ddlmZ dd lmZ dd lmZmZ ddlmZ erpddlm Z m!Z! e d �Z"d]dd�Z#d]dd�Z$ej%dkr�da&dZ'dd� Z(dd� Z)dd� Z*d^dd�Z+ed_d"d#��Z,d`d'd(�Z-ej.dad*d+��Z/dbd.d/�Z0d0d1� Z1dcddd6d7�Z2d a3 a4a5d8d9� Z6ded;d<�Z7 =dfdgdEdF�Z8dhdHdI�Z9 = J didjdTdU�Z:dkdWdX�Z;dldYdZ�Z<d[d\� Z=dS )mzudistutils.util Miscellaneous utility functions -- anything that doesn't fit into one of the other *util.py modules. � )�annotationsN)�Callable�Iterable�Mapping)� TYPE_CHECKING�AnyStr)� pass_none� )�log)�newer)�DistutilsByteCompileError�DistutilsPlatformError)�spawn)�TypeVarTuple�Unpack�_Ts�return�strc C s t �� S )z� Return a string that identifies the current platform. Use this function to distinguish platform-specific build directories and platform-specific built distributions. )� sysconfig�get_platform� r r �N/opt/saltstack/salt/lib/python3.10/site-packages/setuptools/_distutils/util.py�get_host_platform# s r c C s: t jdkrddddd�} t j�d�}| �|�pt� S t� S )N�nt�win32z win-amd64z win-arm32z win-arm64)�x86Zx64Zarm�arm64ZVSCMD_ARG_TGT_ARCH)�os�name�environ�getr )ZTARGET_TO_PLAT�targetr r r r 1 s �r �darwinZMACOSX_DEPLOYMENT_TARGETc C s da dS )zFor testing only. Do not call.N)�_syscfg_macosx_verr r r r �_clear_cached_macosx_verC s r$ c C s. t du rddlm} | �t�pd}|r|a t S )z�Get the version of macOS latched in the Python interpreter configuration. Returns the version as a string or None if can't obtain one. Cached.Nr )r � )r# � distutilsr �get_config_var�MACOSX_VERSION_VAR)r �verr r r �!get_macosx_target_ver_from_syscfgI s r* c C sd t � } tj�t�}|r0| r.t| �ddgkr.t|�ddgk r.dt d|� d| � d� }t|��|S | S )a Return the version of macOS for which we are building. The target version defaults to the version in sysconfig latched at time the Python interpreter was built, unless overridden by an environment variable. If neither source has a value, then None is returned� � �$z mismatch: now "z" but "z*" during configure; must use 10.3 or later)r* r r r r( � split_versionr )Z syscfg_verZenv_verZmy_msgr r r �get_macosx_target_verV s ����r/ �s� list[int]c C s dd� | � d�D �S )zEConvert a dot-separated string into a list of numbers for comparisonsc S s g | ]}t |��qS r )�int)�.0�nr r r � <listcomp>x s z!split_version.<locals>.<listcomp>�.)�split)r0 r r r r. v s r. �pathname�str | os.PathLike[str]c C s t �t�| ��S )a. Allow for pathlib.Path inputs, coax to a native path string. If None is passed, will just pass it through as Setuptools relies on this behavior. >>> convert_path(None) is None True Removes empty paths. >>> convert_path('foo/./bar').replace('\\', '/') 'foo/bar' )r �fspath�pathlib�PurePath)r8 r r r �convert_path{ s r= �new_root�AnyStr | os.PathLike[AnyStr]r c C s� t jdkrt j�|�st j�| |�S t j�| |dd� �S t jdkr>t j�|�\}}|d t jkr7|dd� }t j�| |�S tdt j� d���)a Return 'pathname' with 'new_root' prepended. If 'pathname' is relative, this is equivalent to "os.path.join(new_root,pathname)". Otherwise, it requires making 'pathname' relative and then joining the two, which is tricky on DOS/Windows and Mac OS. �posixr Nr r znothing known about platform '�')r r �path�isabs�join� splitdrive�sepr )r>