From 316f3070343914df9e6e0af6ee5c1583ff623aac Mon Sep 17 00:00:00 2001 From: "p40000043244@byd.com" Date: Mon, 3 Aug 2026 16:10:06 +0800 Subject: [PATCH] =?UTF-8?q?ci:=203.8/3.9=20=E4=BB=85=E6=8F=90=E4=BE=9B?= =?UTF-8?q?=E7=BA=AF=20Python=20wheel,=20CI=20=E7=9F=A9=E9=98=B5=E5=9B=9E?= =?UTF-8?q?=E9=80=80=203.10-3.14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Windows runner 未安装 Python 3.8/3.9 (run 258 失败于 Python 3.8 is required)。 requires-python 维持 >=3.8: 3.8/3.9 用户安装 py3-none-any wheel, 功能一致; pyd wheel 覆盖 runner 预装的 3.10-3.14。 --- .gitea/workflows/publish-dlp-io.yaml | 14 +++++++------- README.md | 6 +++--- docs/DLP_IO_LIBRARY.md | 6 +++--- tests/test_dlp_io_packaging.py | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.gitea/workflows/publish-dlp-io.yaml b/.gitea/workflows/publish-dlp-io.yaml index af9ec2b..43c200c 100644 --- a/.gitea/workflows/publish-dlp-io.yaml +++ b/.gitea/workflows/publish-dlp-io.yaml @@ -95,11 +95,11 @@ jobs: "DLP_IO_PACKAGE_VERSION=$packageVersion" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append Write-Host "package source: $tag @ $headCommit" - - name: Test Python 3.8-3.14 + - name: Test Python 3.10-3.14 shell: pwsh run: | $ErrorActionPreference = "Stop" - foreach ($pythonVersion in @("3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14")) { + foreach ($pythonVersion in @("3.10", "3.11", "3.12", "3.13", "3.14")) { & py "-$pythonVersion" --version if ($LASTEXITCODE -ne 0) { throw "Python $pythonVersion is required" } & py "-$pythonVersion" -m pip install -r requirements-dev.txt --progress-bar off @@ -124,7 +124,7 @@ jobs: "dlp_io-$version-py3-none-any.whl", "dlp_io-$version.tar.gz" ) - foreach ($pythonVersion in @("3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14")) { + foreach ($pythonVersion in @("3.10", "3.11", "3.12", "3.13", "3.14")) { $abi = $pythonVersion.Replace(".", "") $wheel = "dlp_io-$version-cp$abi-cp$abi-win_amd64.whl" $env:DLP_IO_PYD = "1" @@ -164,7 +164,7 @@ jobs: } } $bareAssets = @(Get-ChildItem -LiteralPath $assetsDir -File | ForEach-Object Name) - if ($bareAssets.Count -ne 8) { + if ($bareAssets.Count -ne 6) { throw "bare asset set mismatch: $($bareAssets -join ', ')" } @@ -198,7 +198,7 @@ jobs: } } - foreach ($pythonVersion in @("3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14")) { + foreach ($pythonVersion in @("3.10", "3.11", "3.12", "3.13", "3.14")) { $abi = $pythonVersion.Replace(".", "") $pydWheel = (Resolve-Path (Join-Path dist "dlp_io-$($env:DLP_IO_PACKAGE_VERSION)-cp$abi-cp$abi-win_amd64.whl")).Path $pydRoot = Join-Path $env:TEMP ("dlp-io-pyd-smoke-$abi-" + $PID) @@ -232,7 +232,7 @@ jobs: throw "unsafe bare smoke path: $bareRootFull" } try { - foreach ($pythonVersion in @("3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14")) { + foreach ($pythonVersion in @("3.10", "3.11", "3.12", "3.13", "3.14")) { $abi = $pythonVersion.Replace(".", "") $sandbox = Join-Path $bareRootFull "cp$abi" New-Item -ItemType Directory -Force $sandbox | Out-Null @@ -293,7 +293,7 @@ jobs: "## 产物", "", "- ``dlp_io-$version-py3-none-any.whl``:纯 Python wheel,pip 安装,跨平台", - "- ``dlp_io-$version-cp3XX-cp3XX-win_amd64.whl``:pyd wheel,pip 安装,Windows 按解释器版本选用(cp38-cp314)", + "- ``dlp_io-$version-cp3XX-cp3XX-win_amd64.whl``:pyd wheel,pip 安装,Windows 按解释器版本选用(cp310-cp314);3.8/3.9 请用纯 Python wheel", "- ``dlp_io-$version.tar.gz``:sdist 源码包", "- ``dlp_io.py`` / ``dlp_io.cp3XX-win_amd64.pyd``:免安装单文件,直接放进项目目录即可 ``import dlp_io``", "", diff --git a/README.md b/README.md index 4a36c8f..c5093c1 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ io-compatible file reads through an approved Python helper on Windows DLP hosts. py -m pip install --index-url https://gitea.docker.antior.cn/api/packages/antior/pypi/simple dlp-io ``` -pip 会自动选择最匹配的 wheel:Windows 上 CPython 3.8–3.14 安装对应的 pyd wheel(整个库由 Cython 编译为单个 `.pyd`),其余环境安装纯 Python wheel。如需固定版本: +pip 会自动选择最匹配的 wheel:Windows 上 CPython 3.10–3.14 安装对应的 pyd wheel(整个库由 Cython 编译为单个 `.pyd`),3.8/3.9 及其余环境安装纯 Python wheel(库要求 Python >= 3.8)。如需固定版本: ```powershell py -m pip install --index-url https://gitea.docker.antior.cn/api/packages/antior/pypi/simple dlp-io==0.1.1 @@ -52,10 +52,10 @@ pytest ## 构建发布 -发布流程由 `.gitea/workflows/publish-dlp-io.yaml` 驱动:推送 `dlp-io-vX.Y.Z` 格式的 annotated tag,Windows runner(Python 3.8–3.14)会自动完成测试、构建,并把产物上传到 Gitea Release: +发布流程由 `.gitea/workflows/publish-dlp-io.yaml` 驱动:推送 `dlp-io-vX.Y.Z` 格式的 annotated tag,Windows runner(Python 3.10–3.14)会自动完成测试、构建,并把产物上传到 Gitea Release: - `dlp_io-X.Y.Z-py3-none-any.whl`(纯 Python,跨平台) -- `dlp_io-X.Y.Z-cp38` … `cp314-win_amd64.whl`(7 个 pyd wheel,Cython 编译,Windows 按解释器版本选用) +- `dlp_io-X.Y.Z-cp310` … `cp314-win_amd64.whl`(5 个 pyd wheel,Cython 编译,Windows 按解释器版本选用;3.8/3.9 使用纯 Python wheel) - `dlp_io-X.Y.Z.tar.gz`(sdist) - `dlp_io.py` 和 5 个裸 `dlp_io.cp3XX-win_amd64.pyd`(免安装单文件,放进项目目录即可 import) diff --git a/docs/DLP_IO_LIBRARY.md b/docs/DLP_IO_LIBRARY.md index 9b50cb0..2cec2b7 100644 --- a/docs/DLP_IO_LIBRARY.md +++ b/docs/DLP_IO_LIBRARY.md @@ -10,7 +10,7 @@ DLP 环境的实测特征(白名单矩阵、密文样本字节对比、各写 ### 方式一:Gitea PyPI registry(推荐) -registry 已开放匿名下载,一条命令即可安装;pip 会自动选择最匹配的 wheel:Windows 上 CPython 3.8–3.14 会得到对应的 pyd wheel(整个库编译为单个 `.pyd`),其余环境得到纯 Python wheel。 +registry 已开放匿名下载,一条命令即可安装;pip 会自动选择最匹配的 wheel:Windows 上 CPython 3.10–3.14 会得到对应的 pyd wheel(整个库编译为单个 `.pyd`),3.8/3.9 及其余环境得到纯 Python wheel(库要求 Python >= 3.8,pyd 版仅覆盖 CI 预装的解释器版本)。 ```powershell py -m pip install --index-url https://gitea.docker.antior.cn/api/packages/antior/pypi/simple dlp-io==0.3.0 @@ -27,9 +27,9 @@ Release 页面: 每个版本包含以下文件: - `dlp_io-X.Y.Z-py3-none-any.whl`:纯 Python wheel,适用于任何 CPython >= 3.8 环境。 -- `dlp_io-X.Y.Z-cp38-cp38-win_amd64.whl` 至 `cp314`:pyd wheel,Windows 专用,按解释器版本区分;整个库由 Cython 编译为单个二进制 `.pyd`,功能与纯 Python 版完全一致,可按对源码保护的要求选用。 +- `dlp_io-X.Y.Z-cp310-cp310-win_amd64.whl` 至 `cp314`:pyd wheel,Windows 专用,按解释器版本区分;整个库由 Cython 编译为单个二进制 `.pyd`,功能与纯 Python 版完全一致,可按对源码保护的要求选用。3.8/3.9 无 pyd wheel,使用纯 Python wheel。 - `dlp_io-X.Y.Z.tar.gz`:sdist 源码包。 -- `dlp_io.py` 与 `dlp_io.cp38-win_amd64.pyd` 至 `cp314`:免安装单文件,与 wheel 内容一致;直接放进项目目录(或加入 `PYTHONPATH`)即可 `import dlp_io`,适合不便使用 pip 的环境。 +- `dlp_io.py` 与 `dlp_io.cp310-win_amd64.pyd` 至 `cp314`:免安装单文件,与 wheel 内容一致;直接放进项目目录(或加入 `PYTHONPATH`)即可 `import dlp_io`,适合不便使用 pip 的环境。 按解释器版本选择对应资产,可直接用 pip 安装 URL。Windows PowerShell: diff --git a/tests/test_dlp_io_packaging.py b/tests/test_dlp_io_packaging.py index 5ed9c49..2504dcb 100644 --- a/tests/test_dlp_io_packaging.py +++ b/tests/test_dlp_io_packaging.py @@ -42,7 +42,7 @@ class PackageClassifier(Enum): class WorkflowStep(Enum): CLONE_TAG = "Clone immutable package tag" - TEST_MATRIX = "Test Python 3.8-3.14" + TEST_MATRIX = "Test Python 3.10-3.14" BUILD = "Build and check distribution" SMOKE = "Smoke test release artifacts" RELEASE = "Create Gitea release with wheels"