Skip to content

Get rid of runtime warnings#250

Merged
amotl merged 2 commits intomainfrom
mitigate-warnings
Feb 27, 2026
Merged

Get rid of runtime warnings#250
amotl merged 2 commits intomainfrom
mitigate-warnings

Conversation

@amotl
Copy link
Member

@amotl amotl commented Feb 27, 2026

About

  • Migrate load_entrypoint from pkg_resources to importlib.metadata
  • Mitigate SyntaxWarning: invalid escape sequence '\d'

This mitigates another runtime warning:

  UserWarning: pkg_resources is deprecated as an API
@coderabbitai
Copy link

coderabbitai bot commented Feb 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1ea94cb and 5442c00.

📒 Files selected for processing (2)
  • kotori/core.py
  • kotori/util/common.py

Walkthrough

Refactored load_entrypoint method to use EntryPoint constructor and .load() method instead of manual expression parsing. Updated regex pattern in tdelta function to use raw string literal for proper backslash handling.

Changes

Cohort / File(s) Summary
EntryPoint Loading Refactor
kotori/core.py
Replaced expression parsing with direct EntryPoint object construction; altered error handling where creation failures now log and raise immediately, while load failures maintain onerror behavior. Added method docstring.
Regex Pattern Fix
kotori/util/common.py
Converted regex pattern from standard string to raw string literal in tdelta function to prevent Python escape sequence interpretation issues.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

🐰 A rabbit's delight in the code today,
EntryPoints load in a cleaner way,
Raw strings now shine, escapes all tight,
Syntax warnings flee into the night!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Get rid of runtime warnings' accurately describes the main objective of the pull request, which addresses multiple runtime warnings including pkg_resources deprecation and SyntaxWarning.
Description check ✅ Passed The description directly addresses the changeset by mentioning the two main changes: migrating load_entrypoint from pkg_resources to importlib.metadata and mitigating the SyntaxWarning for invalid escape sequence.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mitigate-warnings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@amotl amotl marked this pull request as ready for review February 27, 2026 00:12
@amotl amotl merged commit e72c8b8 into main Feb 27, 2026
10 checks passed
@amotl amotl deleted the mitigate-warnings branch February 27, 2026 00:19
@amotl amotl mentioned this pull request Feb 27, 2026
@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 40.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.45%. Comparing base (1ea94cb) to head (5442c00).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
kotori/core.py 44.44% 5 Missing ⚠️
kotori/util/common.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #250      +/-   ##
==========================================
- Coverage   78.50%   78.45%   -0.06%     
==========================================
  Files          56       56              
  Lines        3020     3021       +1     
==========================================
- Hits         2371     2370       -1     
- Misses        649      651       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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