/usr/lib/python3/dist-packages/setuptools/__pycache__
Edit: /usr/lib/python3/dist-packages/setuptools/__pycache__/monkey.cpython-310.pyc (4603B)
o
_aa @ s d Z ddlZddlZddlZddlZddlZddlmZ ddl Z ddl
Z
g Z dd Zdd Z
dd Zd
d Zdd
Zdd Zdd Zdd ZdS )z
Monkey patching of distutils.
N)
import_modulec C s" t dkr| f| j S t| 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.
Jython)platformpython_implementation __bases__inspectgetmro)cls r
3/usr/lib/python3/dist-packages/setuptools/monkey.py_get_mro s
r c C s. t | trtnt | tjrtndd }|| S )Nc S s d S )Nr
)itemr
r
r
( s zget_unpatched..)
isinstancetypeget_unpatched_classtypesFunctionTypeget_unpatched_function)r
lookupr
r
r
get_unpatched$ s
r c C s: dd t | D }t|}|jdsd| }t||S )zProtect against re-patching the distutils if reloaded
Also ensures that no other distutils extension monkeypatched the distutils
first.
c s s | ]}|j d s|V qdS )
setuptoolsN)
__module__
startswith).0r r
r
r 3 s
z&get_unpatched_class.. distutilsz(distutils has already been patched by %r)r nextr r AssertionError)r external_basesbasemsgr
r
r r - s r c C s t jtj_tjdk} | rt jtj_tjdk p/dtj k o dk n p/dtj k o-dkn }|r9d}|tjj _
t tjtjtj
fD ]}t jj|_qDt jjtj_t jjtj_dtjv ret jjtjd _t d S )N) r" )
)r" )r" r' )r" r# zhttps://upload.pypi.org/legacy/zdistutils.command.build_ext)r Commandr coresysversion_infofindallfilelistconfig
PyPIRCCommandDEFAULT_REPOSITORY_patch_distribution_metadatadistcmdDistribution extension Extensionmodules#patch_for_msvc_specialized_compiler)has_issue_12885needs_warehouse warehousemoduler
r
r patch_all? s*
r> c C s* dD ]} t tj| }ttjj| | qdS )zDPatch write_pkg_file and read_pkg_file for higher metadata standards)write_pkg_file
read_pkg_fileget_metadata_versionN)getattrr r3 setattrr DistributionMetadata)attrnew_valr
r
r r2 f s r2 c C s* 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)rB vars
setdefaultrC )replacement
target_mod func_nameoriginalr
r
r
patch_funcm s
rN c C s
t | dS )NrG )rB ) candidater
r
r r ~ s
r c s t d t dkrdS fdd} t| d}t| d}zt|d t|d W n ty5 Y nw zt|d
W n tyG Y nw z t|d W dS ty[ Y dS w )z\
Patch functions in distutils to use standalone Microsoft Visual C++
compilers.
zsetuptools.msvcWindowsNc sL d| v rdnd}|| d }t |}t| }t||s!t||||fS )zT
Prepare the parameters for patch_func to patch indicated function.
msvc9msvc9_msvc14__)lstriprB r hasattrImportError)mod_namerL repl_prefix repl_namereplmodmsvcr
r patch_params s
z9patch_for_msvc_specialized_compiler..patch_paramszdistutils.msvc9compilerzdistutils._msvccompilerfind_vcvarsallquery_vcvarsall_get_vc_envgen_lib_options)r r system functoolspartialrN rW )r_ rQ msvc14r
r] r r9 s,
r9 )__doc__r+ distutils.filelistr r r re importlibr r r __all__r r r r> r2 rN r r9 r
r
r
r s&