Add sample code for How to Set Up a Python Project for Agentic Coding - #829
Open
realpython-bot wants to merge 1 commit into
Open
realpython-bot wants to merge 1 commit into
realpython-bot wants to merge 1 commit into
Conversation
Finished project from "How to Set Up a Python Project for Agentic Coding": a uv package layout wired up with Ruff, mypy in strict mode, pytest with a 90% coverage gate, and pre-commit hooks. Verified with uv 0.11.26: pytest passes at 100% coverage, mypy --strict is clean, ruff check and format are clean, and all three pre-commit hooks pass on a first commit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
acsany
approved these changes
Sep 14, 2026
acsany
left a comment
Contributor
There was a problem hiding this comment.
Approving. Verified against uv 0.11.26: pytest passes at 100% coverage clearing the 90% gate, mypy is clean under strict, Ruff check and format are clean, and all three pre-commit hooks pass. Contents match the finished project in the tutorial.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sample code for the tutorial "How to Set Up a Python Project for Agentic Coding" (CMS Post 2244, Trello card 1546).
This fills the
Materials PRslot on the card, which was stillXXX.Contents
The finished project from the tutorial, in a
uv init --packagelayout:pyproject.tomlsrc/ai_agent_project/__init__.pydouble()function the tutorial buildstests/test_main.py.pre-commit-config.yamlAGENTS.md.env.exampleREADME.mdVerification
Run against uv 0.11.26:
uv run pytestpasses at 100% coverage, clearing the--cov-fail-under=90gateuv run mypy .is clean understrict = trueuv run ruff check .anduv run ruff format --check .are cleanuv run pre-commit run --all-filespasses all three hooksWhy it is needed now
The article's opt-in (
python-project-for-agentic-coding-code) points its download URL atmaterials/python-project-for-agentic-coding. Until this merges, that URL returns 404 and the article's CMS preflight reports aURLFieldValidationError.🤖 Generated with Claude Code