Skip to content

Modernize tox workflow with uv and docs validation#610

Merged
amureki merged 2 commits into
mainfrom
uv-tox
Jun 12, 2026
Merged

Modernize tox workflow with uv and docs validation#610
amureki merged 2 commits into
mainfrom
uv-tox

Conversation

@amureki

@amureki amureki commented Jun 12, 2026

Copy link
Copy Markdown
Member

Describe the change
A clear and concise description of what the change is.

PR Checklist

  • Change is covered with tests
  • CHANGELOG.md is updated if needed

Summary by CodeRabbit

  • Chores

    • Modernized CI infrastructure and upgraded to Ubuntu 24.04 with tox-uv integration
    • Dropped Django 4.2 support; minimum version now Django 5.2
    • Development workflow updated to use uv package manager
    • Enhanced documentation build configuration and Sphinx settings
  • Documentation

    • Removed legacy migration guide from documentation index

@amureki amureki self-assigned this Jun 12, 2026
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR modernizes the project's development and CI infrastructure by adopting uv-based Python management, integrating tox-uv for standardized test execution, restructuring dependencies into PEP 735 groups, dropping Django 4.2 end-of-life support, and updating documentation and contributor setup instructions.

Changes

Modernize development tooling and drop Django 4.2 support

Layer / File(s) Summary
Project configuration: dependency groups and version targeting
pyproject.toml, CHANGELOG.md
Restructure dependencies into separate [dependency-groups] for tests, typing, lint, and docs; drop Django 4.2 classifier and bump django>=5.2; record removal in changelog.
Tox environment setup with uv integration
tox.ini
Require tox>=4.51.0 with tox-uv plugin; narrow env_list to Django 5.2 and 6.0 on Python 3.10–3.14; configure testenv to use dependency groups; add standalone coverage-combine, coverage-report, docs-build, and pre-commit environments.
CI workflow modernization with uv and tox-uv
.github/workflows/ci.yml
Update all jobs to Ubuntu 24.04; replace direct test calls with uvx --with tox-uv tox run; migrate coverage setup from actions/setup-python+pip to setup-uv with Python 3.13; run coverage and docs builds through tox environments.
Documentation system and build configuration updates
docs/conf.py, docs/index.md, .readthedocs.yaml, .gitignore
Enable MyST heading anchors and explicit source file type mapping in Sphinx; remove deprecated migrating_from_mommy docs page; update Read the Docs to Ubuntu 24.04; ignore docs/_build directory.
Contributor development instructions
CONTRIBUTING.md
Replace pip and make-based workflow with uv-based commands: uv run pytest, uv run pre-commit run --all-files, and uv run ty check model_bakery.
Changelog: tox and baker.make behavior changes
CHANGELOG.md
Document tox-uv integration, dependency groups, reusable coverage/docs environments, and baker.make transaction wrapping and database consistency improvements.

Possibly related PRs

  • model-bakers/model_bakery#564: Updates CI workflow sqlite-tests and postgresql-tests jobs to use uvx ... tox run -e $TOX_ENV with setup-uv, overlapping the same tox modernization and uv integration pattern.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hoppy dev tools, fresh and spry,
Tox-uv hops and workflows fly,
Django four-two hops away,
Five-two and six thrive here to stay,
Uv-powered setup, clean and bright! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Modernize tox workflow with uv and docs validation' directly aligns with the main changes: integrating uv into the tox workflow, updating CI configuration, and adding documentation validation through tox environments.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch uv-tox

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@socket-security

socket-security Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpre-commit@​4.6.093100100100100

View full report

@amureki amureki marked this pull request as ready for review June 12, 2026 12:02

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
pyproject.toml (1)

47-52: ⚡ Quick win

Consider removing duplicate docs group from [project.optional-dependencies].

The docs dependency list is duplicated between [project.optional-dependencies] (lines 47-52) and [dependency-groups] (lines 69-73). Since you've adopted PEP 735 dependency groups as the primary dependency declaration method, the [project.optional-dependencies] entry creates maintenance burden—any docs dependency updates must be synchronized across both locations.

If backward compatibility with older pip/setuptools versions isn't required, consider removing the [project.optional-dependencies] section entirely.

Also applies to: 69-73

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pyproject.toml` around lines 47 - 52, Remove the duplicate docs entry under
[project.optional-dependencies] to avoid maintaining two sources of truth for
the "docs" optional group; keep the PEP 735-compliant [dependency-groups] "docs"
list (the group named "docs") and delete the entire
[project.optional-dependencies] "docs" block (or consolidate by removing the
docs array there), unless you must preserve backwards compatibility with older
installers—if compatibility is required, add a comment explaining the
duplication and keep them in sync.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CONTRIBUTING.md`:
- Around line 15-17: Add the missing language identifier "shell" to each of the
three fenced code blocks that contain commands (the block with "uv run pytest"
and the other two command fences shown around lines 21-23 and 27-29) so
markdownlint MD040 stops flagging them; update each opening fence from ``` to
```shell for those three command blocks in CONTRIBUTING.md.

---

Nitpick comments:
In `@pyproject.toml`:
- Around line 47-52: Remove the duplicate docs entry under
[project.optional-dependencies] to avoid maintaining two sources of truth for
the "docs" optional group; keep the PEP 735-compliant [dependency-groups] "docs"
list (the group named "docs") and delete the entire
[project.optional-dependencies] "docs" block (or consolidate by removing the
docs array there), unless you must preserve backwards compatibility with older
installers—if compatibility is required, add a comment explaining the
duplication and keep them in sync.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a62e8a62-722d-4503-932c-042ead84f97f

📥 Commits

Reviewing files that changed from the base of the PR and between 2619ef0 and 8ce68a3.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • .github/workflows/ci.yml
  • .gitignore
  • .readthedocs.yaml
  • CHANGELOG.md
  • CONTRIBUTING.md
  • docs/conf.py
  • docs/index.md
  • pyproject.toml
  • tox.ini
💤 Files with no reviewable changes (1)
  • docs/index.md

Comment thread CONTRIBUTING.md
Comment on lines 15 to 17
```
pip install .[test]
uv run pytest
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add language tags to the new command fences.
These fenced blocks are missing a language identifier, so markdownlint will keep flagging MD040 and the commands are harder to scan. Use shell on each of the three fences.

Proposed fix
-```
+```shell

Apply the same change to the other two command fences on lines 21-23 and 27-29.

Also applies to: 21-23, 27-29

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 15-15: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CONTRIBUTING.md` around lines 15 - 17, Add the missing language identifier
"shell" to each of the three fenced code blocks that contain commands (the block
with "uv run pytest" and the other two command fences shown around lines 21-23
and 27-29) so markdownlint MD040 stops flagging them; update each opening fence
from ``` to ```shell for those three command blocks in CONTRIBUTING.md.

Source: Linters/SAST tools

@amureki amureki merged commit 8b5594f into main Jun 12, 2026
33 checks passed
@amureki amureki deleted the uv-tox branch June 12, 2026 12:10
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.

1 participant