build: modernize tooling, enable strict linting & Python 3.12+ support - #45
Merged
Conversation
…arget - Update `requires-python` and classifiers to explicitly support Python 3.12+ (ensuring Linux/pipx compatibility). - Add project metadata (License, Repository, Issues). - Configure `ruff` for stricter static analysis (`py312` target): - Enable plugins: Bugbear (B), Pyupgrade (UP), Simplify (SIM), Print (T20), Pytest (PT), and Comprehensions (C4). - Correct `isort` known-first-party to `git_pulsar`. - Tighten `mypy` settings: enable `disallow_untyped_defs` for source code, relaxed for tests. - Fix `coverage` omit path for `service.py`. - Remove `uv.lock` from bumpversion config to preserve lockfile integrity.
Apply auto-fixes via `ruff check . --fix` based on the new configuration: - Sort imports (isort). - Modernize python syntax for 3.12+ (pyupgrade). - Simplify logic patterns (flake8-simplify). - Optimize list/dict comprehensions (flake8-comprehensions). - Remove unused imports and variables.
- Combine nested existence and health checks in CLI diagnostics. - Merge safety checks in restore operation (ops.py). - Resolves ruff SIM102 errors (nested-if-statements).
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
This PR overhauls the project's build and quality assurance configuration to support a multi-platform workflow (macOS/Homebrew & Linux/pipx). It establishes Python 3.12 as the minimum supported version, enforcing strict static analysis to prevent forward-incompatible syntax (e.g., Python 3.13+ features) from breaking Linux deployments.
Changes
🔧 Configuration (
pyproject.toml)requires-python = ">=3.12"and added classifiers for 3.12, 3.13, and 3.14.target-versionfrompy314topy312to catch syntax errors for Linux users.B(Bugbear),UP(Pyupgrade),SIM(Simplify),T20(No Print),PT(Pytest),C4(Comprehensions).isortsettings to recognizegit_pulsaras the first-party package.disallow_untyped_defs = truefor source code (strict mode) while relaxing rules for tests.omitpath to correctly targetsrc/git_pulsar/service.py.uv.lockfrombump-my-versionto preserve cryptographic lockfile integrity.🧹 Refactoring
src/git_pulsar/cli.py: Flattened nested if-statements inrun_doctor(RuffSIM102).src/git_pulsar/ops.py: Flattened nested if-statements inrestore_file(RuffSIM102).Motivation
The previous configuration targeted Python 3.14 (macOS specific), which created a risk of shipping code that would crash on Linux environments using Python 3.12. This PR aligns the tooling with the lowest supported version and improves code quality standards.