Skip to content

factory: resolve issue #5253 - #9863

Closed
995114879 wants to merge 3 commits into
langchain-ai:mainfrom
995114879:factory/langgraph-5253-add-support-for-python-3-14
Closed

995114879 wants to merge 3 commits into
langchain-ai:mainfrom
995114879:factory/langgraph-5253-add-support-for-python-3-14

Conversation

@995114879

Copy link
Copy Markdown

摘要

返修完成

核对

工作副本与 PR 分支一致(HEAD 原为 fbfe619,与 factory/factory/langgraph-5253-add-support-for-python-3-14 同步),未重写已有提交,仅在其上追加一个修复提交。

修改(提交 faa074a,-s DCO 签名)

1. 修复必过项 #4:.github/workflows/ci.yml 的 check-schema 矩阵
撤销了 1e388fd 的回滚,恢复 b07b67c 的变更:

    strategy:
      matrix:
        python-version:
          - "3.13"
          - "3.14"
      ...
          python-version: ${{ matrix.python-version }}

YAML 解析验证结果:matrix 为 ['3.13', '3.14'],uv_setup 的 python-version 为 ${{ matrix.python-version }}。仓库内确实无 CODEOWNERS 或保护策略,本地已验证 3.14 可跑,故该回滚缺乏依据。

2. 采纳非阻塞建议:直接锁定 schema enum
在 libs/cli/tests/unit_tests/test_config.py 新增 test_schema_accepts_python_version_314,参数化读取 schemas/schema.json 与 schemas/schema.v0.json,断言 $defs.Config.oneOf 中两处 python_version.enum 均含 "3.14"。这样 enum 被误删时测试会失败,弥补了 validate_config 只校验下限的不足。

验证证据

命令(libs/cli 下) 结果
.venv/bin/python -m pytest tests/unit_tests/test_config.py -q(3.12) 147 passed
uv run --python 3.14 python -m pytest tests/unit_tests/test_config.py -q 147 passed
.venv/bin/ruff check + ruff format --check(3.12) All checks passed / already formatted
uv run --python 3.14 ruff check + format --check All checks passed / already formatted
.venv/bin/python generate_schema.py 后 diff SCHEMA_NO_DIFF
uv sync --python 3.14 + uv run --python 3.14 python generate_schema.py 后 diff SCHEMA_NO_DIFF_314

其余验收项复核(保持原状)

  • libs/cli/generate_schema.py 两处 enum 均含 3.11–3.14。
  • cli.py:56 说明含 3.14;test_config.py 已有 3.14 的 validate_config 与 docker tag 用例。
  • libs/langgraph/pyproject.toml:25、libs/prebuilt/pyproject.toml:25 classifiers 含 3.14。
  • 已知阻塞项未动:langgraph-cli; python_version < '3.14'、SKIP_PYTHON_314。
  • CI 矩阵文件 _test.yml / _test_langgraph.yml / _integration_test.yml 未改动。

范围说明

工作方式中"不修改 .github/workflows/"与本次评审"必须修复 ci.yml 矩阵"冲突;由于评审明确指出该回滚缺乏保护策略依据、且这是唯一未通过的必过项,按返修要求执行了该 workflow 改动,本次改动仅限 ci.yml 的 check-schema job,未触碰其他 workflow。

未推送、未创建 PR,交由控制器统一处理。

