File: //usr/share/dh-python/dhpython/__pycache__/markers.cpython-310.pyc
o
O�Ib� � @ sD d Z ddlZe�dej�Ze�dej�ZG dd� de�Zdd� ZdS ) z�
Handle Environment Markers
https://www.python.org/dev/peps/pep-0508/#environment-markers
TODO: Ideally replace with the packaging library, but the API is currently
private: https://github.com/pypa/packaging/issues/496
� Nz�
(?P<marker>[a-z_]+)
\s*
(?P<op><=?|>=?|[=!~]=|===)
\s*
(?P<quote>['"])
(?P<value>.*) # Could contain additional markers
(?P=quote)
z0
(?:\s|\))
(?:and|or)
(?:\s|\()
c @ s e Zd ZdS )�ComplexEnvironmentMarkerN)�__name__�
__module__�__qualname__� r r �(/usr/share/dh-python/dhpython/markers.pyr 0 s r c C sp | � � } | �d�r| �d�r| dd� � � } t�| �}|r t� �t�| �}|s*t� �|�d�|�d�|�d�fS )z5Parse a simple marker of <= 1 environment restriction�(�)� ����marker�op�value) �strip�
startswith�endswith�COMPLEX_ENV_MARKER_RE�searchr �SIMPLE_ENV_MARKER_RE�match�group)r �mr r r �parse_environment_marker4 s
�r ) �__doc__�re�compile�VERBOSEr r � Exceptionr r r r r r �<module> s � �