• File: monkey.cpython-37.opt-1.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python37/lib/python3.7/site-packages/setuptools/__pycache__/monkey.cpython-37.opt-1.pyc
  • Date Modified: 11/13/2023 9:30 PM
  • File size: 4.44 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
B

mRea@sdZddlZddlZddlZddlZddlZddlmZddl	Z	ddl
Z
gZddZddZ
dd	Zd
dZdd
ZddZddZddZdS)z
Monkey patching of distutils.
N)
import_modulecCs"tdkr|f|jSt|S)am
    Returns the bases classes for cls sorted by the MRO.

    Works around an issue on Jython where inspect.getmro will not return all
    base classes if multiple classes share the same name. Instead, this
    function will return a tuple containing the class itself, and the contents
    of cls.__bases__. See https://github.com/pypa/setuptools/issues/1024.
    ZJython)platformZpython_implementation	__bases__inspectZgetmro)clsrB/opt/alt/python37/lib/python3.7/site-packages/setuptools/monkey.py_get_mros	r	cCs.t|trtnt|tjrtndd}||S)NcSsdS)Nr)itemrrr<lambda>(zget_unpatched.<locals>.<lambda>)
isinstancetypeget_unpatched_classtypesFunctionTypeget_unpatched_function)r
lookuprrr
get_unpatched$srcCs:ddt|D}t|}|jds6d|}t||S)zProtect against re-patching the distutils if reloaded

    Also ensures that no other distutils extension monkeypatched the distutils
    first.
    css|]}|jds|VqdS)
setuptoolsN)
__module__
startswith).0rrrr	<genexpr>4sz&get_unpatched_class.<locals>.<genexpr>	distutilsz(distutils has already been patched by %r)r	nextrrAssertionError)rZexternal_basesbasemsgrrrr-srcCstjtj_tjdk}|r"tjtj_tjdkp^dtjko@dknp^dtjkoZdkn}|rrd}|tjj	_
tx"tjtjtj
fD]}tjj|_qWtjjtj_tjjtj_dtjkrtjjtjd_tdS)N)r)
)r)rr$)rr zhttps://upload.pypi.org/legacy/zdistutils.command.build_ext)rZCommandrZcoresysversion_infofindallZfilelistZconfigZ
PyPIRCCommandZDEFAULT_REPOSITORY_patch_distribution_metadatadistcmdZDistribution	extensionZ	Extensionmodules#patch_for_msvc_specialized_compiler)Zhas_issue_12885Zneeds_warehouseZ	warehousemodulerrr	patch_all?s$





r0cCs.x(dD] }ttj|}ttjj||qWdS)zDPatch write_pkg_file and read_pkg_file for higher metadata standards)Zwrite_pkg_fileZ
read_pkg_fileZget_metadata_versionN)getattrrr*setattrrZDistributionMetadata)attrZnew_valrrrr)fs
r)cCs*t||}t|d|t|||dS)z
    Patch func_name in target_mod with replacement

    Important - original must be resolved by name to avoid
    patching an already patched function.
    	unpatchedN)r1vars
setdefaultr2)ZreplacementZ
target_mod	func_nameZoriginalrrr
patch_funcms
r8cCs
t|dS)Nr4)r1)	candidaterrrr~srcstdtdkrdSfdd}t|d}t|d}yt|dt|d	Wntk
rlYnXyt|d
Wntk
rYnXyt|dWntk
rYnXdS)z\
    Patch functions in distutils to use standalone Microsoft Visual C++
    compilers.
    zsetuptools.msvcZWindowsNcsLd|krdnd}||d}t|}t|}t||sBt||||fS)zT
        Prepare the parameters for patch_func to patch indicated function.
        msvc9Zmsvc9_Zmsvc14__)lstripr1rhasattrImportError)Zmod_namer7Zrepl_prefixZ	repl_namereplmod)msvcrrpatch_paramss

z9patch_for_msvc_specialized_compiler.<locals>.patch_paramszdistutils.msvc9compilerzdistutils._msvccompilerZfind_vcvarsallZquery_vcvarsallZ_get_vc_envZgen_lib_options)rrsystem	functoolspartialr8r>)rBr:Zmsvc14r)rArr.s&
r.)__doc__r&Zdistutils.filelistrrrrD	importlibrrr__all__r	rrr0r)r8rr.rrrr<module>s"	'