Skip to content

Migrate to uv, setuptools-scm, prek, and ruff#14457

Draft
rtibbles wants to merge 8 commits intolearningequality:developfrom
rtibbles:uv_or_not_uv_that_is_the_question
Draft

Migrate to uv, setuptools-scm, prek, and ruff#14457
rtibbles wants to merge 8 commits intolearningequality:developfrom
rtibbles:uv_or_not_uv_that_is_the_question

Conversation

@rtibbles
Copy link
Copy Markdown
Member

@rtibbles rtibbles commented Mar 26, 2026

Summary

Migrate Kolibri's Python tooling from pip/tox/setup.py to uv, and replace flake8+black with ruff.

  • Dev environments use uv sync --group dev for venv creation, Python version management, and dependency installation
  • Versioning handled by setuptools-scm (replaces custom kolibri/utils/version.py generation logic)
  • Version tests rewritten to use setuptools-scm's versioning code directly, ensuring consistency with our versioning scheme (except for dev versioning, which differs)
  • CI test workflows use uv for Python 3.8+; EOL Python (3.6, 3.7) remains on Docker containers with pip
  • Build pipeline uses uv pip install --python-version 3.6 for staticdeps — no Python 3.6 runtime needed
  • PEX build uses uvx for isolated pex execution — no separate venv or requirements file needed
  • Pre-commit replaced with prek; flake8, black, reorder-python-imports replaced with ruff
  • Removed docker/build_whl.dockerfile and requirements/build.txt — uv handles the isolation that previously required Docker

References

Reviewer guidance

Verified locally:

  • make dist produces wheel and tarball
  • make pex builds PEX using uvx (isolated from dev venv)
  • PEX runs correctly in a Python 3.6 container
  • Full test suite passes on Python 3.8+ via uv
  • Full test suite passes on Python 3.6/3.7 via PYTHONPATH + pip in Docker containers
  • Version utility tests (74) pass on 3.8+ via setuptools-scm

For review:

  • The ruff reformatting commit touches 367 files — review the config commits individually, not the reformat
  • CI is the main verification — check that all workflow jobs pass across the Python version matrix
  • The Python unit tests for EOL Python versions (3.8) required check has moved to the modern job — branch protection will need updating

AI usage

This PR was authored collaboratively with Claude Code. Claude implemented the migration based on a brainstormed design, with each decision reviewed and approved interactively.

@github-actions github-actions bot added DEV: dev-ops Continuous integration & deployment DEV: backend Python, databases, networking, filesystem... APP: Device Re: Device App (content import/export, facility-syncing, user permissions, etc.) APP: Facility Re: Facility App (user/class management, facility settings, csv import/export, etc.) APP: Learn Re: Learn App (content, quizzes, lessons, etc.) APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) APP: User Re: User app (sign-in, sign-up, user profile, etc.) APP: Setup Wizard Re: Setup Wizard (facility import, superuser creation, settings, etc.) SIZE: very large labels Mar 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

@rtibbles rtibbles force-pushed the uv_or_not_uv_that_is_the_question branch from c290799 to f66bbd4 Compare March 26, 2026 23:17
@rtibbles rtibbles force-pushed the uv_or_not_uv_that_is_the_question branch 18 times, most recently from 895c776 to c05f5d3 Compare March 29, 2026 04:48
@rtibbles rtibbles changed the base branch from release-v0.19.x to develop March 30, 2026 15:03
@rtibbles rtibbles force-pushed the uv_or_not_uv_that_is_the_question branch from 758b254 to a1ce5a1 Compare March 30, 2026 15:20
@rtibbles rtibbles force-pushed the uv_or_not_uv_that_is_the_question branch 6 times, most recently from f9046ba to 515a761 Compare March 31, 2026 19:31
@rtibbles rtibbles force-pushed the uv_or_not_uv_that_is_the_question branch from 515a761 to 669bacb Compare April 9, 2026 15:02
@rtibbles rtibbles force-pushed the uv_or_not_uv_that_is_the_question branch from 669bacb to 7361603 Compare April 14, 2026 00:19
@rtibbles rtibbles force-pushed the uv_or_not_uv_that_is_the_question branch from 7361603 to 33a300a Compare April 15, 2026 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) APP: Device Re: Device App (content import/export, facility-syncing, user permissions, etc.) APP: Facility Re: Facility App (user/class management, facility settings, csv import/export, etc.) APP: Learn Re: Learn App (content, quizzes, lessons, etc.) APP: Setup Wizard Re: Setup Wizard (facility import, superuser creation, settings, etc.) APP: User Re: User app (sign-in, sign-up, user profile, etc.) DEV: backend Python, databases, networking, filesystem... DEV: dev-ops Continuous integration & deployment DEV: frontend SIZE: very large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant