gL iW VddlZddlZddlZddlmZmZddlmZdZ dZ dZ dZ dZ y)N)VERSIONSimport_optional_dependencycd}tjt|5}tddddt j j tsJtdd}|Jy#1swYAxYw)Nz3Missing .*notapackage.* pip .* conda .* notapackagematch notapackageignoreerrors)pytestraises ImportErrorr isinstancevalue __context__)rexc_inforesults k/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/pandas/tests/test_optional_dependency.pytest_import_optionalrsf AE {% 02H"=12 hnn00+ >> > ' h GF >> 22s A**A3cDtjdtdy)Nxlrd)r importorskiprrtest_xlrd_version_fallbackrs v&rcd}tj|}d|_|tj|<|j t |dd}tjt|5tddddtdd}||usJtjt5tdd }ddd|Jd|_td}||usJtjtd 5tdd dddtjt5tddd }ddd|Jtdd d }|Jy#1swYxYw#1swYxYw#1swYhxYw#1swYDxYw)N fakemodule0.9.01.0.01Pandas requires .*1.0.0.* of .fakemodule.*'0.9.0'rz0.8) min_versionwarnr zPandas requires version '1.1.0'z1.1.0)r r!r )types ModuleType __version__sysmodulessetitemrr r rrtmassert_produces_warning UserWarning) monkeypatchnamemodulerrs rtest_bad_versionr/sy D   d #F FCKK$0 ?E {% 01"<01( % HF V   # #K 0I+LHI >> F ' 5F V   {*K LF"> 'X7F >>711IIFF  s0& E&E3E("E4EE%(E14E=c4d}tj|}d|_|tj|<d}tj|}t ||||tj|d|<|j t|dd}tjt|5tddddtjt5tdd }dddJd|_td}||usJy#1swYUxYw#1swY2xYw) Nrr submodule.rr rzfakemodule.submoduler"r )r#r$r%r&r'setattrr(rr r rrr)r*r+)r,r-r.sub_namer1rrs rtest_submoduler5Ds  D   d #F FCKKH  *I FHi((1CKK4&($%$0 ?E {% 0;"#9:; # #K 0S+,B6RS >> F '(> ?F Y  ;;SSs" DDD Dcd}tj|}|tj|<|j t |dt jtd5t|dddy#1swYyxYw)NrrzCan't determine .* fakemoduler) r#r$r&r'r(rr r rr)r,r-r.s rtest_no_version_raisesr7]sc D   d #FCKK$0 {*I J)"4()))s  A22A;)r&r#r pandas.compat._optionalrrpandas._testing_testingr)rrr/r5r7rrrr;s2  ' #L2)r