Upgrade pydantic to 2.14.1 with a recompiled requirements-dev.txt

オープン
#6,373 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
15/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

The body says the issue is not open for contribution, so confirm that with maintainers before starting. The work touches requirements.in, requirements.txt and requirements-dev.txt, which must be recompiled with uv pip compile so typing-extensions agrees. Check the QTI models under contentcuration/contentcuration/utils/assessment/qti/ and run the tests in contentcuration/contentcuration/tests/utils/qti/. Done means uv pip sync succeeds and the pinned versions match.

索引モデルが issue の本文から書いたものです。

説明

dependencies DEV: backend python

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

Dependabot PR #6371 bumped pydantic from 2.13.4 to 2.14.1, but its dependency install failed and it was closed unmerged. That PR regenerated only requirements.txt. requirements-dev.txt still pins the old typing-extensions, so the two lock files conflict.

Complexity: Low
Target branch: unstable

Context
  • requirements-dev.in starts with -c requirements.txt, so requirements-dev.txt must match requirements.txt on every package they share. Dependabot regenerates only requirements.txt.
  • These four packages move together in requirements.txt, so they have to be upgraded as a set:
    • pydantic 2.13.4 → 2.14.1
    • pydantic-core 2.46.4 → 2.50.1 (pydantic pins it exactly)
    • typing-extensions 4.15.0 → 4.16.0
    • typing-inspection 0.4.2 → 0.4.4
  • requirements-dev.txt pins typing-extensions==4.15.0 (via exceptiongroup, virtualenv), which conflicts with the 4.16.0 that requirements.txt needs.
  • pydantic is a production dependency. The QTI models in contentcuration/contentcuration/utils/assessment/qti/ are built on it, and publishing converts exercises to QTI with them.
  • The 2.14 release lists two behaviour changes that can affect those models:
    • Enum constructors now run in both validation modes. Enum-typed fields are in constants.py, mathml/fields.py and html/*.py.
    • model_config is no longer mutated. XMLElement in base.py sets extra="forbid", validate_assignment=True and frozen=True.
  • The 2.14 security advisories (GHSA-gj4f-r7mf-jjxh, Fraction exponents; GHSA-955g-x97g-8mcp, multi-host URLs) don't affect Studio. Its pydantic models use no Fraction and no multi-host URL types.
The Change
  • requirements.in should pin pydantic==2.14.1.
  • requirements.txt and requirements-dev.txt should both be recompiled with uv pip compile (the command is in each file's header), so they agree on typing-extensions and every other shared package.
Acceptance Criteria
  • uv pip sync requirements.txt requirements-dev.txt succeeds on Python 3.10.
  • requirements.txt pins pydantic==2.14.1, pydantic-core==2.50.1, typing-extensions==4.16.0 and typing-inspection==0.4.4.
  • requirements-dev.txt pins the same typing-extensions version as requirements.txt.
  • pytest contentcuration/contentcuration/tests/utils/qti/ passes.
  • The full Python CI job runs and passes.
References

AI usage

rtibblesbot (Claude Code) reviewed #6371, recommended closing it, and drafted this issue from that review and the lock files.

Filed from #6371's review.

主要言語
Python
スター
212
フォーク
321
平均マージ
1日 7時間
マージ済み PR(30日)
14

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

learningequality/studio のほかの issue

learningequality/studio の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。