o ~Re#@sHddlZddlZddlmZmZddlmmZGdddejZdS)N)productstarmapc@s\eZdZdZddZddZddZedd Zd d Z ed d Z dddZ ddZ dS) install_libz9Don't add compiled flags to filenames of non-Python filescCs*||}|dur||dSdSN)buildinstall byte_compile)selfoutfilesr /builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-2.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/install_lib.pyrun s zinstall_lib.runcs4fddD}t|}ttj|S)z Return a collections.Sized collections.Container of paths to be excluded for single_version_externally_managed installations. c3s$|] }|D]}|Vq qdSr) _all_packages).0Zns_pkgpkgr r r s z-install_lib.get_exclusions..)_get_SVEM_NSPsr_gen_exclusion_pathssetr_exclude_pkg_path)r Z all_packagesZ excl_specsr rr get_exclusionss zinstall_lib.get_exclusionscCs&|d|g}tjj|jg|RS)zw Given a package name and exclusion path within that package, compute the full exclusion path. .)splitospathjoinZ install_dir)r rZexclusion_pathpartsr r r rszinstall_lib._exclude_pkg_pathccs(|r|V|d\}}}|sdSdS)zn >>> list(install_lib._all_packages('foo.bar.baz')) ['foo.bar.baz', 'foo.bar', 'foo'] rN) rpartition)pkg_namesepchildr r r r's  zinstall_lib._all_packagescCs,|jjsgS|d}|j}|r|jjSgS)z Get namespace packages (list) but only for single_version_externally_managed installations and empty otherwise. r) distributionZnamespace_packagesget_finalized_commandZ!single_version_externally_managed)r Z install_cmdZsvemr r r r1s  zinstall_lib._get_SVEM_NSPsccsddVdVdVttdsdStjddtjj}|dV|d V|d V|d VdS) zk Generate file paths to be excluded for namespace packages (bytecode cache files). z __init__.pyz __init__.pycz __init__.pyoimplementationN __pycache__z __init__.z.pycz.pyoz .opt-1.pycz .opt-2.pyc)hasattrsysrrrr$ cache_tag)baser r r rAs     z install_lib._gen_exclusion_pathsrc sh|r|r|rJ|stj|||Sddlm}ddlmgfdd}||||S)Nr)unpack_directory)logcs<|vr d|dSd|tj|||S)Nz/Skipping installation of %s (namespace package)Fzcopying %s -> %s)warninforrdirnameappend)srcdstexcluder,r r r pfhs z!install_lib.copy_tree..pf)rorigr copy_treeZsetuptools.archive_utilr+ distutilsr,) r infileoutfile preserve_modepreserve_timespreserve_symlinkslevelr+r5r r3r r7Ws   zinstall_lib.copy_treecs.tj|}|rfdd|DS|S)Ncsg|]}|vr|qSr r )rfr4r r ysz+install_lib.get_outputs..)r6r get_outputsr)r outputsr r@r rBus zinstall_lib.get_outputsN)r*r*rr*) __name__ __module__ __qualname____doc__r rr staticmethodrrrr7rBr r r r rs    r) rr' itertoolsrrZdistutils.command.install_libcommandrr6r r r r s