ej@ejBejDfZ#ej>ej<ej@fZ$ee%Z&ddZ'ddZ(ddZ)GddZ*y)a Configuration management setup Some terminology: - name As written in config files. - value Value associated with a name - key Name combined with it's section (section.name) - variant A single word describing where the configuration key-value pair came from ) annotationsN)Iterable)AnyNewType)ConfigurationError!ConfigurationFileCouldNotBeLoaded)appdirs)WINDOWS) getLogger) ensure_direnumKindzpip.inizpip.conf)versionhelpuserglobalsiteenvzenv-var)USERGLOBALSITEENVENV_VARch|jjdd}|jd}|S)zAMake a name consistent regardless of source (environment or file)_-z--)lowerreplace removeprefix)names g/mnt/ssd/data/python-lab/DaemonControl/venv/lib/python3.12/site-packages/pip/_internal/configuration.py_normalize_namer"5s/ ::<  S )D   T "D KcPd|vrd|d}t||jddS)N.zVKey does not contain dot separated section and key. Perhaps you wanted to use 'global.z ' instead?)rsplit)r error_messages r!_disassemble_keyr)<s> $ 115j B !// ::c1 r#cdtjdDcgc]&}tjj |t (}}tjj t jt }tjj tjjdtrdndt }tjj tjdt }tj|tj|gtj||giScc}w)Npip~z.pip)r site_config_dirsospathjoinCONFIG_BASENAMEsysprefix expanduserr user_config_dirkindsrrr)r/global_config_filessite_config_filelegacy_config_filenew_config_files r!get_configuration_filesr;Fs8?8P8PQV8W04 T?+ww||CJJ@ 3f ggll7#:#:5#A?SO ) %& '9 s+D-ceZdZdZddfd ZddZddZddZddZddZ ddZ dd Z dd Z e dd Zdd Zd d Zd!dZddZ d"dZd#dZd$dZd%dZd&dZd'dZd(dZxZS)) ConfigurationaHandles management of configuration. Provides an interface to accessing and managing configuration files. This class converts provides an API that takes "section.key-name" style keys and stores the value associated with it as "key-name" under the section "section". This allows for a clean interface wherein the both the section and the key-name are preserved in an easy to manage form in the configuration files and the data stored is also nice. c Rt||C|tvr;tdj dj t tt||_||_ tDcic]}|gc}|_ tDcic]}|ic}|_ g|_ ycc}wcc}w)Nz5Got invalid value for load_only - should be one of {}z, )super__init__VALID_LOAD_ONLYrformatr0mapreprisolated load_onlyOVERRIDE_ORDER_parsers_config_modified_parsers)selfrErFvariant __class__s r!r@zConfiguration.__init__gs   Yo%E$GNNIIc$89  ! "(6H #GRKH  (6? #GRK?  EG H ? s + B B$c^|j|js|jyy)z> !$%NO O ;T^^Lr#c\i}tD] }|j|j|"|S)z3A dictionary representing the loaded configuration.)rGr]rI)rKretvalrLs r!rXzConfiguration._dictionarys4 % 1G MM$,,w/ 0 1 r#ct|j}|tjddtj gk(rt jdy|jD]q\}}|D]g}|j'||jk7rt jd||6|j||}|j|j||fisy)z,Loads configuration from configuration filesrr&zZSkipping loading configuration files due to environment's PIP_CONFIG_FILE being os.devnullNz Skipping file '%s' (variant: %s)) dictiter_config_filesr6rr.devnullrvrrYrF _load_filerHappend)rK config_filesrLfilesrlrms r!rOz Configuration._load_config_filessD2245  "1Q 'BJJ< 7 LLA  *002 ?NGU ?>>-'T^^2KLL!CUGT%8 g&--ufo> ? ?r#cBtjd|||j|}|jD]c}|j |}|j |j |i|j ||j|j||e|S)Nz'For variant '%s', will try loading '%s') rvverbose_construct_parsersectionsrYrIrir]_normalized_keys)rKrLrlrmrnrYs r!rzConfiguration._load_files@'5Q''.( WGLL)E LL ! , ,UB 7 LL !% ( / /0E0Egu0U V W  r#cBtj}tjj |r+t j d} |j|||S|S#t$rtd|d|tj$r}t|d}~wwxYw)NF)encodingzcontains invalid z characters)reasonrl)r}) configparserRawConfigParserr.r/existslocalegetpreferredencodingreadUnicodeDecodeErrorrError)rKrlrmlocale_encodingr}s r!rzConfiguration._construct_parser!s--/ 77>>% $99%@O E EO < v & 7..?{K %% E7eDD Es A!!,B BBc|jtjjdi|jtjdj |j d|j y)z.Loads configuration from environment variablesz:env:N)rIr6rrir]rget_environ_varsrQs r!rPz$Configuration._load_environment_vars6sX U]]#..w; U]]#G,33  ! !'4+@+@+B C r#cJi}|D]\}}|dzt|z}|||<|S)zNormalizes items to construct a dictionary with normalized keys. This routine is where the names become keys and are made the same regardless of source - configuration files or environment. r%)r")rKrnrY normalizedr valr_s r!rzConfiguration._normalized_keys=s@  "ID#C-/$"77C!JsO "r#c#KtjjD]9\}}|jds|ddj }|t vs4||f;yw)z@Returns a generator with all environmental vars with prefix PIP_PIP_N)r.environrY startswithrENV_NAMES_IGNORED)rKr_rr s r!rzConfiguration.get_environ_varsKsU ((* $HC~~f%12w}}00)O  $s6AA Ac#Ktjjdd}t}tj |tj f|j xr$|xrtjj| }|r%tj|tjftj|tjf|tj|gfytjgfyw)aYields variant and configuration files associated with it. This should be treated like items of a dictionary. The order here doesn't affect what gets overridden. That is controlled by OVERRIDE_ORDER. However this does control the order they are displayed to the user. It's probably most ergonomic to display things in the same order as OVERRIDE_ORDER PIP_CONFIG_FILEN) r.rgetr;r6rrEr/rrrr)rKenv_config_filershould_load_user_configs r!rzConfiguration.iter_config_filesTs**..):DA.0 llL666'+mm"3#  ? ?9  #**l5::66 6jj,uzz222  &))o.. .))R- sCc |j|S)z#Get values present in a config file)rI)rKrLs r!get_values_in_configz"Configuration.get_values_in_configts||G$$r#ct|jsJ|j|j}|s td|dS)Nz4Fatal Internal error [id=2]. Please report as a bug.)rFrHr)rKparserss r!rTz#Configuration._get_parser_to_modifyxs?~~~--/$F  r{r#c`||f}||jvr|jj|yyN)rJr)rKrlrmfile_parser_tuples r!rjzConfiguration._mark_as_modifieds4"FO D$:$: :  " " ) )*; < ;r#cN|jjd|jdS)N())rM__name__rXrQs r!__repr__zConfiguration.__repr__s'..))*!D,<,<+?qAAr#r)rEboolrFz Kind | NonereturnNone)rr)rz str | None)rIterable[tuple[str, Any]])r_strrr)r_rrkrrr)r_rrr)rzdict[str, dict[str, Any]])rLrrlrrr)rlrrr)rnrrYrrdict[str, Any])rzIterable[tuple[str, str]])rz Iterable[tuple[Kind, list[str]]])rLrrr)rztuple[str, RawConfigParser])rlrrmrrr)rr)r __module__ __qualname____doc__r@rRrVrYrcrorsr~repropertyrXrOrrrPrrrrrTrjr __classcell__)rMs@r!r=r=Ys G** ( B.( 2D0M   ?. *   #<   $ @% = Br#r=)r rrr)r rrz list[str])rzdict[Kind, list[str]])+r __future__rrrr.r2collections.abcrtypingrrpip._internal.exceptionsrrpip._internal.utilsr pip._internal.utils.compatr pip._internal.utils.loggingr pip._internal.utils.miscr r rrrr1rr6rrrrrrGrArrvr"r)r;r=r#r!rs # $(.15..vs&)J%      uzz5::uyy%--O**ellEJJ6 8 &sBsBr#