mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-09-24 13:07:00 +03:00
Restore pyroma test for iOS.
This commit is contained in:
parent
8ec31431cb
commit
076758e202
|
@ -1 +1 @@
|
||||||
cibuildwheel==3.0.1
|
cibuildwheel==3.1.2
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from importlib.metadata import metadata
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from PIL import __version__
|
from PIL import __version__
|
||||||
|
@ -7,9 +9,29 @@ from PIL import __version__
|
||||||
pyroma = pytest.importorskip("pyroma", reason="Pyroma not installed")
|
pyroma = pytest.importorskip("pyroma", reason="Pyroma not installed")
|
||||||
|
|
||||||
|
|
||||||
|
def map_metadata_keys(metadata):
|
||||||
|
"Convert installed wheel metadata into canonical Core Metadata 2.4 format."
|
||||||
|
# This was a utility method in pyroma 4.3.3; it was removed in 5.0
|
||||||
|
# This implementation is constructed from the relevant logic from
|
||||||
|
# PyRoma 5.0's `build_metadata()` implementation.
|
||||||
|
|
||||||
|
data = {}
|
||||||
|
for key in set(metadata.keys()):
|
||||||
|
value = metadata.get_all(key)
|
||||||
|
key = pyroma.projectdata.normalize(key)
|
||||||
|
|
||||||
|
if len(value) == 1:
|
||||||
|
value = value[0]
|
||||||
|
if value.strip() == "UNKNOWN":
|
||||||
|
continue
|
||||||
|
|
||||||
|
data[key] = value
|
||||||
|
return data
|
||||||
|
|
||||||
|
|
||||||
def test_pyroma() -> None:
|
def test_pyroma() -> None:
|
||||||
# Arrange
|
# Arrange
|
||||||
data = pyroma.projectdata.get_data(".")
|
data = map_metadata_keys(metadata("Pillow"))
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
rating = pyroma.ratings.rate(data)
|
rating = pyroma.ratings.rate(data)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user