Voice et bot modif
This commit is contained in:
parent
189d56026b
commit
7333a22bcd
10774 changed files with 634644 additions and 933308 deletions
|
|
@ -1,8 +1,10 @@
|
|||
"""Support functions for working with wheel files."""
|
||||
"""Support functions for working with wheel files.
|
||||
"""
|
||||
|
||||
import logging
|
||||
from email.message import Message
|
||||
from email.parser import Parser
|
||||
from typing import Tuple
|
||||
from zipfile import BadZipFile, ZipFile
|
||||
|
||||
from pip._vendor.packaging.utils import canonicalize_name
|
||||
|
|
@ -15,7 +17,7 @@ VERSION_COMPATIBLE = (1, 0)
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def parse_wheel(wheel_zip: ZipFile, name: str) -> tuple[str, Message]:
|
||||
def parse_wheel(wheel_zip: ZipFile, name: str) -> Tuple[str, Message]:
|
||||
"""Extract information from the provided wheel, ensuring it meets basic
|
||||
standards.
|
||||
|
||||
|
|
@ -26,7 +28,7 @@ def parse_wheel(wheel_zip: ZipFile, name: str) -> tuple[str, Message]:
|
|||
metadata = wheel_metadata(wheel_zip, info_dir)
|
||||
version = wheel_version(metadata)
|
||||
except UnsupportedWheel as e:
|
||||
raise UnsupportedWheel(f"{name} has an invalid wheel, {e}")
|
||||
raise UnsupportedWheel(f"{name} has an invalid wheel, {str(e)}")
|
||||
|
||||
check_compatibility(version, name)
|
||||
|
||||
|
|
@ -92,7 +94,7 @@ def wheel_metadata(source: ZipFile, dist_info_dir: str) -> Message:
|
|||
return Parser().parsestr(wheel_text)
|
||||
|
||||
|
||||
def wheel_version(wheel_data: Message) -> tuple[int, ...]:
|
||||
def wheel_version(wheel_data: Message) -> Tuple[int, ...]:
|
||||
"""Given WHEEL metadata, return the parsed Wheel-Version.
|
||||
Otherwise, raise UnsupportedWheel.
|
||||
"""
|
||||
|
|
@ -108,7 +110,7 @@ def wheel_version(wheel_data: Message) -> tuple[int, ...]:
|
|||
raise UnsupportedWheel(f"invalid Wheel-Version: {version!r}")
|
||||
|
||||
|
||||
def check_compatibility(version: tuple[int, ...], name: str) -> None:
|
||||
def check_compatibility(version: Tuple[int, ...], name: str) -> None:
|
||||
"""Raises errors or warns if called with an incompatible Wheel-Version.
|
||||
|
||||
pip should refuse to install a Wheel-Version that's a major series
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue