Skip to content

Migrate to uv, ruff, and pyproject.toml#663

Open
rtibblesbot wants to merge 5 commits intolearningequality:mainfrom
rtibblesbot:issue-662-cb05a4
Open

Migrate to uv, ruff, and pyproject.toml#663
rtibblesbot wants to merge 5 commits intolearningequality:mainfrom
rtibblesbot:issue-662-cb05a4

Conversation

@rtibblesbot
Copy link
Copy Markdown

@rtibblesbot rtibblesbot commented Mar 31, 2026

Summary

Migrate ricecooker from pip/tox/setup.py/black/flake8 to uv/ruff/pyproject.toml, matching the approach established in the Kolibri ecosystem (learningequality/kolibri#14457).

  • pyproject.toml replaces setup.py, setup.cfg, pytest.ini, and MANIFEST.in as the single source of project metadata, dependencies, build config, and tool settings
  • Versioning switches from hardcoded __version__ + bumpversion to setuptools-scm with importlib.metadata
  • tox.ini removed; CI workflows use uv run directly via astral-sh/setup-uv@v7
  • Linting/formatting migrated from black + flake8 + reorder-python-imports to ruff
  • Pre-commit config updated with ruff hooks and uv-lock sync hook
  • exclude-newer cooldown configured in [tool.uv] for supply chain safety
  • Developer docs, Makefile, AGENTS.md, and CLAUDE.md updated for uv-based workflow
  • Fix comparison-as-assignment bugs found by ruff: == used instead of = for SETTINGS assignment in chefs.py (deprecated setting migration was silently broken), and simplify USEPROXY double-assignment in config.py

References

Closes #662

Reference implementation: learningequality/kolibri#14457

Reviewer guidance

  • pyproject.toml — verify dependency completeness against the old setup.py install_requires and extras_require, check setuptools-scm and PEP 735 dependency group config
  • CI workflows (pythontest.yml, pre-commit.yml, python-publish.yml) — the tox-to-uv migration and astral-sh/setup-uv@v7 setup
  • ricecooker/__init__.py:6-12 — version now uses importlib.metadata.version() instead of a hardcoded string
  • ricecooker/chefs.py — fixed === bug in deprecated setting migration (silent no-op before this PR)

To test locally: uv sync --group dev && uv run pytest

AI usage

Implemented by Claude Code following a plan derived from the Kolibri uv migration (learningequality/kolibri#14457). Changes were reviewed against the issue acceptance criteria.


@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?
  • Ran pre-flight CI checks (lint, format, tests) and verified all pass
  • Rebased onto the target branch and resolved any conflicts
  • Reorganized commit history into clean, logical commits
  • Audited the diff to ensure only issue-relevant files are changed
  • Built PR body from the repository's PR template with evidence blocks

status

@rtibblesbot rtibblesbot marked this pull request as ready for review April 1, 2026 01:52
Copy link
Copy Markdown
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

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

I think this could do with being rebased onto latest main, and including uv specific updates in AGENTS.md and CLAUDE.md

@rtibblesbot
Copy link
Copy Markdown
Author

Rebased onto latest main and added uv-specific workflow documentation to both AGENTS.md and CLAUDE.md (commit 765eb3c).

@rtibblesbot rtibblesbot force-pushed the issue-662-cb05a4 branch 2 times, most recently from 1a0ca45 to 40a534e Compare April 7, 2026 00:03
@rtibbles rtibbles self-assigned this Apr 7, 2026
rtibblesbot and others added 5 commits April 10, 2026 08:16
Replace setup.py, setup.cfg, MANIFEST.in, pytest.ini, and tox.ini with a
single pyproject.toml. Switch version management to setuptools-scm with
Python 3.9+ target. Add uv.lock for reproducible dependency resolution.
Replace black/flake8/reorder-python-imports with ruff in pre-commit config.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Migrate GitHub Actions test workflow from tox to uv run pytest. Replace
pre-commit/action with prek for linting. Use uv build for publishing.
Switch dependabot to uv ecosystem. Update ReadTheDocs config to install
via uv. Add fetch-depth: 0 to checkout steps for setuptools-scm.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Run ruff format and isort across the codebase. Also fix bugs surfaced by
static analysis: comparison-as-assignment in chefs.py (deprecated settings
migration was silently broken), redundant USEPROXY double-assignment in
config.py, and import ordering in __init__.py and conftest.py. Wrap fixture
downloads in try/except so transient network failures result in skipped
tests rather than CI errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rewrite Makefile targets to use uv run for test, coverage, and docs.
Replace black/flake8 references with ruff. Rewrite CONTRIBUTING.md with
uv-based development setup. Update AGENTS.md and CLAUDE.md to reference
uv/prek instead of pip/pre-commit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

Migrate Python tooling to uv and ruff

2 participants