bb15b750fb
复用现有 Docker 和 Nuitka 流程,隔离架构镜像并支持 aarch64 标签。已通过 47 项测试、代码及文档门禁,并完成 Python 3.10 ARM64 wheel 构建、隔离导入与内容审计。
62 lines
1.8 KiB
Python
62 lines
1.8 KiB
Python
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
REPO_ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
@pytest.fixture
|
|
def wheel_package():
|
|
import sys
|
|
|
|
build_dir = REPO_ROOT / "build"
|
|
if str(build_dir) not in sys.path:
|
|
sys.path.insert(0, str(build_dir))
|
|
from wheel import package as wheel_package
|
|
|
|
return wheel_package
|
|
|
|
|
|
def test_compliant_manylinux_tags(wheel_package):
|
|
assert wheel_package.is_compliant_manylinux_wheel(
|
|
Path("orisys-1.2.3-cp310-cp310-manylinux_2_17_x86_64.whl")
|
|
)
|
|
assert wheel_package.is_compliant_manylinux_wheel(
|
|
Path("orisys-1.2.3-cp310-cp310-manylinux2014_x86_64.whl")
|
|
)
|
|
assert wheel_package.is_compliant_manylinux_wheel(
|
|
Path("orisys-1.2.3-cp310-cp310-manylinux_2_28_x86_64.whl")
|
|
)
|
|
|
|
|
|
@pytest.mark.parametrize("tag", ["manylinux2014_aarch64", "manylinux_2_28_aarch64"])
|
|
def test_compliant_arm_manylinux_tags(wheel_package, tag):
|
|
assert wheel_package.is_compliant_manylinux_wheel(
|
|
Path(f"orisys-1.2.3-cp310-cp310-{tag}.whl")
|
|
)
|
|
|
|
|
|
def test_rejects_illegal_manylinux_tags(wheel_package):
|
|
assert not wheel_package.is_compliant_manylinux_wheel(
|
|
Path("orisys-1.2.3-cp310-cp310-manylinux_x86_64.whl")
|
|
)
|
|
assert not wheel_package.is_compliant_manylinux_wheel(
|
|
Path("orisys-1.2.3-cp310-cp310-linux_x86_64.whl")
|
|
)
|
|
assert not wheel_package.is_compliant_manylinux_wheel(
|
|
Path("orisys-1.2.3-cp310-cp310-win_amd64.whl")
|
|
)
|
|
|
|
|
|
def test_pyproject_no_private_classifier():
|
|
import sys
|
|
|
|
build_dir = REPO_ROOT / "build"
|
|
if str(build_dir) not in sys.path:
|
|
sys.path.insert(0, str(build_dir))
|
|
from common.pyproject_utils import project_metadata
|
|
|
|
classifiers = project_metadata(REPO_ROOT).get("classifiers", [])
|
|
assert "Private :: Do Not Upload" not in classifiers
|
|
assert "License :: Other/Proprietary License" in classifiers
|