Skip to content

Conversation

@drbenvincent
Copy link
Collaborator

@drbenvincent drbenvincent commented Nov 22, 2025

This PR modernizes our pyproject.toml configuration and enables stricter linting rules to catch potential bugs and improve code quality.

Changes to pyproject.toml

  • Added project URLs: Documentation, Changelog, and Discussions links for better discoverability
  • Enhanced coverage settings: Added source, branch, show_missing, and fail_under=80 threshold
  • Expanded ruff linting: Added rules to catch bugs (F, B), modernize syntax (UP), and improve code style (C4, SIM)
  • Improved mypy config: Added python_version and check_untyped_defs settings
  • Cleaned up dependencies: Removed pathlib from dev dependencies (standard library)

Code Fixes

Fixed 27 linting errors across the codebase to comply with new stricter rules:

  • B008, B006: Fixed mutable default arguments (common Python pitfall)
  • B028: Added proper stacklevel to warnings
  • B905: Added strict= parameter to zip() calls
  • UP038: Modernized isinstance() calls to use | syntax (Python 3.10+)
  • SIM102, SIM105: Simplified nested conditionals and exception handling
  • C405: Converted list literals to set literals where appropriate

Pre-commit Configuration

  • Added exclude: ^docs/ to ruff pre-commit hook to avoid applying strict rules to example notebooks
  • All pre-commit checks now pass

Testing

  • All 197 tests pass
  • Code coverage threshold set to 80%
  • No breaking changes to public APIs

📚 Documentation preview 📚: https://causalpy--571.org.readthedocs.build/en/571/

@drbenvincent drbenvincent added the devops DevOps related label Nov 22, 2025
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops DevOps related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants