Skip to content

feat: 审计 python sdk 版本升级 --story=136347644 - #41

Merged
0RAJA merged 1 commit into
TencentBlueKing:mainfrom
HermitWJ:feat/py314-otel143-compat
Aug 10, 2026
Merged

feat: 审计 python sdk 版本升级 --story=136347644#41
0RAJA merged 1 commit into
TencentBlueKing:mainfrom
HermitWJ:feat/py314-otel143-compat

Conversation

@HermitWJ

@HermitWJ HermitWJ commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

概述

升级审计 Python SDK 以兼容 Python 3.12~3.14 及 OpenTelemetry 1.43,同步优化 CI 流程与测试覆盖。


变更内容

11 files, +318/-96

模块 文件 变更说明
依赖 requirements.txt / requirements_dev.txt / setup.py OTel >=1.43.0,<1.44.0python_requires>=3.10unittest-xml-reporting>=3.2 替换 xmlrunner==1.7.7
兼容 processor.py / setup.py LazyBatchLogProcessor 退化空壳(OTel>=1.34 已内建 fork 安全);open() 显式 encoding="utf-8" 兼容 Windows GBK
OTel setup.py 适配 OTel 1.43 API 变更
CI .github/workflows/unittest_py3.yml 功能分支 push 触发单测
测试 test_ot.py / test_django.py +258 行测试(含 SDK 自身上报验收)
文档 release.md / docs/usage.md / VERSION 更新版本号、用法说明、发布日志

关键兼容性说明

  • Py3.14pipes 模块移除,bk_resource<=0.4.14pipes-compat shim
  • Py3.12xmlrunner==1.7.7 引用已删除的 unittest._TextTestResult → 换 unittest-xml-reporting
  • OTel 1.43:移除 JaegerExporterBatchSpanProcessor 私有成员重构,SDK 层无需感知
  • blueapps 不兼容blueapps 4.x 全系列顶层 import JaegerExporter,建议 backend 摘除 instrument_app 自装配

涉及仓库

仓库 分支 Commit
bk-audit-python-sdk feat/py314-otel143-compat a36e6ec

完整方案见 bk-audit SDK Python 3.14 + OpenTelemetry 1.43 兼容改造 — 详细开发方案

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@d32ae3d). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff            @@
##             main       #41   +/-   ##
========================================
  Coverage        ?   100.00%           
========================================
  Files           ?        21           
  Lines           ?       566           
  Branches        ?         0           
========================================
  Hits            ?       566           
  Misses          ?         0           
  Partials        ?         0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@HermitWJ
HermitWJ force-pushed the feat/py314-otel143-compat branch from a36e6ec to 83036bb Compare August 10, 2026 06:39
@0RAJA
0RAJA merged commit f92807d into TencentBlueKing:main Aug 10, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants