Skip to content

Conversation

tobiasraabe
Copy link
Member

Summary

This PR upgrades pytask-stata to use modern Python tooling:

  • uv for dependency management (replacing tox)
  • ty for ultra-fast type checking (replacing mypy)
  • Updated minimum versions and test matrix

Key Changes

Dependency Management

  • ✅ Replace tox with uv for dependency management
  • ✅ Remove tox.ini and migrate to dependency-groups in pyproject.toml
  • ✅ Update CI workflows to use uv run commands

Python & Dependencies

  • ✅ Update minimum Python version: 3.8 → 3.9
  • ✅ Update minimum pytask version: 0.4 → 0.5.2
  • ✅ Add Python 3.13 to test matrix (now tests 3.9-3.13)

Type Checking

  • ✅ Replace mypy with ty for ultra-fast type checking
  • ✅ Update CI workflow to run uv run ty check
  • ✅ Remove mypy-specific configuration (ty uses sensible defaults)

Code Quality

  • ✅ Remove deprecated ruff rules (ANN101, ANN102)
  • ✅ Update ruff target version to py39
  • ✅ All existing functionality preserved

Test Results

  • All tests pass: 32 passed, 10 skipped
  • Type checking works: ty detects type issues as expected
  • Dependencies sync: uv sync --all-groups works correctly

Breaking Changes

⚠️ Minimum Python version raised from 3.8 to 3.9

This aligns with modern Python support and enables using newer language features.

tobiasraabe and others added 11 commits July 26, 2025 13:36
- Update minimum Python version from 3.8 to 3.9
- Update minimum pytask version from 0.4 to 0.5.2
- Replace tox with uv for dependency management
- Replace mypy with ty for ultra-fast type checking
- Update CI workflows to use uv and test Python 3.9-3.13
- Remove deprecated ruff rules (ANN101, ANN102)
- Update ruff target version to py39

All tests pass (32 passed, 10 skipped)
- Add justfile with common development tasks similar to main repo
- Fix Path.cwd() usage in execute.py (remove invalid argument)
- Add ty: ignore comments for complex type issues that would require substantial refactoring
- Type checking now passes cleanly with ty
- Add astral-sh/uv-pre-commit hook to automatically keep uv.lock in sync
- Hook runs uv-lock to ensure lockfile is up to date with pyproject.toml changes
- Add lowest resolution testing on Python 3.9 + ubuntu-latest
- Add highest resolution testing on Python 3.13 + ubuntu-latest
- Matches testing strategy from main pytask repository
- Ensures compatibility with both conservative and latest dependency versions
@tobiasraabe tobiasraabe merged commit 24be320 into main Jul 26, 2025
19 of 20 checks passed
@tobiasraabe tobiasraabe deleted the upgrade-to-uv-and-ty branch July 26, 2025 12:17
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