Skip to content

Enable ruff PYI rule (type annotation improvements)#2003

Merged
iMicknl merged 2 commits intov2/mainfrom
v2/ruff-pyi
Apr 19, 2026
Merged

Enable ruff PYI rule (type annotation improvements)#2003
iMicknl merged 2 commits intov2/mainfrom
v2/ruff-pyi

Conversation

@iMicknl
Copy link
Copy Markdown
Owner

@iMicknl iMicknl commented Apr 19, 2026

Summary

  • Use Self return type for __aenter__ (PYI034)
  • Simplify int | float to float in type hints (PYI041)

Test plan

  • ruff check . passes
  • pytest — 280 tests pass
  • mypy passes

@iMicknl iMicknl added enhancement New feature or request v2 labels Apr 19, 2026
Copilot AI review requested due to automatic review settings April 19, 2026 17:21
@iMicknl iMicknl requested a review from tetienne as a code owner April 19, 2026 17:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables Ruff’s flake8-pyi (PYI) lint rules and applies the resulting type-annotation cleanups across the codebase to improve typing clarity and consistency.

Changes:

  • Enable Ruff PYI rules in pyproject.toml.
  • Update OverkizClient.__aenter__ to return Self (PYI034).
  • Simplify int | float to float in relevant type hints (PYI041).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
pyproject.toml Adds PYI to Ruff’s selected lint rules.
pyoverkiz/models.py Simplifies numeric type hints for ValuePrototype initializer parameters.
pyoverkiz/client.py Uses Self as the return type for __aenter__ and imports it from typing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyoverkiz/models.py
- Use Self return type for __aenter__ (PYI034)
- Simplify int | float to float in ValuePrototype (PYI041)
Address review feedback: align ValuePrototype class attribute
annotations with __init__ parameter types (int | float -> float).
@iMicknl iMicknl merged commit 50e1ff5 into v2/main Apr 19, 2026
8 checks passed
@iMicknl iMicknl deleted the v2/ruff-pyi branch April 19, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants