dev-python/wheel: Sync with Gentoo

It's from Gentoo commit ef637b7554d4a840103e588f3625ad5efb030c44.
This commit is contained in:
Flatcar Buildbot 2025-06-16 07:09:14 +00:00 committed by Krzesimir Nowak
parent 3e6e0e1f7e
commit 4641295eb2
2 changed files with 142 additions and 6 deletions

View File

@ -0,0 +1,125 @@
From 36877e99122e8df90d4aa41d414999857d6d852d Mon Sep 17 00:00:00 2001
From: shenxianpeng <xianpeng.shen@gmail.com>
Date: Sun, 16 Mar 2025 01:35:32 +0800
Subject: [PATCH] Fixed test failures (#651)
---
tests/test_bdist_wheel.py | 4 ++--
tests/test_tagopt.py | 18 +++++++++---------
tests/testdata/unicode.dist/setup.py | 2 +-
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/tests/test_bdist_wheel.py b/tests/test_bdist_wheel.py
index fcb2dfc..21eddd0 100644
--- a/tests/test_bdist_wheel.py
+++ b/tests/test_bdist_wheel.py
@@ -79,9 +79,9 @@ def test_no_scripts(wheel_paths):
def test_unicode_record(wheel_paths):
- path = next(path for path in wheel_paths if "unicode.dist" in path)
+ path = next(path for path in wheel_paths if "unicode_dist" in path)
with ZipFile(path) as zf:
- record = zf.read("unicode.dist-0.1.dist-info/RECORD")
+ record = zf.read("unicode_dist-0.1.dist-info/RECORD")
assert "åäö_日本語.py".encode() in record
diff --git a/tests/test_tagopt.py b/tests/test_tagopt.py
index 5335af4..5733e1a 100644
--- a/tests/test_tagopt.py
+++ b/tests/test_tagopt.py
@@ -14,7 +14,7 @@ SETUP_PY = """\
from setuptools import setup, Extension
setup(
- name="Test",
+ name="test",
version="1.0",
author_email="author@example.com",
py_modules=["test"],
@@ -63,7 +63,7 @@ def test_default_tag(temp_pkg):
assert dist_dir.is_dir()
wheels = list(dist_dir.iterdir())
assert len(wheels) == 1
- assert wheels[0].name == f"Test-1.0-py{sys.version_info[0]}-none-any.whl"
+ assert wheels[0].name == f"test-1.0-py{sys.version_info[0]}-none-any.whl"
assert wheels[0].suffix == ".whl"
@@ -76,7 +76,7 @@ def test_build_number(temp_pkg):
assert dist_dir.is_dir()
wheels = list(dist_dir.iterdir())
assert len(wheels) == 1
- assert wheels[0].name == f"Test-1.0-1-py{sys.version_info[0]}-none-any.whl"
+ assert wheels[0].name == f"test-1.0-1-py{sys.version_info[0]}-none-any.whl"
assert wheels[0].suffix == ".whl"
@@ -89,7 +89,7 @@ def test_explicit_tag(temp_pkg):
assert dist_dir.is_dir()
wheels = list(dist_dir.iterdir())
assert len(wheels) == 1
- assert wheels[0].name.startswith("Test-1.0-py32-")
+ assert wheels[0].name.startswith("test-1.0-py32-")
assert wheels[0].suffix == ".whl"
@@ -101,7 +101,7 @@ def test_universal_tag(temp_pkg):
assert dist_dir.is_dir()
wheels = list(dist_dir.iterdir())
assert len(wheels) == 1
- assert wheels[0].name.startswith("Test-1.0-py2.py3-")
+ assert wheels[0].name.startswith("test-1.0-py2.py3-")
assert wheels[0].suffix == ".whl"
@@ -114,7 +114,7 @@ def test_universal_beats_explicit_tag(temp_pkg):
assert dist_dir.is_dir()
wheels = list(dist_dir.iterdir())
assert len(wheels) == 1
- assert wheels[0].name.startswith("Test-1.0-py2.py3-")
+ assert wheels[0].name.startswith("test-1.0-py2.py3-")
assert wheels[0].suffix == ".whl"
@@ -129,7 +129,7 @@ def test_universal_in_setup_cfg(temp_pkg):
assert dist_dir.is_dir()
wheels = list(dist_dir.iterdir())
assert len(wheels) == 1
- assert wheels[0].name.startswith("Test-1.0-py2.py3-")
+ assert wheels[0].name.startswith("test-1.0-py2.py3-")
assert wheels[0].suffix == ".whl"
@@ -144,7 +144,7 @@ def test_pythontag_in_setup_cfg(temp_pkg):
assert dist_dir.is_dir()
wheels = list(dist_dir.iterdir())
assert len(wheels) == 1
- assert wheels[0].name.startswith("Test-1.0-py32-")
+ assert wheels[0].name.startswith("test-1.0-py32-")
assert wheels[0].suffix == ".whl"
@@ -157,7 +157,7 @@ def test_legacy_wheel_section_in_setup_cfg(temp_pkg):
assert dist_dir.is_dir()
wheels = list(dist_dir.iterdir())
assert len(wheels) == 1
- assert wheels[0].name.startswith("Test-1.0-py2.py3-")
+ assert wheels[0].name.startswith("test-1.0-py2.py3-")
assert wheels[0].suffix == ".whl"
diff --git a/tests/testdata/unicode.dist/setup.py b/tests/testdata/unicode.dist/setup.py
index ec66d1e..46ef0a1 100644
--- a/tests/testdata/unicode.dist/setup.py
+++ b/tests/testdata/unicode.dist/setup.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from setuptools import setup
setup(
- name="unicode.dist",
+ name="unicode_dist",
version="0.1",
description="A testing distribution \N{SNOWMAN}",
packages=["unicodedist"],

View File

@ -5,7 +5,7 @@
EAPI=8
DISTUTILS_USE_PEP517=flit
PYTHON_COMPAT=( python3_{10..13} python3_13t pypy3 pypy3_11 )
PYTHON_COMPAT=( python3_{11..14} python3_{13,14}t pypy3_11 )
inherit distutils-r1 pypi
@ -28,14 +28,14 @@ BDEPEND="
)
"
EPYTEST_DESELECT=(
# fails if any setuptools plugin imported the module first
tests/test_bdist_wheel.py::test_deprecated_import
)
distutils_enable_tests pytest
src_prepare() {
local PATCHES=(
# https://github.com/pypa/wheel/pull/651
"${FILESDIR}/${P}-test.patch"
)
distutils-r1_src_prepare
# unbundle packaging
@ -46,6 +46,17 @@ src_prepare() {
}
python_test() {
local EPYTEST_DESELECT=(
# fails if any setuptools plugin imported the module first
tests/test_bdist_wheel.py::test_deprecated_import
# broken by setuptools license changes
# upstream removed the tests already
tests/test_bdist_wheel.py::test_licenses_default
tests/test_bdist_wheel.py::test_licenses_deprecated
tests/test_bdist_wheel.py::test_licenses_override
)
local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
epytest
}