feat: 支持 Python 3.8+ (0.3.0)
publish-dlp-io / publish (push) Failing after 2s

- requires-python >=3.8, classifiers 增加 3.8/3.9
- 代码经 ast feature_version=(3,8) 校验, 无 3.9+ 专属语法; str|None 等注解由 future annotations 延迟求值
- CI 测试/构建/smoke 矩阵扩展为 3.8-3.14, 裸资产数 6→8
- 注意: Windows runner 需预装 Python 3.8 与 3.9 (py launcher)
This commit is contained in:
p40000043244@byd.com
2026-08-03 15:30:33 +08:00
parent 457e4eed3f
commit d34861be93
6 changed files with 22 additions and 20 deletions
+7 -7
View File
@@ -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.10-3.14
- name: Test Python 3.8-3.14
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
foreach ($pythonVersion in @("3.10", "3.11", "3.12", "3.13", "3.14")) {
foreach ($pythonVersion in @("3.8", "3.9", "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.10", "3.11", "3.12", "3.13", "3.14")) {
foreach ($pythonVersion in @("3.8", "3.9", "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 6) {
if ($bareAssets.Count -ne 8) {
throw "bare asset set mismatch: $($bareAssets -join ', ')"
}
@@ -198,7 +198,7 @@ jobs:
}
}
foreach ($pythonVersion in @("3.10", "3.11", "3.12", "3.13", "3.14")) {
foreach ($pythonVersion in @("3.8", "3.9", "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.10", "3.11", "3.12", "3.13", "3.14")) {
foreach ($pythonVersion in @("3.8", "3.9", "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 wheelpip 安装,跨平台",
"- ``dlp_io-$version-cp3XX-cp3XX-win_amd64.whl``pyd wheelpip 安装,Windows 按解释器版本选用(cp310-cp314",
"- ``dlp_io-$version-cp3XX-cp3XX-win_amd64.whl``pyd wheelpip 安装,Windows 按解释器版本选用(cp38-cp314",
"- ``dlp_io-$version.tar.gz``sdist 源码包",
"- ``dlp_io.py`` / ``dlp_io.cp3XX-win_amd64.pyd``:免安装单文件,直接放进项目目录即可 ``import dlp_io``",
"",
+3 -3
View File
@@ -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 会自动选择最匹配的 wheelWindows 上 CPython 3.103.14 安装对应的 pyd wheel(整个库由 Cython 编译为单个 `.pyd`),其余环境安装纯 Python wheel。如需固定版本:
pip 会自动选择最匹配的 wheelWindows 上 CPython 3.83.14 安装对应的 pyd wheel(整个库由 Cython 编译为单个 `.pyd`),其余环境安装纯 Python wheel。如需固定版本:
```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 tagWindows runnerPython 3.10–3.14)会自动完成测试、构建,并把产物上传到 Gitea Release
发布流程由 `.gitea/workflows/publish-dlp-io.yaml` 驱动:推送 `dlp-io-vX.Y.Z` 格式的 annotated tagWindows runnerPython 3.8–3.14)会自动完成测试、构建,并把产物上传到 Gitea Release
- `dlp_io-X.Y.Z-py3-none-any.whl`(纯 Python,跨平台)
- `dlp_io-X.Y.Z-cp310``cp314-win_amd64.whl`5 个 pyd wheelCython 编译,Windows 按解释器版本选用)
- `dlp_io-X.Y.Z-cp38``cp314-win_amd64.whl`7 个 pyd wheelCython 编译,Windows 按解释器版本选用)
- `dlp_io-X.Y.Z.tar.gz`sdist
- `dlp_io.py` 和 5 个裸 `dlp_io.cp3XX-win_amd64.pyd`(免安装单文件,放进项目目录即可 import)
+1 -1
View File
@@ -21,7 +21,7 @@ from enum import Enum
from multiprocessing.context import AuthenticationError
from multiprocessing.connection import Client
__version__ = "0.2.0"
__version__ = "0.3.0"
__all__ = [
"DlpConfig",
+6 -6
View File
@@ -2,7 +2,7 @@
`dlp-io` 为 Windows DLP 透明加密环境提供接近 `io.open` 的 Python 文件 API。非白名单进程负责业务逻辑;文件读取由已获 DLP 白名单授权的 Python helper 完成,再通过经过认证的 Windows Named Pipe 返回明文字节;文件写入通过通道探测保证落盘为未加密格式。另提供 `is_encrypted()`,在读取前判断文件是否处于 DLP 加密状态。
当前版本为 `dlp-io==0.2.0`distribution 名是 `dlp-io`import 名是 `dlp_io`
当前版本为 `dlp-io==0.3.0`distribution 名是 `dlp-io`import 名是 `dlp_io`
DLP 环境的实测特征(白名单矩阵、密文样本字节对比、各写入候选通道的可用性实验)与判定/写入逻辑的完整推导记录见 [DLP_ENVIRONMENT_NOTES.md](DLP_ENVIRONMENT_NOTES.md)。
@@ -10,10 +10,10 @@ DLP 环境的实测特征(白名单矩阵、密文样本字节对比、各写
### 方式一:Gitea PyPI registry(推荐)
registry 已开放匿名下载,一条命令即可安装;pip 会自动选择最匹配的 wheelWindows 上 CPython 3.103.14 会得到对应的 pyd wheel(整个库编译为单个 `.pyd`),其余环境得到纯 Python wheel。
registry 已开放匿名下载,一条命令即可安装;pip 会自动选择最匹配的 wheelWindows 上 CPython 3.83.14 会得到对应的 pyd wheel(整个库编译为单个 `.pyd`),其余环境得到纯 Python wheel。
```powershell
py -m pip install --index-url https://gitea.docker.antior.cn/api/packages/antior/pypi/simple dlp-io==0.2.0
py -m pip install --index-url https://gitea.docker.antior.cn/api/packages/antior/pypi/simple dlp-io==0.3.0
```
Package 页面:<https://gitea.docker.antior.cn/antior/-/packages/pypi/dlp-io>
@@ -26,10 +26,10 @@ Release 页面:<https://gitea.docker.antior.cn/antior/dlp-io/releases>
每个版本包含以下文件:
- `dlp_io-X.Y.Z-py3-none-any.whl`:纯 Python wheel,适用于任何 CPython >= 3.10 环境。
- `dlp_io-X.Y.Z-cp310-cp310-win_amd64.whl``cp314`pyd wheelWindows 专用,按解释器版本区分;整个库由 Cython 编译为单个二进制 `.pyd`,功能与纯 Python 版完全一致,可按对源码保护的要求选用。
- `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 wheelWindows 专用,按解释器版本区分;整个库由 Cython 编译为单个二进制 `.pyd`,功能与纯 Python 版完全一致,可按对源码保护的要求选用。
- `dlp_io-X.Y.Z.tar.gz`sdist 源码包。
- `dlp_io.py``dlp_io.cp310-win_amd64.pyd``cp314`:免安装单文件,与 wheel 内容一致;直接放进项目目录(或加入 `PYTHONPATH`)即可 `import dlp_io`,适合不便使用 pip 的环境。
- `dlp_io.py``dlp_io.cp38-win_amd64.pyd``cp314`:免安装单文件,与 wheel 内容一致;直接放进项目目录(或加入 `PYTHONPATH`)即可 `import dlp_io`,适合不便使用 pip 的环境。
按解释器版本选择对应资产,可直接用 pip 安装 URL。Windows PowerShell
+3 -1
View File
@@ -7,11 +7,13 @@ name = "dlp-io"
dynamic = ["version"]
description = "io-compatible file reads through an approved Python helper on Windows DLP hosts"
readme = "docs/DLP_IO_LIBRARY.md"
requires-python = ">=3.10"
requires-python = ">=3.8"
classifiers = [
"Development Status :: 3 - Alpha",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
+2 -2
View File
@@ -42,7 +42,7 @@ class PackageClassifier(Enum):
class WorkflowStep(Enum):
CLONE_TAG = "Clone immutable package tag"
TEST_MATRIX = "Test Python 3.10-3.14"
TEST_MATRIX = "Test Python 3.8-3.14"
BUILD = "Build and check distribution"
SMOKE = "Smoke test release artifacts"
RELEASE = "Create Gitea release with wheels"
@@ -108,7 +108,7 @@ def test_pyproject_declares_structured_public_package_contract() -> None:
project = config["project"]
assert PackageName(canonicalize_name(project["name"])) is PackageName.DLP_IO
assert SpecifierSet(project["requires-python"]) == SpecifierSet(">=3.10")
assert SpecifierSet(project["requires-python"]) == SpecifierSet(">=3.8")
assert {DynamicField(item) for item in project["dynamic"]} == {
DynamicField.VERSION
}