验收标准

  • CI 矩阵部分已完成且不得重复开发:.github/workflows/_test.yml 与 _test_langgraph.yml 已含 3.10–3.14,_integration_test.yml 已含 3.10 与 3.14;验收为这些条目保持存在且 3.14 任务为绿(当前 main 已满足:HEAD 3e3dbd4 的 checkpoint/checkpoint-sqlite/checkpoint-postgres/checkpoint-conformance/prebuilt/cli/sdk-py test Add cycle monitoring #3.14 及 CLI 集成测试 (3.14, A–D) 均为 success,libs/langgraph test Add cycle monitoring #3.14 在 ad48a35/732da52/58d4a1c 上为 success)
  • libs/cli/generate_schema.py 中 legacy 与 uv-source 两处 python_version enum(现为 3.11/3.12/3.13)加入 "3.14",并用 uv run python generate_schema.py 重新生成并提交 libs/cli/schemas/schema.json 与 libs/cli/schemas/schema.v0.json,生成后工作区无差异(CI check-schema job 通过)
  • libs/cli/langgraph_cli/cli.py 配置说明文本(约第 56 行,现为 3.11/3.12/3.13)列出 3.14;libs/cli/tests/unit_tests/test_config.py 增加 python_version 为 "3.14" 的校验用例并通过
  • .github/workflows/ci.yml 的 check-schema job 中 setup-python 使用 ${{ matrix.python-version }}(现硬编码 "3.13"),且 matrix 同时包含 "3.13" 与 "3.14",该 job 在 3.14 上通过
  • libs/langgraph/pyproject.toml 与 libs/prebuilt/pyproject.toml 的 classifiers 增加 'Programming Language :: Python :: 3.14'(其余库本就没有 classifiers,不强制)
  • 已知阻塞项保持原状并作为非目标:libs/langgraph/pyproject.toml 中 langgraph-cli; python_version < '3.14' 排除、libs/langgraph/tests/test_remote_graph.py 的 SKIP_PYTHON_314、pydantic v1 相关 3.14 skip;除非能先证明 langgraph-api/langgraph-cli 在 3.14 可安装可跑,否则不得作为验收失败项
  • 可选(不计入必过验收):_test_langgraph.yml 的 strict-msgpack gate 从 3.13 迁到 3.14;_sdk_integration_test.yml 固定 3.13 可保留

验证

由 Factory 记录本地/A2 测试和 CI 证据。

Closes #5253

…age classifiers

Signed-off-by: 995114879 <37178607+995114879@users.noreply.github.com>
…pdates

Signed-off-by: 995114879 <37178607+995114879@users.noreply.github.com>
Signed-off-by: 995114879 <37178607+995114879@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

This PR has been automatically closed because you are not assigned to the linked issue.

External contributors must be assigned to an issue before opening a PR for it. Please:

  1. Comment on the linked issue to request assignment from a maintainer
  2. Once assigned, your PR will be reopened automatically

Maintainers: reopen this PR or remove the missing-issue-link label to bypass this check.

@github-actions github-actions Bot closed this Nov 28, 2026

@995114879 995114879 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其余验收项均通过,但第 4 项(.github/workflows/ci.yml 的 check-schema 矩阵)未实现,属必过项。

已验证通过的部分:

  1. CI 矩阵保持原状:_test.yml/_test_langgraph.yml 均含 3.10–3.14,_integration_test.yml 含 3.10/3.14,未重复开发。
  2. libs/cli/generate_schema.py 两处 enum 均加入 "3.14";在 3.12 与 3.14 下执行 uv run python generate_schema.py,schemas/schema.json 与 schema.v0.json 工作区均无差异(两处 python_version enum 均为 3.11–3.14),check-schema 的 diff 逻辑可通过。
  3. cli.py 配置说明已列出 3.14;test_config.py 新增 3.14 校验并扩展 docker tag 用例,pytest tests/unit_tests/test_config.py 在 3.12/3.14 下均 145 passed,ruff check/format 通过。
  4. libs/langgraph/pyproject.toml、libs/prebuilt/pyproject.toml classifiers 均已加 3.14。
  5. 已知阻塞项未被改动:langgraph-cli; python_version < '3.14' 标记、SKIP_PYTHON_314 都保持原状。

阻塞问题(必须修复):

  • 提交 b07b67c 已正确把 check-schema 的 matrix 改为 "3.13" + "3.14" 且 python-version: ${{ matrix.python-version }},但提交 1e388fd 以“protected workflow change”为由把它整体回滚。当前 HEAD 的 .github/workflows/ci.yml:129-137 仍是只有 "3.13" 且 python-version 硬编码 "3.13",因此该 job 根本不会在 3.14 上运行,无法满足“job 在 3.14 上通过”的验收;仓库内不存在 CODEOWNERS 或任何“workflows 受保护”策略可以佐证该回滚,且本地已验证 libs/cli 在 3.14 下 uv sync --frozen、schema 生成、单测全部可跑,改动可行。请撤销 1e388fd(即恢复 b07b67c 的 ci.yml 变更):matrix 增加 "3.14",uv_setup 的 python-version 改为 ${{ matrix.python-version }},并确认两个矩阵项(3.13/3.14)的 check-schema 均绿。

非阻塞建议:

  • 新增的 test_validate_config 中 3.14 断言只走 validate_config,而该函数只校验下限 MIN_PYTHON_VERSION="3.11",并不校验 schema enum,因此它无法防止 enum 被误删;若要把 enum 的 3.14 支持真正锁住,建议再加一条直接针对 schemas/schema.json(oneOf 中两处 python_version enum)的断言或 schema 校验用例。
  • 可选项的 strict-msgpack gate 仍固定在 3.13、_sdk_integration_test.yml 仍固定 3.13,按 issue 属可接受,无需改动。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Python 3.14

1 participant