fix(deps): 锁定cryptography版本以修复CI环境GEN_EMAIL兼容性错误 #199

Merged
xiaoxia merged 5 commits from fix/cryptography-version into develop 2026-07-09 16:06:16 +08:00
Owner

问题

CI的Validate阶段,单元测试收集时4个文件报错:AttributeError: module 'lib' has no attribute 'X509_V_FLAG_NOTIFY_POLICY'(同类OpenSSL兼容性错误,含GEN_EMAIL)。

根本原因:CI环境(Ubuntu 22.04)预装了系统级python3-openssl(pyOpenSSL 21.0.0,位于/usr/lib/python3/dist-packages/),与pip安装的新版cryptography不兼容。当oss2 → aliyunsdkcore → import OpenSSL.SSL时,加载的是系统旧版pyOpenSSL,导致属性错误。

受影响的测试:

  • test_asset_review
  • test_cosyvoice_service
  • test_edit_plan_worker_failure
  • test_oss_direct_upload

修复方案

requirements-base.txt 中显式锁定:

  1. cryptography==46.0.5 — 与本地环境保持一致
  2. pyOpenSSL==26.2.0 — 覆盖系统预装的旧版pyOpenSSL,确保与cryptography 46.0.5兼容

两者均安装至/usr/local/lib/python3.10/dist-packages/,优先级高于系统包。

验证结果

  • 单元测试:1107 passed
  • 集成测试:381 passed
  • 之前失败的4个测试文件均能正常收集运行
## 问题 CI的Validate阶段,单元测试收集时4个文件报错:`AttributeError: module 'lib' has no attribute 'X509_V_FLAG_NOTIFY_POLICY'`(同类OpenSSL兼容性错误,含GEN_EMAIL)。 **根本原因**:CI环境(Ubuntu 22.04)预装了系统级`python3-openssl`(pyOpenSSL 21.0.0,位于`/usr/lib/python3/dist-packages/`),与pip安装的新版cryptography不兼容。当`oss2 → aliyunsdkcore → import OpenSSL.SSL`时,加载的是系统旧版pyOpenSSL,导致属性错误。 受影响的测试: - test_asset_review - test_cosyvoice_service - test_edit_plan_worker_failure - test_oss_direct_upload ## 修复方案 在 `requirements-base.txt` 中显式锁定: 1. `cryptography==46.0.5` — 与本地环境保持一致 2. `pyOpenSSL==26.2.0` — 覆盖系统预装的旧版pyOpenSSL,确保与cryptography 46.0.5兼容 两者均安装至`/usr/local/lib/python3.10/dist-packages/`,优先级高于系统包。 ## 验证结果 - ✅ 单元测试:1107 passed - ✅ 集成测试:381 passed - ✅ 之前失败的4个测试文件均能正常收集运行
xiaoxia added 1 commit 2026-07-09 15:52:38 +08:00
fix(deps): 锁定cryptography版本以修复CI环境GEN_EMAIL兼容性错误
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 21s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 2m0s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
51b3263222
xiaoxia added 1 commit 2026-07-09 15:56:03 +08:00
fix(deps): 添加pyOpenSSL锁定以解决系统包与cryptography版本不兼容
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 7s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 1m29s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
c81dbfa64a
xiaoxia added 1 commit 2026-07-09 15:58:14 +08:00
fix(deps): 更新pyOpenSSL版本至25.0.0以匹配cryptography 46.0.5
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 3s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 1m3s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
b3b166baef
xiaoxia added 1 commit 2026-07-09 16:00:05 +08:00
fix(deps): 使用pyOpenSSL>=24.0.0让pip自动解析兼容版本
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Successful in 1m15s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 1m25s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
f3cd1f4b34
xiaoxia added 1 commit 2026-07-09 16:03:28 +08:00
fix(deps): 精确锁定pyOpenSSL==26.2.0,与cryptography 46.0.5兼容
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Successful in 1m18s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 2m0s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
fdfe228754
xiaoxia merged commit 949a5a3206 into develop 2026-07-09 16:06:16 +08:00
Sign in to join this conversation.