Skip to content

feat: modernize tooling to uv, ruff, ty, and dependency-groups - #1

Merged
jlaportebot merged 1 commit into
mainfrom
feat/modernize-tooling
Jun 19, 2026
Merged

feat: modernize tooling to uv, ruff, ty, and dependency-groups#1
jlaportebot merged 1 commit into
mainfrom
feat/modernize-tooling

Conversation

@jlaportebot

Copy link
Copy Markdown
Owner

Summary

Modernizes the dotfile-sync project tooling to use modern Python standards:

Changes

  • Build backend: Switch from setuptools to hatchling
  • Python version: Update requires-python from >=3.9 to >=3.11
  • Type checking: Replace mypy with ty (faster, from Astral team)
  • Dependency management: Migrate from to (PEP 735)
  • Linting/formatting: Enhanced ruff configuration with more rules and per-file ignores for tests
  • CI/CD: Complete rewrite using uv with separate lint, test, typecheck, and build jobs
  • Code quality: Fix mypy error in core.py, apply ruff auto-fixes (Path.open(), datetime.UTC)

CI Improvements

  • Separate lint, test, typecheck, and build jobs for better parallelization
  • Test matrix: Python 3.11, 3.12, 3.13 (dropped 3.9, 3.10)
  • Uses astral-sh/setup-uv@v5 with caching enabled
  • Coverage threshold: 70% (current: 79%)
  • Build verification step

Code Changes

  • : Added for type safety, replaced with , with
  • All ruff linting rules pass
  • All ty type checks pass
  • All 47 tests pass

Testing

============================= test session starts ==============================
platform linux -- Python 3.14.4, pytest-9.1.0, pluggy-1.6.0 -- /home/john/dotfile-sync/.venv/bin/python3
cachedir: .pytest_cache
rootdir: /home/john/dotfile-sync
configfile: pyproject.toml
testpaths: tests
plugins: cov-7.1.0
collecting ... collected 47 items

tests/test_cli.py::TestCLIVersion::test_version PASSED [ 2%]
tests/test_cli.py::TestCLIHelp::test_main_help PASSED [ 4%]
tests/test_cli.py::TestCLIHelp::test_init_help PASSED [ 6%]
tests/test_cli.py::TestCLIHelp::test_track_help PASSED [ 8%]
tests/test_cli.py::TestCLIHelp::test_backup_help PASSED [ 10%]
tests/test_cli.py::TestCLIHelp::test_restore_help PASSED [ 12%]
tests/test_cli.py::TestCLIHelp::test_untrack_help PASSED [ 14%]
tests/test_cli.py::TestCLIHelp::test_diff_help PASSED [ 17%]
tests/test_cli.py::TestCLIHelp::test_status_help PASSED [ 19%]
tests/test_cli.py::TestCLIHelp::test_push_help PASSED [ 21%]
tests/test_cli.py::TestCLIHelp::test_pull_help PASSED [ 23%]
tests/test_core.py::TestManifest::test_empty_manifest PASSED [ 25%]
tests/test_core.py::TestManifest::test_add_file PASSED [ 27%]
tests/test_core.py::TestManifest::test_add_duplicate_is_noop PASSED [ 29%]
tests/test_core.py::TestManifest::test_remove_file PASSED [ 31%]
tests/test_core.py::TestManifest::test_remove_nonexistent PASSED [ 34%]
tests/test_core.py::TestManifest::test_is_tracked PASSED [ 36%]
tests/test_core.py::TestManifest::test_save_and_reload PASSED [ 38%]
tests/test_core.py::TestInit::test_init_creates_repo PASSED [ 40%]
tests/test_core.py::TestInit::test_init_idempotent PASSED [ 42%]
tests/test_core.py::TestInit::test_init_with_remote PASSED [ 44%]
tests/test_core.py::TestTrack::test_track_single_file PASSED [ 46%]
tests/test_core.py::TestTrack::test_track_already_tracked PASSED [ 48%]
tests/test_core.py::TestTrack::test_track_directory PASSED [ 51%]
tests/test_core.py::TestTrack::test_track_nonexistent_path PASSED [ 53%]
tests/test_core.py::TestUntrack::test_untrack_file PASSED [ 55%]
tests/test_core.py::TestUntrack::test_untrack_not_tracked PASSED [ 57%]
tests/test_core.py::TestUntrack::test_untrack_directory PASSED [ 59%]
tests/test_core.py::TestBackup::test_backup_copies_files PASSED [ 61%]
tests/test_core.py::TestBackup::test_backup_with_message PASSED [ 63%]
tests/test_core.py::TestBackup::test_backup_no_tracked_files PASSED [ 65%]
tests/test_core.py::TestBackup::test_backup_file_content_preserved PASSED [ 68%]
tests/test_core.py::TestRestore::test_restore_copies_files PASSED [ 70%]
tests/test_core.py::TestRestore::test_restore_single_file PASSED [ 72%]
tests/test_core.py::TestRestore::test_restore_no_manifest PASSED [ 74%]
tests/test_core.py::TestDiff::test_diff_no_changes PASSED [ 76%]
tests/test_core.py::TestDiff::test_diff_with_modification PASSED [ 78%]
tests/test_core.py::TestDiff::test_diff_new_file PASSED [ 80%]
tests/test_core.py::TestDiff::test_diff_deleted_file PASSED [ 82%]
tests/test_core.py::TestListTracked::test_list_tracked_files PASSED [ 85%]
tests/test_core.py::TestListTracked::test_list_no_files PASSED [ 87%]
tests/test_core.py::TestEncodeRepoPath::test_encode_dotfile PASSED [ 89%]
tests/test_core.py::TestEncodeRepoPath::test_encode_nested_dotfile PASSED [ 91%]
tests/test_core.py::TestEncodeRepoPath::test_encode_no_dot PASSED [ 93%]
tests/test_core.py::TestEncodeRepoPath::test_encode_multiple_dots PASSED [ 95%]
tests/test_core.py::TestNotInitialized::test_track_without_init PASSED [ 97%]
tests/test_core.py::TestNotInitialized::test_backup_without_init PASSED [100%]

================================ tests coverage ================================
_______________ coverage: platform linux, python 3.14.4-final-0 ________________

Name Stmts Miss Cover Missing

dotfile_sync/init.py 1 0 100%
dotfile_sync/cli.py 92 39 58% 23-30, 47-49, 57-59, 67-69, 76-78, 86-88, 96-98, 105-107, 114-116, 123-125, 132-134, 138
dotfile_sync/core.py 228 28 88% 207, 237-238, 246, 255, 263, 282, 288, 312-322, 326-338, 359-366

TOTAL 321 67 79%
Required test coverage of 70% reached. Total coverage: 79.13%
============================== 47 passed in 1.13s ==============================
All checks passed!
8 files already formatted
All checks passed!
dotfile-sync, version 1.0.0

All commands pass locally.

- Switch from setuptools to hatchling build backend
- Update requires-python from >=3.9 to >=3.11
- Replace mypy with ty for type checking
- Migrate from optional-dependencies to dependency-groups (PEP 735)
- Update CI to use uv, ruff, ty with separate lint/test/typecheck jobs
- Fix mypy error in core.py by adding cast()
- Apply ruff fixes: Path.open(), datetime.UTC, formatting
- Add coverage threshold (70%) to pytest config
- Update classifiers with valid Topic classifier
@jlaportebot
jlaportebot merged commit 3a62c8b into main Jun 19, 2026
6 checks passed
@jlaportebot
jlaportebot deleted the feat/modernize-tooling branch June 19, 2026 04:33
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