Skip to content

chore: enable ruff UP006/UP007, replace legacy typing imports#239

Closed
TKaltofen wants to merge 1 commit intomainfrom
chore/ruff-up006-up007
Closed

chore: enable ruff UP006/UP007, replace legacy typing imports#239
TKaltofen wants to merge 1 commit intomainfrom
chore/ruff-up006-up007

Conversation

@TKaltofen
Copy link
Copy Markdown
Collaborator

Summary

  • Enables ruff rules UP006 and UP007 in pyproject.toml to enforce modern type annotation syntax
  • Auto-fixes 2169 violations across 294 files: replaces List[X] with list[X], Dict[K,V] with dict[K,V], Optional[X] with X | None, Union[X,Y] with X | Y
  • Adds ruff check . to tox commands so lint rules are enforced alongside format, mypy, and bandit
  • Removes 10 now-unnecessary # type: ignore comments in node_centrality and forecasting modules

Closes #234

Test plan

  • ruff check . passes with zero violations
  • mypy --strict passes (572 source files, 0 errors)
  • Full tox pytest run: 2191 passed, 124 skipped (13 pre-existing failures unrelated to this change)
  • ruff format clean (3 files reformatted by auto-fix)

@TKaltofen TKaltofen requested a review from TomKaltofen as a code owner March 24, 2026 19:20
@TomKaltofen TomKaltofen deleted the chore/ruff-up006-up007 branch March 26, 2026 16:09
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.

Add ruff UP006/UP007 rules to remove redundant typing imports

2 participants