L iӏZ dZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl mZmZmZddlZddlmZmZddlmZddlmZddlmZdd lmZmZmZdd lmZm Z m!Z!dd l"m#Z#m$Z$m%Z%dd l&m'Z'dd l(m)Z)m*Z*ddl+m,Z,dDdZ-GddZ.Gddej^Z0Gdde0Z1Gdde0Z2e.jfe.jhe.jjgZ6e2de.jne.jpe.jre.jte.jvge6zde-de2de.jxe.jze.j|e.j~ge6zde-de2de6d e-d!e2d"e.jzge6zd#$e2d%e6d&d'e2d(e.je.jne.jpe.je.jre.jte.jve.je.j~e.je.je.je.je.jge6zde-d)e2d*e.je.jpe.je.jre.jte.jve.je.je.j~e.jg e6zdd+e2d,e.jpe.je.jre.jte.je.jve.j~ge6zdd-e2d.e.je.jpe.je.je.jre.jte.jve.je.je.je.je.je.jg e6zdd/e2d0e.jxe.je.je.je.je.jte.je.jve.je.je.je.je.jg e6zd1d2e2d3e.jpe.je.jre.jte.jve.je.j~e.jge6zdd4d5 ZY dE dFd6ZZd7\Z[Z\Z]Gd8d9Z^dGd:Z_dHd;Z`d<e-d=d>d?ZadIdJd@ZbejdAZdedrddBlemfZfebZg dI dJdCZbyy)Kz%Command-line support for coverage.py.) annotationsN)AnyNoReturncast)Coverageenv)CoverageConfig)DEFAULT_DATAFILE) CTRACER_FILE) CoverageDatacombinable_filesdebug_data_file) info_header short_stackwrite_formatted_info)NoSourceCoverageException_ExceptionDuringRun)PyRunner)display_coveredshould_fail_under)__url__c@dj|jS)zCTurn a multi-line string into one line for help to reformat nicely. )joinsplit)texts V/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/coverage/cmdline.pyoneliner$s 88DJJL !!c eZdZdZej ddddZej dddd Zej dd d d ed jdje e jZej ddd ddZej ddd dedZej ddd dedZej ddd dedZej ddd dedZej ddd ddZej d d!d d"d#Zej dd$d d%d&d'(Zej dd)d d*d+Z ej d,d-dd.Zej d/d0dd1Zej dd2d d3ed4Zej dd5dd6Zej d7d8ded9Zej d:d;dd<Zej d:d=ded>Zej dd?d d3ed@Zej dAdd dBddCDZej dAdd dBddEDZ ej dAdd dBddFDZ!ej ddGddHZ"ej dIdJdedKZ#ej ddLd dMe$edN(Z%ej dOdPddQZ&ej ddRd edSZ'ej ddTd dUdVdWgedXYZ(ej dZdd[Z)ej d\dd]Z*ej d^d_d`dabZ+ej dcdddZ,ej ded dfedgZ-ej ddhd didjZ.ej ddkddlZ/ej ddmd dndoZ0ej ddpddqZ1yr)sOptszBA namespace class for individual options we'll build parsers from.z-az--append store_truezBAppend data to the data file. Otherwise it starts clean each time.)actionhelpz--branchz:Measure branch coverage in addition to statement coverage.z --concurrencystoreLIBSz Properly measure code using a concurrency library. Valid values are: {}, or a comma-list of them. z, )r$metavarr%z --contextLABELz2The context label to record for this coverage run.z --contextszREGEX1,REGEX2,...z Only display data from lines covered in the given contexts. Accepts Python regexes, which must be quoted. z --data-fileDATAFILEz~ Base name of the data files to operate on. Defaults to '.coverage'. [env: COVERAGE_FILE] INFILEz Read coverage data for report generation from this file. Defaults to '.coverage'. [env: COVERAGE_FILE] OUTFILEz Write the recorded coverage data to this file. Defaults to '.coverage'. [env: COVERAGE_FILE] z--debugOPTSz9Debug options, separated by commas. [env: COVERAGE_DEBUG]z-dz --directoryDIRzWrite the output files to DIR.z --fail-underMINfloatz?Exit with a status of 2 if the total coverage is less than MIN.)r$r)typer%z--formatFORMATz9Output format, either text (default), markdown, or total.z-hz--helpzGet help on this command.z-iz--ignore-errorsz)Ignore errors while reading source files.z --includez PAT1,PAT2,...z Include only files whose paths match one of these patterns. Accepts shell-style wildcards, which must be quoted. z--keepz9Keep original coverage files, otherwise they are deleted.z-Lz--pylibz} Measure coverage even inside the Python installed library, which isn't done by default. -mz--show-missingzEShow line numbers of statements in each module that weren't executed.--modulez is an importable Python module, not a script path, to be run as 'python -m' would run it. z--omitz Omit files whose paths match one of these patterns. Accepts shell-style wildcards, which must be quoted. z-ooutfilez=Write the XML report to this file. Defaults to 'coverage.xml')r$destr)r%z?Write the JSON report to this file. Defaults to 'coverage.json'z?Write the LCOV report to this file. Defaults to 'coverage.lcov'z--pretty-printz"Format the JSON for human readers.z-pz--parallel-modez Append a unique suffix to the data file name to collect separate data from multiple processes. z --precisionNz| Number of digits after the decimal point to display for reported coverage percentages. z-qz--quietz-Don't print messages about what is happening.z--rcfilez Specify configuration file. By default '.coveragerc', 'setup.cfg', 'tox.ini', and 'pyproject.toml' are tried. [env: COVERAGE_RCFILE] z --save-signalSIGNALUSR1USR2z Specify a signal that will trigger coverage to write its collected data. Supported values are: USR1, USR2. Not available on Windows. )r$r)choicesr%z--show-contextsz Show contexts for covered lines.z--skip-coveredzSkip files with 100% coverage.z--no-skip-covered store_false skip_coveredzDisable --skip-covered.)r$r7r%z --skip-emptyzSkip files with no code.z--sortCOLUMNz Sort the report by the named column: name, stmts, miss, branch, brpart, or cover. Default is name. z--sourcez SRC1,SRC2,...z=A list of directories or importable names of code to measure.z--timidz*Use the slower Python trace function core.z--titleTITLEz.A text string to use as the title on the HTML.z --versionz%Display version information and exit.N)2__name__ __module__ __qualname____doc__optparse make_optionappendbranchrformatrsortedr CONCURRENCY_CHOICES concurrencycontextcontextsdatafile datafle_inputdatafile_outputdebug directory fail_underr% ignore_errorsincludekeeppylib show_missingmoduleomit output_xml output_json output_lcovjson_pretty_print parallel_modeint precisionquietrcfile save_signal show_contextsr>no_skip_covered skip_emptysortsourcetimidtitleversionr rr"r")sL "X ! !  Q F "X ! !  I F '(&&    &6."D"DEF G K#h""  A G$x## #   H$x##    H)H((    M+h**    O !H   H  E%$$  - I&%%   N J"X ! !  H F 8    (  D )H((  8 M #h""    G 8    H  D !H     E(8''  T L "X ! !    F 8      D&%%    L J'(&&    N K'(&&    N K-,,  1  )H((    M%$$     I !H   <  E "X ! !    F'(&&    K)H(( /M (8'' -L +h**  & O &%% 'J 8     D"X ! !  L F !H   9  E !H   =  E#h""  4 Gr r"cNeZdZdZdfd ZGddeZdfd Zd dZxZ S) CoverageOptionParserz|Base OptionParser for coverage.py. Problems don't exit the program. Defaults are initialized for all options. c.d|d<t||i||jd$iddddddddddddd dd dd dd dd dddddddddddddddddddddddddddddddddddd dd!dd"dd#d|jy)%NFadd_help_optionr$rGrHrLrMrN data_filerRrSrTrIr%rUrVrWrZr[r`rbrXrcrdTrerfrYr>rhrirjrkrlrmrn)super__init__ set_defaultsdisable_interspersed_args)selfargskwargs __class__s rruzCoverageOptionParser.__init__zs$) ! $)&)" " "  "  "  " " " " " " " " " " !" "#" $%" &'" ()" *+" ,-" ./" 01" 23" 45" 67" 89" :;" <=" >?" @A" BC" H &&(r ceZdZdZy)&CoverageOptionParser.OptionParserErrorz;Used to stop the optparse error handler ending the process.N)rArBrCrDrnr rOptionParserErrorr}sI r r~ch t||\}}d||fS#|j$rddgfcYSwxYw)zUCall optparse.parse_args, but return a triple: (ok, options, args) FNT)rt parse_argsr~)rxryoptionsr{s r parse_args_okz"CoverageOptionParser.parse_args_oksM  #!G.t4MGTWd""%% #$? " #s 11c0t||j)z7Override optparse.error so sys.exit doesn't get called.) show_helpr~)rxmsgs rerrorzCoverageOptionParser.errors#$$$r )ryrrzrreturnNone)ry list[str]rz.tuple[bool, optparse.Values | None, list[str]])rstrrr) rArBrCrDru Exceptionr~rr __classcell__r{s@rrprprs$')R I #%r rpc$eZdZdZdfd ZxZS)GlobalOptionParserz)r)rxothers r__eq__zCmdOptionParser.__eq__s+DHH:Q777r cBt|}|d|jS)z>Override of an undocumented function in optparse.OptionParser.r)rt get_prog_namer)rx program_namer{s rrzCmdOptionParser.get_prog_names'w,. q ++r r)r$rrzlist[optparse.Option]rrr str | None)rrrbool)rr) rArBrCrDrur__hash__rrrs@rrrsL>! '   28 H,,r rannotatez[options] [modules]z Make annotated copies of the given files, marking statements that are executed with > and statements that are missed with !. rcombinez%[options] ... a| Combine data from multiple coverage files. The combined results are written to a single file representing the union of the data. The positional arguments are data files or directories containing data files. If no paths are provided, data files in the default data file's directory are combined. rRza Display information about the internals of coverage.py, for diagnosing problems. Topics are: 'data' to show a summary of the collected data; 'sys' to show installation information; 'config' to show the configuration; 'premain' to show what is calling coverage; 'pybehave' to show internal flags describing Python behavior; 'sqlite' to show SQLite compilation options. erasez)Erase previously collected coverage data.)rr%z [command]zDescribe how to use coverage.pyhtmlz Create an HTML report of the coverage of the files. Each file gets its own page, with the source decorated to show executed, excluded, and missed lines. jsonz+Generate a JSON report of coverage results.lcovz,Generate an LCOV report of coverage results.reportz&Report coverage statistics on modules.runz$[options] [program options]z/Run a Python program, measuring code execution.xmlz+Generate an XML report of coverage results.) rrrRrr%rrrrrrc|s|s|sJtjd}|jtjj dzrtjj |}tjj|}tjr"d}|j|r|dt| }ttj}t|d<||d<trd|d<nd |d<|r;t!|tj" t!d |d tj" n|r2t!|j%j't!ng|Jt)j*t,j/|d j'}|rt!|j0di|nt!d|t!dj0di|y)z-Display an error message, or the named topic.rz __main__.pyz -script.pyNrrzwith C extensionextension_modifierzwithout C extension)filezUse 'z help' for help.r&zDon't know topic z"Full documentation is at {__url__}rn)sysargvendswithospathsepdirnamebasenamerWINDOWSlendictcoverage__dict__rr printstderr format_helpstriptextwrapdedent HELP_TOPICSgetrI)rtopicparser program_pathr auto_suffix help_paramshelp_msgs rrrs EV# #88A;LRWW[[=89ww|4 77##L1L {{ #   -'(;3{+;*; (),A ()  e#**% l^#343::F  f  "((*+    ??;??5"#=>DDF  /(//0K0 1 %eY/ 0 5 . 5 5 D DEr )rcPeZdZdZd dZd dZ d dZd dZd dZddZ y)CoverageScriptz*The command-line interface to coverage.py.cd|_|y)NF) global_option)rxs rruzCoverageScript.__init__s " r c |stdtS|djd|_|jr t }n6t j |d}|std|dtS|dd}|j|\}}}|stS|J|j|||rtSt|j}t|j}t|j}t|j} t|j} |j |j j#d} nd} t%|j&xst(|j*|j,|j.|j0|j2|||| | d |j4|j6 |_|j:d k(r|j=|S|j:d k(r |j8j?tS|j:d k(r|jA||S|j:dk(r}|jBr|j8jE|xsd} |j8jG| d tI|jJ|j8jMtStOtQ||jR||| } tTjVjYdd|j8jEd}|j:dk(ra|j8jZd#|j\|j^|j`|jb|jd|jfd| }nw|j:dk(r*|j8jhd#d|jji| n>|j:dk(r`|j8jld#|jj|j\|j`|jb|jn|jpd| }n|j:dk(r4|j8jrd#|jt|jbd| }n|j:dk(r?|j8jvd#|jt|jx|jnd| }n>|j:dk(r)|j8jzd#d|jti| }nt|||j~&|j8jd|j~|j\&|j8jd|j\tt|j8jd}tt|j8jd}t|||r0d jgt||||!}td"|tStS)$zThe bulk of the command line interface to coverage.py. `argv` is the argument list to process. Returns 0 if all is well, 1 if something went wrong. minimum_helprr-zUnknown command: rN,T)rs data_suffix cover_pylibrkrH config_filerjr[rVrRrLcheck_preimportedrMmessagesrRrrr)strictrW)morfsrUr[rVrNr&r)rbrYr>rhri output_formatrrSr)rSrbr>rhrfrlr)r6rhr)r6 pretty_printrfrr6zreport:fail_underzreport:precisionz;total of {total} is less than fail-under={fail_under:.{p}f})totalrTpzCoverage failure:rn)IrOK startswithrrCOMMANDSrERRrdo_help unshell_listrjr[rVrRrNrLrrrsr r`rXrkrHrdrMrcrr$do_debugrdo_runrGloadrrrWsaver unglob_argsrUrrinsertrrbrYr>rhrirIrrS html_reportrfrl xml_reportr6 json_reportr lcov_reportAssertionErrorrT set_optionrr1 get_optionrarrr FAIL_UNDER)rxrrokrryrjr[rVrRrNrL data_paths report_argsrrTrbrs r command_linezCoverageScript.command_lines; N +I "!W//4   ')F\\$q'*F-d1g[9: 8D"006GTJ""" <<v .Ignn-GLL)w/W]]+ 0 01    *!--33C8KK!'';+;-- -->>#"OO &  " >>W $==& & ^^w & MM   !I ^^u $;;w- - ^^y (~~ ""$J MM ! !*TW\\@R ! S MM   Id#!//   2  >>X %(DMM((!++$11$11"--\\%nn E^^z ) "DMM " " NW->-> N+ N ^^v %-DMM--!++!++$11"--%33mm E^^u $,DMM,,"--E ^^v %-DMM--$11%33 E ^^v %-DMM--E !  !!- (()P>PQ  , (();W=N=NOeT]]%=%=>Q%RSJS$--":":;M"NOI  I>SZZ)%;)[ )3/!! r cF|jr&|jr tdyt|y|jdk(rG|r8|D]2}tj |}| t|'t|4ytdy|j r tdyy)z`Deal with help requests. Return True if it handled the request, False if not. r%r)rTrmF)r%rrr$rrrm)rxrryra parser_maybes rrzCoverageScript.do_helps <<!!'( >>V #+A#+<<?L#/!6!* +' ?? I &r cRtdd|jjy)z&Signal handler to save coverage reportzSaving coverage data...T)flushN)rrr)rx_signum_frames rdo_signal_savezCoverageScript.do_signal_saves 't4 r c |sr|jrtdtStt|j j d}|*tj|}|r|ddvr d|_|dd}|stdtS|jr,|j j d rtd tS|jd k(r-d D](}t||td d|dztcSdtjd<t|t|j}|j!|jr|j j#|j$r^t&j(rtdtStt*d|j$}t+j*||j,|j j/d} |j1 |j j5|r|j j7t8S#t2$rd}wxYw#|j j5|r|j j7wwxYw)z!Implementation of 'coverage run'.zNo module specified for -mzrun:command_lineNr>r4r5TrzNothing to do.z run:parallelz,Can't append to data files in parallel mode.multiprocessing)rHrVr[rXrjrkzROptions affecting multiprocessing must only be specified in a configuration file. z Remove --z from the command line.true COVERAGE_RUN) as_modulez*--save-signal is not supported on Windows.SIGF)rZrrrrrrshlexrrGrLgetattrrenvironrrpreparerrerrsignalrstartrrstoprr)rxrryropt_namerunnersigcode_rans rrzCoverageScript.do_runs ~~67 T]]%=%=>P%QRL'{{<0DG'99%)GN8D & 'J >>dmm66~F D EJ   "3 3V 7H-97%hZ/FGH J &, >"$$w~~*>? >> MM     {{FG &C(;(;'<"=>C MM#t22 3  % JJL MM    ""$  H   MM    ""$s,H99 II 9Jc|stdtS|ddrtdtS|ddk(r/ttd|jj tS|ddk(rktt d|jjj}t|t|D]}tdt|tS|dd k(r9ttd |jjjtS|dd k(r/tt d ttd tS|dd k(r)ttd tjtS|ddk(r)ttdtj tStd|dtS)z#Implementation of 'coverage debug'.zNWhat information would you like: config, data, sys, premain, pybehave, sqlite?rNz Only one topic at a time, pleaserrdataz-----configpremainT)fullpybehavesqlitezDon't know what you mean by )rrrrrsys_inforrrsrr debug_inforrr r)rxryrsfilenames rrzCoverageScript.do_debug s B J 8 8 9J 7e  t}}/E/E/G H* )!W  +f% & ,,66I I &,Y7 *g) *  !W $--2F2F2Q2Q2S T !W ! +i( ) +4( ) !W "  CNN4D E !W ,2G2G2I J   4T!WK@ AJr Nr)rrrra)roptparse.Valuesryrrzoptparse.OptionParserrr)rrarztypes.FrameType | Nonerr)rrryrrra)ryrrra) rArBrCrDrurrrrrrnr rrrsN4 bH$ $$& $  $L @D#r rcl|sytjr|jd}|jdS)z)Turn a command-line argument into a list.N'r)rrrr)ss rrr1s,  {{ GGCL 773<r ctjrIg}|D]@}d|vsd|vr%|jtj|0|j |B|}|S)z5Interpret shell wildcards for platforms that need it.?*)rrextendglobrG)ryglobbedargs rrr?sV {{ $CczSCZtyy~.s#  $  Kr a Coverage.py, version {__version__} {extension_modifier} Measure, collect, and report on code coverage in Python programs. usage: {program_name} [options] [args] Commands: annotate Annotate source files with execution information. combine Combine a number of data files. debug Display information about the internals of coverage.py erase Erase previously collected coverage data. help Get help on using coverage.py. html Create an HTML report. json Create a JSON report of coverage results. lcov Create an LCOV report of coverage results. report Report coverage stats on modules. run Run a Python program and measure code execution. xml Create an XML report of coverage results. Use "{program_name} help " for detailed help on any command. z Code coverage for Python, version {__version__} {extension_modifier}. Use '{program_name} help' for help. z7Coverage.py, version {__version__} {extension_modifier})r%rrmc|tjdd} tj|}|S#t$r-}t j |jt}Yd}~|Sd}~wt$r^}|jd}|jr'|jddtd|j}t|t}Yd}~|Sd}~wt$r)}|jr|jd}nd}Yd}~|Sd}~wwxYw)z\The main entry point to coverage.py. This is installed as the script entry point. Nrr.z; see z/messages.html#error-)rrrrr tracebackprint_exceptionryrrslugrstriprr SystemExit)rstatuserrrs rmainr1ls  |xx|!..t4( M'  !!388, M hhqk 88ZZ_%VG94I#((TC c  M  88XXa[FF M s-2 C="A## C=/AC C=C88C=COVERAGE_PROFILE)SimpleLauncherc \tj} t||jdd\}}t |j |ddd|j S#|jdd\}}t |j |ddd|j wxYw)z$A wrapper around main that profiles.rd) re_filter max_recordsr&)querylimitrcol)r3launch original_mainr8rshowcancel)rprofilerr_s rr1r1s"((*  &nnzsnKGD! (--d#22-F G OO nnzsnKGD! (--d#22-F G OO s A%%AB+)rrrr)NNN)rrrrrzoptparse.OptionParser | Nonerr)r rrlist[str] | None)ryrrrr)rrArz int | None)hrD __future__rr%rEros.pathrr rrr*typestypingrrrrrrcoverage.configr coverage.controlr coverage.corer coverage.datar r rcoverage.debugrrrcoverage.exceptionsrrrcoverage.execfilercoverage.resultsrrcoverage.versionrrr" OptionParserrprrrRr%rd GLOBAL_ARGSrSrPrUrVr[rGrOrWrcrNrTrbrfr>rgrhrlr]r_r^rIrirYrHrLrMrQrZrXr`rerjrkr\rrrrrrrrrr1getenv_profileox_profile.core.launchersr3r<rnr rrTs`,"    &&"*-&IIIIPP&?$ " FFR E%800E%P  -  (,*(,d JJIIKK   NN       LL II    $  $ KK MM II JJ    6   *   $ MM   @  5    MM NN    OO    LL II NN JJ        OO JJ ! "$  ) 8  MM    OO    LL II     " " JJ      $A! $     OO    LL    II JJ   $B  MM    OO KK    LL II NN II        OO    $<'*  KK KK    LL  LL KK II JJ       KK JJ    5E' *     OO    LL II OO JJ OO   $A _ F+/,F ,F ,F ),F ,F^C{{|   *  I9 @H 299' ( 8M"&      r