Skip to content

prek uv pyrefly#13

Merged
nekeal merged 17 commits intomasterfrom
prek-uv-pyrefly
Mar 22, 2026
Merged

prek uv pyrefly#13
nekeal merged 17 commits intomasterfrom
prek-uv-pyrefly

Conversation

@nekeal
Copy link
Copy Markdown
Owner

@nekeal nekeal commented Mar 20, 2026

Summary

Upgrade the cookiecutter Python project template to modern tooling.

Changes

Component Before After
Build System Poetry hatchling
Dependency Groups [tool.poetry.group.dev.dependencies] [dependency-groups]
Pre-commit pre-commit prek (priority-based)
Type Checking mypy pyrefly
Commands poetry run uv run

Kept

  • mkdocs, mkdocstrings, pymdown-extensions for documentation
  • pytest-github-actions-annotate-failures for CI
  • python-kacl (optional, for releasable projects)

Added

  • Claude Code entries to .gitignore (.agents/, .claude/)
  • Test verifying dependencies install with uv sync
  • Test verifying all pre-commit hooks pass on generated project

Tests

All 8 tests pass:

  • test_generate_new_project
  • test_uses_hatchling_build_system
  • test_uses_dependency_groups
  • test_python_version_is_correctly_included_in_ruff_config
  • test_python_version_is_correctly_included_in_github_workflow
  • test_specific_files_and_packages_are_not_include_if_package_is_meant_to_be_not_releasable
  • test_dependencies_can_be_installed
  • test_precommit_hooks_pass

nekeal added 16 commits March 22, 2026 11:23
- Replace Poetry with hatchling build system
- Replace [tool.poetry.group.dev.dependencies] with [dependency-groups]
- Replace pre-commit with prek (priority-based execution)
- Replace mypy with pyrefly for type checking
- Add uv run commands for all hooks
- Keep mkdocs, pytest-github-actions-annotate-failures, and kacl
(optional)
- Add Claude Code entries to .gitignore
- Update tests for new tooling
- Add test verifying dependencies install with uv sync
- Initialize git repo in generated project
- Run uv sync to install dependencies
- Run prek run --all-files to verify all hooks pass
- Add python-uv-env action for setting up uv environment
- Update main workflow to use uv sync + pre-commit
- Update generated project workflow to use uv and pre-commit
- Keep pre-commit for backward compatibility instead of prek
- Update main workflow to install and run prek
- Update generated project workflow to run prek
- prek supports builtin hooks which pre-commit doesn't
- Add 3.14+ option to python_version choices
- Update _python_version_specs to include 3.14 in all version ranges
- Update test to expect 3.14 in GitHub Actions matrix
- Replace custom python-uv-env action with official
astral-sh/setup-uv@v7
- Update test.yml, release.yml, draft_release.yml, cookiecutter.yml,
dependencies.yml
- Use uv for building, publishing, and running commands
- Update actionlint version to 1.7.11
- Use prek for pre-commit checks (installed via pip)
- Disable uv caching as requested
- Add --system flag for system-wide package installation
- Fixes 'No virtual environment found' error in GitHub Actions
- GitHub Actions runners use PEP 668 which blocks system pip installs
- Use activate-environment: true to create virtual environment
automatically
- Remove --system flag from uv pip install commands
- Root project doesn't have pyproject.toml configured for uv sync
- Dependencies are already installed via uv pip install
- Replace deprecated set-output with $GITHUB_OUTPUT
- Update peter-evans/create-pull-request from v3 to v5
- Add trailing newlines to workflow files
- Convert pyproject.toml from Poetry to PEP 621 format
- Use hatchling as build backend
- Add dependency-groups for dev dependencies
- Fix trailing newlines in workflow templates
- Use {% endraw +%} to preserve trailing newlines in generated files
- Fixes end-of-file-fixer hook failures in CI
- Update peter-evans/create-pull-request from v5 to v6
- Add shellcheck disable=SC2086 comments to suppress info-level warnings
- SC2086 warnings about unquoted variables are false positives in CI
context
- Quote $GITHUB_OUTPUT variable in all workflow files
- Remove unnecessary shellcheck disable comments
- Simplest solution that satisfies shellcheck
@nekeal nekeal merged commit 489f080 into master Mar 22, 2026
4 checks passed
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