,RedddlmZddlmZddlmZmZddlZddlZddl Z ddl Z ddl m Z ddl mZddl Z Gddeje ZGd d ZdS) ) convert_path)log)DistutilsErrorDistutilsOptionErrorN) easy_install) namespacesceZdZdZdZejddgzZejdgzZdZdZ dZ d Z e d Z d Zd Zd ZdZdS)developzSet up package for developmentz%install package in 'development mode') uninstalluzUninstall this source package)z egg-path=Nz-Set the path to be used in the .egg-link filer Fc|jr0d|_||n||dS)NT)r multi_versionuninstall_linkuninstall_namespacesinstall_for_developmentwarn_deprecated_optionsselfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/develop.pyrunz develop.runse > +!%D     ! ! !  % % ' ' ' '  ( ( * * * $$&&&&&cfd|_d|_tj|d|_d|_dS)N.)r egg_pathrinitialize_options setup_pathalways_copy_fromrs rrzdevelop.initialize_options%s6 '--- #rc (|d}|jr"d}|j|jf}t||z|jg|_t j||| |j tj d|jdz}tj|j||_|j|_|j)tj|j|_t+j|j}t+jtj|j|j}||krt/d|zt+j|t+j|tj|j|j|_||j|j|j|_dS)Negg_infoz-Please rename %r to %r before using 'develop'z*.eggz .egg-linkzA--egg-path must be a relative path from the install directory to  project_name)get_finalized_commandbroken_egg_inforregg_nameargsrfinalize_optionsexpand_basedirs expand_dirs package_indexscanglobospathjoin install_diregg_linkegg_baserabspath pkg_resourcesnormalize_pathr Distribution PathMetadatadist_resolve_setup_pathr)reitemplater% egg_link_fntargetrs rr&zdevelop.finalize_options,s  ' ' 3 3  2FH; 22D D11 1[M %d+++    ' 2 2333kK/  T%5{CC   = GOOBK88DM-dm<< / GLL)4= 9 9   v  &!#)*  ".   &vrwr{/K/K L L    22 M   M  rc|tjdd}|tjkrd|ddzz}t jtj |||}|t jtjkr-td|t jtj|S)z Generate a path from egg_base back to '.' where the setup script resides and ensure that path points to the setup path from $install_dir/$egg_path. /z../zGCan't get a consistent path to setup script from installation directory) replacer,seprstripcurdircountr3r4r-r.r)r1r/r path_to_setupresolveds rr8zdevelop._resolve_setup_pathWs!((55< >   }3BI>> > >&*,RY77   rcT|d|dd|dtjr+|tjdt_|t jd|j|j |j sRt|jd5}| |j dz|jzdddn #1swxYwY|d|j|j dS)Nr build_extr?)inplacezCreating %s (link to %s)w ) run_commandreinitialize_command setuptoolsbootstrap_install_fromrinstall_namespacesrinfor0r1dry_runopenwriterrprocess_distributionr7no_deps)rfs rrzdevelop.install_for_developmentmsb $$$ !!+q!999 %%%  , 5   j? @ @ @04J - !!! +T]DMJJJ| @dmS)) @Q ,t>??? @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ !!$ t|3CDDDDDs &C;;C?C?ctj|jrt jd|j|jt|j}d|D}|||j g|j |j gfvrt j d|dS|j stj |j|j s||j|jjrt j ddSdS)NzRemoving %s (link to %s)c6g|]}|S)rB).0lines r z*develop.uninstall_link..s @@@$ @@@rz$Link points to %s: uninstall abortedz5Note: you must uninstall or replace scripts manually!)r,r-existsr0rrQr1rScloserrwarnrRunlink update_pthr7 distributionscripts)r egg_link_filecontentss rrzdevelop.uninstall_links 7>>$- ( ( ) H/ N N N //M@@-@@@H    ! ! !$-1QRRR?JJJ< ) $-(((| ' OODI & & &   $ N HL M M M M M N Nrc||jurtj||S|||jjpgD]}t jt|}t j |}tj |5}| }dddn #1swxYwY|||||dSN)r7rinstall_egg_scriptsinstall_wrapper_scriptsrcrdr,r-r2rbasenameiorSreadinstall_script)rr7 script_name script_pathstrm script_texts rrizdevelop.install_egg_scriptss ty 3D$?? ? $$T*** ,4: M MK'//,{*C*CDDK'**;77K%% *"iikk  * * * * * * * * * * * * * * *   k; L L L L  M Ms#CC C cJt|}tj||Srh)VersionlessRequirementrrjrr7s rrjzdevelop.install_wrapper_scriptss"%d++3D$???rN)__name__ __module__ __qualname____doc__ descriptionr user_optionsboolean_optionscommand_consumes_argumentsrrr& staticmethodr8rrrirjrZrrr r s((9K,;L0L #2k]BO!&'''$$$) ) ) V\*EEE,NNN"MMM$@@@@@rr c$eZdZdZdZdZdZdS)rta Adapt a pkg_resources.Distribution to simply return the project name as the 'requirement' so that scripts will work across multiple versions. >>> from pkg_resources import Distribution >>> dist = Distribution(project_name='foo', version='1.0') >>> str(dist.as_requirement()) 'foo==1.0' >>> adapted_dist = VersionlessRequirement(dist) >>> str(adapted_dist.as_requirement()) 'foo' c||_dSrh)_VersionlessRequirement__distrus r__init__zVersionlessRequirement.__init__s  rc,t|j|Srh)getattrr)rnames r __getattr__z"VersionlessRequirement.__getattr__st{D)))rc|jSrhr rs ras_requirementz%VersionlessRequirement.as_requirements   rN)rvrwrxryrrrrZrrrtrtsK  ***!!!!!rrt)distutils.utilr distutilsrdistutils.errorsrrr,r+rlr3setuptools.command.easy_installrrNrDevelopInstallerr rtrZrrrs ''''''AAAAAAAA 888888!!!!!!Z@Z@Z@Z@Z@j)<Z@Z@Z@z!!!!!!!!!!r