zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
U
H=®dÛ ã@sºddlmZddlZddlmZddlmZddlmZm    Z    ddl
m Z ddl m Z ddlmZerŒdd    lmZmZdd
lmZdd lmZe e¡Zd d „Zdd„Zdd„Zdd„ZdS)é)Úabsolute_importN)Ú
FeedParser)Ú pkg_resources)Ú
specifiersÚversion)ÚNoneMetadataError)Ú display_path)ÚMYPY_CHECK_RUNNING)ÚOptionalÚTuple)ÚMessage)Ú DistributioncCs4|dkr dSt |¡}t d tt|ƒ¡¡}||kS)a˜
    Check if the given Python version matches a "Requires-Python" specifier.
 
    :param version_info: A 3-tuple of ints representing a Python
        major-minor-micro version to check (e.g. `sys.version_info[:3]`).
 
    :return: `True` if the given Python version satisfies the requirement.
        Otherwise, return `False`.
 
    :raises InvalidSpecifier: If `requires_python` has an invalid format.
    NTÚ.)rÚ SpecifierSetrÚparseÚjoinÚmapÚstr)Úrequires_pythonÚ version_infoÚrequires_python_specifierÚpython_version©rúTD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\pip/_internal/utils/packaging.pyÚcheck_requires_pythons
 
rcCs€d}t|tjƒr&| |¡r&| |¡}n0| d¡r@d}| |¡}nt dt|jƒ¡d}|dkrht    ||ƒ‚t
ƒ}|  |¡|  ¡S)z
    :raises NoneMetadataError: if the distribution reports `has_metadata()`
        True but `get_metadata()` returns None.
    ÚMETADATAzPKG-INFOzNo metadata found in %sÚN) Ú
isinstancerÚDistInfoDistributionÚ has_metadataÚ get_metadataÚloggerÚwarningrÚlocationrrÚfeedÚclose)ÚdistÚ metadata_nameÚmetadataÚ feed_parserrrrr ,s ÿ 
 
 
r cCs&t|ƒ}| d¡}|dk    r"t|ƒ}|S)z_
    Return the "Requires-Python" metadata for a distribution, or None
    if not present.
    zRequires-PythonN)r Úgetr)r&Ú pkg_info_dictrrrrÚget_requires_pythonGs
 
r,cCs2| d¡r.| d¡D]}| ¡r| ¡SqdS)NÚ    INSTALLERr)rÚget_metadata_linesÚstrip)r&ÚlinerrrÚ get_installerXs
 
r1)Ú
__future__rÚloggingÚ email.parserrÚ pip._vendorrZpip._vendor.packagingrrÚpip._internal.exceptionsrÚpip._internal.utils.miscrÚpip._internal.utils.typingr    Útypingr
r Ú email.messager Zpip._vendor.pkg_resourcesr Ú    getLoggerÚ__name__r!rr r,r1rrrrÚ<module>s