mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-06 22:14:12 +00:00
nem sei pq tantos arquivos
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
"""Represents a wheel file and provides access to the various parts of the
|
||||
name that have meaning.
|
||||
"""
|
||||
|
||||
import re
|
||||
from typing import Dict, Iterable, List
|
||||
|
||||
from pip._vendor.packaging.tags import Tag
|
||||
from pip._vendor.packaging.utils import (
|
||||
InvalidWheelFilename as PackagingInvalidWheelName,
|
||||
)
|
||||
from pip._vendor.packaging.utils import parse_wheel_filename
|
||||
|
||||
from pip._internal.exceptions import InvalidWheelFilename
|
||||
from pip._internal.utils.deprecation import deprecated
|
||||
|
||||
|
||||
class Wheel:
|
||||
@@ -28,9 +34,29 @@ class Wheel:
|
||||
raise InvalidWheelFilename(f"{filename} is not a valid wheel filename.")
|
||||
self.filename = filename
|
||||
self.name = wheel_info.group("name").replace("_", "-")
|
||||
# we'll assume "_" means "-" due to wheel naming scheme
|
||||
# (https://github.com/pypa/pip/issues/1150)
|
||||
self.version = wheel_info.group("ver").replace("_", "-")
|
||||
_version = wheel_info.group("ver")
|
||||
if "_" in _version:
|
||||
try:
|
||||
parse_wheel_filename(filename)
|
||||
except PackagingInvalidWheelName as e:
|
||||
deprecated(
|
||||
reason=(
|
||||
f"Wheel filename {filename!r} is not correctly normalised. "
|
||||
"Future versions of pip will raise the following error:\n"
|
||||
f"{e.args[0]}\n\n"
|
||||
),
|
||||
replacement=(
|
||||
"to rename the wheel to use a correctly normalised "
|
||||
"name (this may require updating the version in "
|
||||
"the project metadata)"
|
||||
),
|
||||
gone_in="25.1",
|
||||
issue=12938,
|
||||
)
|
||||
|
||||
_version = _version.replace("_", "-")
|
||||
|
||||
self.version = _version
|
||||
self.build_tag = wheel_info.group("build")
|
||||
self.pyversions = wheel_info.group("pyver").split(".")
|
||||
self.abis = wheel_info.group("abi").split(".")
|
||||
|
||||
Reference in New Issue
Block a user