File: //opt/osm/venv/lib/python3.10/site-packages/setuptools/_distutils/__pycache__/util.cpython-310.pyc
o
0i�F � @ sF d Z ddlZddlZddlZddlZddlZddlZddlZddl Z ddl
mZmZ ddl
mZ ddlmZ ddlmZ dd� Zd d
� ZejdkrKdadZd
d� Zdd� Zdd� Zdd� Zdd� Zdd� Ze �� dd� �Zdd� Z dd� Z!d/d d!�Z"d a# a$a%d"d#� Z&d$d%� Z'd0d&d'�Z(d(d)� Z) * d1d+d,�Z*d-d.� Z+dS )2zudistutils.util
Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
� N)�DistutilsPlatformError�DistutilsByteCompileError)�newer)�spawn)�logc C s� t jdk rtjdkrdt j�� v rdS dt j�� v rdS t jdk rHtjdkrHttd �rHt�� \} }}}}| d
d� dkrHd
dlm } || ||�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.
)� � �ntz(arm)� win-arm32z(arm64)� win-arm64)r � �posix�unameNr �aix� )�aix_platform)�sys�version_info�os�name�version�lower�hasattrr Z
py38compatr � sysconfig�get_platform)�osname�host�releaser �machiner � r �H/opt/osm/venv/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 )Nr �win32z win-amd64r
r )�x86�x64�arm�arm64�VSCMD_ARG_TGT_ARCH)r r �environ�getr! )ZTARGET_TO_PLAT�targetr r r r 3 s
�r �darwin�MACOSX_DEPLOYMENT_TARGETc C s da dS )zFor testing only. Do not call.N)�_syscfg_macosx_verr r r r �_clear_cached_macosx_verE 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_syscfgK s r4 c C s^ t � } tj�t�}|r-| r+t| �ddgkr+t|�ddgk r+dt d|| f }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�
r �$zE mismatch: now "%s" but "%s" during configure; must use 10.3 or later)r4 r r( r) r2 �
split_versionr )Z
syscfg_verZenv_verZmy_msgr r r �get_macosx_target_verX s ���r8 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>z s z!split_version.<locals>.<listcomp>�.)�split)�sr r r r7 x s r7 c C s� t jdkr| S | s| S | d dkrtd| ��| d dkr#td| ��| �d�}d|v r5|�d� d|v s,|s:t jS t jj|� S )a� Return 'pathname' as a name that will work on the native filesystem,
i.e. split it on '/' and put it back together again using the current
directory separator. Needed because filenames in the setup script are
always supplied in Unix style, and have to be converted to the local
convention before we can actually use them in the filesystem. Raises
ValueError on non-Unix-ish systems if 'pathname' either starts or
ends with a slash.
�/r zpath '%s' cannot be absolute���zpath '%s' cannot end with '/'r= )r �sep�
ValueErrorr>