feat: modernize tooling to uv, ruff, ty, and dependency-groups - #1
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Modernizes the dotfile-sync project tooling to use modern Python standards:
Changes
CI Improvements
Code Changes
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.