RedddlZddlmZmZmZddlmZddlmZm Z ddl m Z GddZ dS)N)ListOptionalTuple)Tag) get_supportedversion_info_to_nodot)normalize_version_infoc eZdZdZgdZ d deeedeee dfdeeedeed df d Z d efd Z d ee fd Z dS) TargetPythonzx Encapsulates the properties of a Python interpreter one is targeting for a package install, download, etc. )_given_py_version_infoabisimplementation platforms py_versionpy_version_info _valid_tagsNrr.r rreturnc||_|tjdd}nt|}dt t |dd}||_||_||_ ||_ ||_ d|_ dS)a< :param platforms: A list of strings or None. If None, searches for packages that are supported by the current system. Otherwise, will find packages that can be built on the platforms passed in. These packages will only be downloaded for distribution: they will not be built locally. :param py_version_info: An optional tuple of ints representing the Python version information to use (e.g. `sys.version_info[:3]`). This can have length 1, 2, or 3 when provided. :param abis: A list of strings or None. This is passed to compatibility_tags.py's get_supported() function as is. :param implementation: A string or None. This is passed to compatibility_tags.py's get_supported() function as is. N.) r sys version_infor joinmapstrr rrrrr)selfrrr rrs /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/models/target_python.py__init__zTargetPython.__init__s,'6#  "!.rr2OO4_EEOXXc#rr':;;<<  ,"$.15cd}|j$dd|jD}d|jfd|fd|jfd|jfg}dd |DS) zD Format the given, non-None attributes for display. Nrc34K|]}t|VdS)N)r).0parts r z,TargetPython.format_given..Is9''"D ''''''r rrr r c3.K|]\}}||d|VdS)N=)r#keyvalues rr%z,TargetPython.format_given..SsB  #-3u?Ps  U  ?P?P?P?P  r )r rrr r)rdisplay_version key_valuess r format_givenzTargetPython.format_givenCs  & 2!hh''&*&A'''O $. ) _ - TY  t2 3  xx  1;      r c|jD|j}|d}nt|}t||j|j|j}||_|jS)z Return the supported PEP 425 tags to check wheel candidates against. The tags are returned in order of preference (most preferred first). N)versionrr impl)rr rrrr r)rrr0tagss rget_tagszTargetPython.get_tagsWsk   ##9O&/@@ .Y( D $D r )NNNN)__name__ __module__ __qualname____doc__ __slots__rrrrintrr.rr3r)r rr r s I*.59$((, &5&5DI&&5"%S/2&5tCy! &5 ! &5  &5&5&5&5P c    ( $s)      r r ) rtypingrrrpip._vendor.packaging.tagsr&pip._internal.utils.compatibility_tagsrrpip._internal.utils.miscr r r)r rr>s ((((((((((******WWWWWWWW;;;;;;d d d d d d d d d d r