zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
U
G=®dã@s’dZddlmZddlmZzHddlmZddlmZddl    m
Z
ddl    m Z Gdd    „d    eƒZ d
Z Wnek
r|d Z YnXGd d „d eƒZdS)zCdistutils.command.check
 
Implements the Distutils 'check' command.
é)ÚCommand)ÚDistutilsSetupError)ÚReporter)ÚParser)Úfrontend)Únodesc@seZdZd    dd„Zdd„ZdS)
ÚSilentReporterNrÚasciiÚreplacec
Cs"g|_t ||||||||¡dS©N)ÚmessagesrÚ__init__)ÚselfÚsourceÚ report_levelÚ
halt_levelÚstreamÚdebugÚencodingÚ error_handler©rúZD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\setuptools/_distutils/command/check.pyr s ÿzSilentReporter.__init__cOs6|j ||||f¡tj|f|ž||j|dœ|—ŽS)N)ÚlevelÚtype)r ÚappendrÚsystem_messageÚlevels)rrÚmessageÚchildrenÚkwargsrrrrsþÿþzSilentReporter.system_message)Nrr    r
)Ú__name__Ú
__module__Ú __qualname__r rrrrrrs ÿ
rTFc@s`eZdZdZdZdddgZdddgZd    d
„Zd d „Zd d„Z    dd„Z
dd„Z dd„Z dd„Z dS)Úcheckz6This command checks the meta-data of the package.
    z"perform some checks on the package)ÚmetadataÚmzVerify meta-data)ÚrestructuredtextÚrzEChecks if long string meta-data syntax are reStructuredText-compliant)ÚstrictÚsz(Will exit with an error if a check failsr$r&r(cCsd|_d|_d|_d|_dS)z Sets default values for options.réN)r&r$r(Ú    _warnings©rrrrÚinitialize_options0szcheck.initialize_optionscCsdSr rr,rrrÚfinalize_options7szcheck.finalize_optionscCs|jd7_t ||¡S)z*Counts the number of warnings that occurs.r*)r+rÚwarn)rÚmsgrrrr/:sz
check.warncCsL|jr| ¡|jr0tr"| ¡n|jr0tdƒ‚|jrH|jdkrHtdƒ‚dS)zRuns the command.zThe docutils package is needed.rzPlease correct your package.N)r$Úcheck_metadatar&Ú HAS_DOCUTILSÚcheck_restructuredtextr(rr+r,rrrÚrun?s
z    check.runcCsŠ|jj}g}dD]"}t||ƒr(t||ƒs| |¡q|rL| dd |¡¡|jrd|js†| d¡n"|j    r||j
s†| d¡n
| d¡dS)a Ensures that all required elements of meta-data are supplied.
 
        Required fields:
            name, version, URL
 
        Recommended fields:
            (author and author_email) or (maintainer and maintainer_email))
 
        Warns if any are missing.
        )ÚnameÚversionÚurlzmissing required meta-data: %sz, zNmissing meta-data: if 'author' supplied, 'author_email' should be supplied toozVmissing meta-data: if 'maintainer' supplied, 'maintainer_email' should be supplied toozkmissing meta-data: either (author and author_email) or (maintainer and maintainer_email) should be suppliedN) Ú distributionr$ÚhasattrÚgetattrrr/ÚjoinÚauthorÚ author_emailÚ
maintainerÚmaintainer_email)rr$ÚmissingÚattrrrrr1Os    zcheck.check_metadatacCsX|j ¡}| |¡D]>}|d d¡}|dkr8|d}nd|d|f}| |¡qdS)z4Checks if the long string fields are reST-compliant.éÿÿÿÿÚlineNr*z %s (line %s))r8Úget_long_descriptionÚ_check_rst_dataÚgetr/)rÚdataÚwarningrCrrrr3ps
 
zcheck.check_restructuredtextc
CsÆ|jjp
d}tƒ}tjtfd ¡}d|_d|_d|_t    ||j
|j |j |j |j|jd}tj|||d}| |d¡z| ||¡Wn:tk
r¾}z|j dd|d    if¡W5d}~XYnX|jS)
z8Returns warnings when the provided data doesn't compile.zsetup.py)Ú
componentséN)rrrr)rrBz!Could not finish the parsing: %s.Ú)r8Ú script_namerrÚ OptionParserÚget_default_valuesZ    tab_widthZpep_referencesZrfc_referencesrrrZwarning_streamrZerror_encodingZerror_encoding_error_handlerrÚdocumentZ note_sourceÚparseÚAttributeErrorr r)rrGÚ source_pathÚparserÚsettingsZreporterrOÚerrrrE{s. ú ÿzcheck._check_rst_dataN)r r!r"Ú__doc__Ú descriptionÚ user_optionsÚboolean_optionsr-r.r/r4r1r3rErrrrr##sü
! r#N)rVÚdistutils.corerÚdistutils.errorsrZdocutils.utilsrZdocutils.parsers.rstrZdocutilsrrrr2Ú    Exceptionr#rrrrÚ<module>s