-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Python 3.11 #22
Conversation
WalkthroughThe changes include updates to the Python version specifications in two files: the GitHub Actions workflow configuration and the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
dnstapir/key_resolver.py (1)
Line range hint
77-86
: Implement proper HTTP client cleanupThe
httpx.Client()
instance should be properly managed to prevent resource leaks. Consider implementing__enter__
/__exit__
methods or usingcontextlib.closing
.Here's the suggested implementation:
class UrlKeyResolver(CacheKeyResolver): def __init__(self, client_database_base_url: str, key_cache: KeyCache | None = None): super().__init__(key_cache=key_cache) self.client_database_base_url = client_database_base_url - self.httpx_client = httpx.Client() + self._httpx_client = None + + @property + def httpx_client(self) -> httpx.Client: + if self._httpx_client is None: + self._httpx_client = httpx.Client() + return self._httpx_client + + def __del__(self): + if self._httpx_client is not None: + self._httpx_client.close()
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
poetry.lock
is excluded by!**/*.lock
📒 Files selected for processing (3)
.github/workflows/test.yml
(1 hunks)dnstapir/key_resolver.py
(1 hunks)pyproject.toml
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- .github/workflows/test.yml
- pyproject.toml
🔇 Additional comments (2)
dnstapir/key_resolver.py (2)
15-15
: LGTM! Type alias declaration is Python 3.11 compatible
The type alias using the |
operator for union types is fully compatible with Python 3.11 (introduced in Python 3.10 via PEP 604) and follows modern type hinting practices.
Line range hint 1-86
: Implementation is fully compatible with Python 3.11
The codebase demonstrates excellent use of modern Python features that are all compatible with Python 3.11:
- Type hints and union types
- Abstract base classes and proper inheritance
- Context managers for resource management
- Exception chaining
- OpenTelemetry integration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
Summary by CodeRabbit
New Features
Bug Fixes
Improvements