~f8 ddlZddlmZddlZddlmZej jZGddZ Gdde Z y) N)log)py39cVeZdZdZdZdZdZdZdZ dZ dZ d Z d Z e d Zy ) Installerz -nspkg.pthc|j}|sy|j}|jj|t j d|t |j|}|jr t|yt|dtj5}|j|dddy#1swYyxYw)Nz Installing %swt)encoding)_get_all_ns_packages_get_nspkg_fileoutputsappendrinfomap_gen_nspkg_linedry_runlistopenrLOCALE_ENCODING writelines)selfnspfilenamelinesfs ^/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/setuptools/namespaces.pyinstall_namespaceszInstaller.install_namespacess'') '') H% (+D((#. << K  (D4+?+? @ A LL    s B::Cc|j}tjj|syt j d|tj |y)Nz Removing %s)r ospathexistsrrremove)rrs runinstall_namespaceszInstaller.uninstall_namespaces s='')ww~~h'  ) (ctjj|j\}}||jzSN)rr splitext _get_target nspkg_ext)rr_s rr zInstaller._get_nspkg_file's2gg&&t'7'7'9: !$..((r$c|jSr&)targetrs rr(zInstaller._get_target+s {{r$)zimport sys, types, osz$p = os.path.join(%(root)s, *%(pth)r)z(importlib = __import__('importlib.util')z!__import__('importlib.machinery')zm = sys.modules.setdefault(%(pkg)r, importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec(%(pkg)r, [os.path.dirname(p)])))zCm = m or sys.modules.setdefault(%(pkg)r, types.ModuleType(%(pkg)r))z7mp = (m or []) and m.__dict__.setdefault('__path__',[])z(p not in mp) and mp.append(p))z4m and setattr(sys.modules[%(parent)r], %(child)r, m)cy)Nz$sys._getframe(1).f_locals['sitedir']r-s r _get_rootzInstaller._get_rootCs5r$ct|jd}|j}|j}|j d\}}}|r||j z }dj |tzdzS)N.; )tuplesplitr0 _nspkg_tmpl rpartition_nspkg_tmpl_multijoinlocals)rpkgpthroot tmpl_linesparentsepchilds rrzInstaller._gen_nspkg_lineFsnCIIcN#~~%%  ^^C0U  $00 0Jxx #fh.55r$c |jjxsg}ttt t |j |S)z,Return sorted list of all package namespaces) distributionnamespace_packagessortedsetflattenr _pkg_names)rpkgss rr zInstaller._get_all_ns_packagesOs8  339rc'#doot"<=>??r$c#K|jd}|r'dj||j|r&yyw)z Given a namespace package, yield the components of that package. >>> names = Installer._pkg_names('a.b.c') >>> set(names) == set(['a', 'a.b', 'a.b.c']) True r2N)r6r:pop)r<partss rrIzInstaller._pkg_namesTs4 #((5/ ! IIKs9>>N)__name__ __module__ __qualname__r)rr#r r(r7r9r0rr staticmethodrIr/r$rrr sTI $)K (Q;66@   r$rceZdZdZdZy)DevelopInstallerc>tt|jSr&)reprstregg_pathr-s rr0zDevelopInstaller._get_rootesC &''r$c|jSr&)egg_linkr-s rr(zDevelopInstaller._get_targeths }}r$N)rNrOrPr0r(r/r$rrSrSds (r$rS) r distutilsr itertoolscompatrchain from_iterablerHrrSr/r$rr_s;  // ' 'VVryr$