Skip to content

Modernize Python template and agent guidance#86

Merged
qartik merged 7 commits intomainfrom
ks-modernize-template
Mar 19, 2026
Merged

Modernize Python template and agent guidance#86
qartik merged 7 commits intomainfrom
ks-modernize-template

Conversation

@qartik
Copy link
Copy Markdown
Member

@qartik qartik commented Mar 16, 2026

Summary

  • migrate the template to a modern uv_build + src layout with tool configuration centralized in pyproject.toml
  • standardize the development workflow on uv, ruff, ty, pytest, pip-audit, and prek, including stricter template defaults such as docstrings from day one, ruff select = ["ALL"], and a coverage floor
  • update Docker, docs, tests, and Makefile targets, and template onboarding guidance to match the new workflow, including runtime-only dependency sync in the container image
  • add cross-agent repository guidance in AGENTS.md so skill-aware and non-skill-aware agents follow the same modern Python conventions
  • refresh uv.lock, add .python-version, and remove the standalone ruff.toml

Notes

  • ty still emits its upstream Python 3.14 preview warning even though the checks pass

@qartik qartik requested review from NathanCQC and Copilot March 16, 2026 19:02
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the Python template to a uv_build-based build and a src/ package layout, consolidating tooling configuration into pyproject.toml and aligning local workflows/tests/docs with uv, ruff, ty, and pytest.

Changes:

  • Migrate packaging to uv_build and adopt a src/pytemplate layout with a console script entry point.
  • Centralize ruff, pytest (with coverage), and ty configuration in pyproject.toml and remove ruff.toml.
  • Update workflows and docs: Makefile targets, Docker command, Sphinx path configuration, and tests.

Reviewed changes

Copilot reviewed 11 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
uv.lock Adds/updates locked tool dependencies (ruff/ty/pytest-cov/coverage) and dependency groups.
pyproject.toml Switches build backend to uv_build, defines dependency groups, console script, and tool configs (pytest/ruff/ty).
src/pytemplate/main.py Adds a proper module entry point (main()) and greeting helper.
src/pytemplate/utils.py Minor docstring grammar fix.
src/pytemplate/__init__.py Adds package initializer for src layout.
tests/test_main.py Adds stdout/capsys test for main() and updates imports/docstrings.
tests/test_utils.py Removes unnecessary noqa now that test ignores are configured.
docs/source/conf.py Updates Sphinx import path to include src/.
Makefile Updates targets to use uv sync, ruff, ty, and pytest consistently; adjusts docs generation path.
Dockerfile Runs installed console script (pytemplate) instead of a module file path.
.gitignore Ignores coverage/tool caches and standardizes .venv/.
README.md Updates documentation to reflect src layout, uv workflows, and console entry point.
ruff.toml Removed in favor of pyproject.toml configuration.
pytemplate/main.py Removed old non-src module that printed at import time.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_main.py Outdated
@qartik qartik changed the title Modernize Python template tooling Modernize Python template and agent guidance Mar 19, 2026
@qartik qartik requested a review from Copilot March 19, 2026 14:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the repository’s Python template to a uv_build + src/ layout, consolidating tooling configuration into pyproject.toml and updating docs/workflows to use uv, ruff, ty, pytest, and pip-audit consistently.

Changes:

  • Migrates packaging/build to uv_build with a src/pytemplate layout and adds a console entry point.
  • Centralizes pytest, ruff, and ty configuration in pyproject.toml, adds dependency groups, and refreshes uv.lock.
  • Updates developer experience artifacts (Makefile, Dockerfile, docs config, README) and adds cross-agent guidance (AGENTS.md).

Reviewed changes

Copilot reviewed 13 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pyproject.toml Switches build backend to uv_build, defines dependency groups/default groups, and centralizes tool configs (pytest/ruff/ty).
uv.lock Refreshes lockfile and adds dev tooling dependencies (ruff/ty/pytest-cov/pip-audit, etc.).
src/pytemplate/main.py Adds module with hello_world() and main() for console entry point.
src/pytemplate/utils.py Fixes docstring grammar.
src/pytemplate/__init__.py Adds package init file for src/ layout.
tests/test_main.py Updates imports and adds a main() stdout test (but currently has a runtime annotation import issue).
tests/test_utils.py Removes inline ruff ignore now covered by per-file ignores.
docs/source/conf.py Updates Sphinx path injection to include src/ directory.
README.md Updates template guidance and commands for uv/ruff/ty/pytest/pip-audit.
Makefile Aligns common workflows with uv sync, ruff format/check, ty, pytest, and pip-audit.
Dockerfile Runs the console script via uv run pytemplate.
AGENTS.md Adds repository guidance for agents to follow the modern Python workflow.
.python-version Pins local Python version to 3.14.
.gitignore Adds ignores for coverage/caches and standardizes venv ignore to .venv/.
ruff.toml Removes standalone Ruff config in favor of pyproject.toml.
pytemplate/main.py Removes legacy top-level package layout entrypoint file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_main.py
Comment thread Dockerfile Outdated
Comment thread README.md Outdated
@qartik qartik added this pull request to the merge queue Mar 19, 2026
Merged via the queue into main with commit 1bc1985 Mar 19, 2026
1 check passed
@qartik qartik deleted the ks-modernize-template branch March 19, 2026 15:18
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.

3 participants