Skip to content

build: modernize tooling, enable strict linting & Python 3.12+ support - #45

Merged
JacksonFergusonDev merged 3 commits into
mainfrom
feat/modernize-pyproject
Feb 17, 2026
Merged

build: modernize tooling, enable strict linting & Python 3.12+ support#45
JacksonFergusonDev merged 3 commits into
mainfrom
feat/modernize-pyproject

Conversation

@JacksonFergusonDev

Copy link
Copy Markdown
Owner

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)

  • Python Compatibility: Explicitly set requires-python = ">=3.12" and added classifiers for 3.12, 3.13, and 3.14.
  • Ruff Linter: - Downgraded target-version from py314 to py312 to catch syntax errors for Linux users.
    • Enabled strict rule sets: B (Bugbear), UP (Pyupgrade), SIM (Simplify), T20 (No Print), PT (Pytest), C4 (Comprehensions).
    • Corrected isort settings to recognize git_pulsar as the first-party package.
  • Mypy: Enabled disallow_untyped_defs = true for source code (strict mode) while relaxing rules for tests.
  • Coverage: Fixed the omit path to correctly target src/git_pulsar/service.py.
  • Release: Removed uv.lock from bump-my-version to preserve cryptographic lockfile integrity.

🧹 Refactoring

  • src/git_pulsar/cli.py: Flattened nested if-statements in run_doctor (Ruff SIM102).
  • src/git_pulsar/ops.py: Flattened nested if-statements in restore_file (Ruff SIM102).
  • General: Applied auto-fixes for import sorting, syntax modernization, and logic simplification across the codebase.

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.

…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).
@JacksonFergusonDev
JacksonFergusonDev merged commit a7477cb into main Feb 17, 2026
4 checks passed
@JacksonFergusonDev
JacksonFergusonDev deleted the feat/modernize-pyproject branch February 17, 2026 22:22
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