Skip to content

chore(schemas): migrate schemas from Poetry to uv #16201

Description

@jaredlockhart

Problem

The schemas package (mozilla-nimbus-schemas) manages its Python dependencies with Poetry. We are standardizing the repo's Python projects on uv, which is now the best supported way to manage Python dependencies (faster installs, native Dependabot support). This follows the cirrus migration (#16174).

Schemas is a published package (PyPI + npm) that ships generated JSON schema data files, so the migration also swaps the build path.

Change

  • Convert schemas/pyproject.toml from [tool.poetry] to PEP 621 [project] + the uv build backend ([tool.uv.build-backend]), which bundles the generated mozilla_nimbus_schemas/schemas data into both wheel and sdist. Fix the license to a valid SPDX identifier (MPL-2.0).
  • Replace poetry.lock with uv.lock.
  • Install dependencies via uv in schemas/Dockerfile (venv, copied to the dev stage; the project is installed editable so its in-package tests import).
  • Makefile: poetry builduv build, poetry versionuv version; drop the poetry run prefix. Publish path (twine for PyPI, yarn for npm) is unchanged.
  • Switch the /schemas Dependabot entry from pip to uv (the npm entry stays).
  • deploy-schemas.yml: compare the actual version value between commits instead of grepping the diff for the word "version", so structural pyproject edits (like this migration) don't misfire a deploy.

Acceptance criteria

  • make schemas_check passes (black, ruff, schema-generation diff, pytest).
  • make schemas_build produces a wheel and sdist containing the generated schema data files.
  • Dependabot tracks uv.lock via the uv ecosystem.
  • The deploy workflow only runs on an actual version change.

┆Issue is synchronized with this Jira Task

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions