Skip to content

Add uv#2

Open
ajtritt wants to merge 6 commits into
mainfrom
add-uv
Open

Add uv#2
ajtritt wants to merge 6 commits into
mainfrom
add-uv

Conversation

@ajtritt

@ajtritt ajtritt commented May 21, 2026

Copy link
Copy Markdown

Description

Modernize Python template with uv and ruff to establish best practices and improve developer experience across the organization.

This PR updates the template to use modern, industry-standard Python tooling:

  • uv: Fast Python package manager with deterministic builds via lock files
  • ruff: Unified, high-performance linter and formatter replacing black, flake8, and isort

Key improvements:

  • Faster CI/CD pipelines (uv caching, simplified toolchain)
  • Streamlined dependency management (single pyproject.toml, uv.lock)
  • Cleaner, more maintainable configuration
  • Better developer experience with simplified commands

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

How Has This Been Tested?

  • Ran uv sync to verify lock file generation
  • Verified CI workflow structure and job configurations
  • Tested uv and ruff commands locally
  • Verified cache configuration in setup-uv action

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Updated README with development setup instructions
  • Documented tool choices (uv and ruff) with links

Changes Summary

Configuration Files:

  • pyproject.toml: Migrated to PEP 735 dependency-groups, added ruff and mypy configuration
  • uv.lock: Generated for reproducible installs
  • .gitignore: Added .ruff_cache/

Workflow Files:

  • .github/workflows/ci.yml: Replaced pip+black+flake8+isort with uv+ruff, added check-lock job, enabled caching
  • .github/workflows/publish.yml: New example workflow for building and publishing packages

Removed:

  • requirements.txt and requirements-dev.txt (replaced by uv.lock and pyproject.toml)

Documentation:

  • README.md: Updated Quick Start, Prerequisites, and Development sections with uv/ruff instructions

Additional Context

This template now provides teams with:

  1. Faster feedback loops: uv installs in 2-3 seconds vs 30+ seconds with pip
  2. Deterministic builds: uv.lock guarantees same versions across environments
  3. Simplified tooling: Single ruff command replaces 3 separate tools
  4. Lock file validation: CI automatically checks if uv.lock matches pyproject.toml
  5. Example publishing workflow: Teams can easily enable package publishing to PyPI

Teams can adopt this incrementally or fork and customize as needed. All tools are optional and can be replaced with alternatives in forked repositories.

@ajtritt ajtritt requested a review from wildsm May 21, 2026 00:00
@ajtritt ajtritt self-assigned this May 21, 2026
@ajtritt ajtritt marked this pull request as draft May 21, 2026 00:08
@ajtritt ajtritt marked this pull request as ready for review May 21, 2026 00:38
@wildsm

wildsm commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

I have pushed changes to:

  • Update everything to reflect the current repo location: https://github.com/AI-ModCon/BaseTemplate
  • Update the docs to reflect the current package management and remove empty links
  • Noted that uv and ruff were recommended defaults but not required.

Note: Codex was used; for example to translate the Makefile and replace all links

@wildsm wildsm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I have reviewed all changes.

make install succeeded.

make install-dev succeeded.

make test passed, with the expected warning:

Warning: CoverageWarning: No data was collected. (no-data-collected); see https://coverage.readthedocs.io/en/7.14.0/messages.html#warning-no-data-collected

It otherwise passed with this coverage output:

================================= tests coverage ==================================
_________________ coverage: platform linux, python 3.12.3-final-0 _________________

Name                       Stmts   Miss  Cover   Missing
--------------------------------------------------------
basetemplate/__init__.py       4      4     0%   8-12
--------------------------------------------------------
TOTAL                          4      4     0%
Coverage HTML written to dir htmlcov

make test-cov also passed with the same warning.

make lint passed:

uv run ruff check .
All checks passed!

make format passed:

uv run ruff format .
3 files left unchanged

make type-check passed:

uv run mypy basetemplate
Success: no issues found in 1 source file

All actions are passing.

@wildsm

wildsm commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

@ajtritt can you please merge when you have looked at my recent 8429850 ?

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.

2 participants