3
T'ícX ã @ s d Z ddlZddlZddlZddlZddlmZ ddlmZ ddl m
Z
mZmZm
Z
mZmZmZmZmZmZ ddlmZ ddlmZmZmZ ddlmZ dd lmZmZ dd
lm Z ddl!Z!ddl"m#Z# ddl$m%Z% dd
l&m'Z' ddl(m)Z) ddl*m+Z+ ddl,m-Z- ddl.m/Z/ e
r"ddl0m1Z1 e'j2e3Z4ej5dej6Z7ej5dej6Z8e9e9e:dddZ;G dd de+Z<G dd de<Z=G dd de<Z>G dd de<Z?G d d! d!e<Z@G d"d# d#e<ZAejB ZCG d$d% d%ZDG d&d' d'ZEG d(d) d)ejFZGG d*d+ d+e#ZHd,e
e9ef d-d.d/ZIdS )0zfMimic doctest in Sphinx.
The extension automatically execute code snippets and checks their results.
é N)ÚStringIO)Úpath)
Ú
TYPE_CHECKINGÚAnyÚCallableÚDictÚIterableÚListÚSequenceÚSetÚTupleÚType)Únodes)ÚElementÚNodeÚTextElement)Ú
directives)ÚInvalidSpecifierÚSpecifierSet)ÚVersion)ÚBuilder)Ú__)Úlogging)Úbold)ÚSphinxDirective)Úrelpath)Ú
OptionSpec)ÚSphinxz^\s*<BLANKLINE>z#\s*doctest:.+$)ÚspecÚversionÚreturnc C s t |t| kS )aY Check `spec` satisfies `version` or not.
This obeys PEP-440 specifiers:
https://peps.python.org/pep-0440/#version-specifiers
Some examples:
>>> is_allowed_version('3.3', '<=3.5')
True
>>> is_allowed_version('3.3', '<=3.2')
False
>>> is_allowed_version('3.3', '>3.2, <4.0')
True
)r r )r r © r! ú4/tmp/pip-build-gk9425m9/sphinx/sphinx/ext/doctest.pyÚis_allowed_version( s r# c @ s2 e Zd ZdZdZdZdZdZee dddZ
dS ) Ú
TestDirectivez4
Base class for doctest-related directives.
Tr é )r c