chore: Adopt ruff for linting, add Python 3.14 support, and update dependencies#525
chore: Adopt ruff for linting, add Python 3.14 support, and update dependencies#525
Conversation
…, and update development dependencies.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughModernizes linting/pre-commit tooling to Ruff, updates CI/tox to include Python 3.14, raises python_requires to >=3.13, adopts modern typing syntax in HTTP module, and applies assorted whitespace, docstring, and config cleanups across tests and fixtures. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
pyproject.toml (1)
1-3: Align Rufftarget-versionwith the project's declared Python minimum.The
target-version = "py310"at line 2 is misaligned withpython_requires=">=3.13"declared in setup.py. Since the Ruff config enables theUP(pyupgrade) rule, keeping target-version lower than the actual minimum reduces the effectiveness of version-aware linting and upgrade suggestions.🔧 Proposed change
[tool.ruff] -target-version = "py310" +target-version = "py313" line-length = 88🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pyproject.toml` around lines 1 - 3, Update the Ruff configuration's target-version to match the project's declared minimum Python to enable correct pyupgrade/UP linting: change the pyproject.toml setting target-version (currently "py310") to "py313" so it aligns with python_requires=">=3.13" in setup.py, ensuring Ruff's version-aware rules and suggestions use the correct minimum Python baseline.tox.ini (1)
24-24: Broaden Ruff lint scope to include root-level Python files.The current scope checks only
openevsehttpandtests, missingsetup.pyandexample_external_session.pyat the repository root.Proposed adjustment
- ruff check openevsehttp tests + ruff check .🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tox.ini` at line 24, The ruff invocation in tox.ini currently only runs "ruff check openevsehttp tests" and misses root-level Python files like setup.py and example_external_session.py; update the ruff targets in tox.ini to include those files (e.g., add setup.py and example_external_session.py or broaden to "."/all .py files) so ruff checks root-level sources as well, ensuring files such as setup.py and example_external_session.py are linted alongside the openevsehttp and tests directories.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@openevsehttp/__main__.py`:
- Around line 819-823: The clear_limit() and get_limit() callers currently pass
an empty dict (data={}) into process_request(), causing an unnecessary empty
JSON body on DELETE/GET; update clear_limit() and get_limit() to omit the data
argument or pass None instead, and modify process_request() (the function that
sets json=data) to only include the json parameter when data is not None so GET
and DELETE requests are sent without a body.
---
Nitpick comments:
In `@pyproject.toml`:
- Around line 1-3: Update the Ruff configuration's target-version to match the
project's declared minimum Python to enable correct pyupgrade/UP linting: change
the pyproject.toml setting target-version (currently "py310") to "py313" so it
aligns with python_requires=">=3.13" in setup.py, ensuring Ruff's version-aware
rules and suggestions use the correct minimum Python baseline.
In `@tox.ini`:
- Line 24: The ruff invocation in tox.ini currently only runs "ruff check
openevsehttp tests" and misses root-level Python files like setup.py and
example_external_session.py; update the ruff targets in tox.ini to include those
files (e.g., add setup.py and example_external_session.py or broaden to "."/all
.py files) so ruff checks root-level sources as well, ensuring files such as
setup.py and example_external_session.py are linted alongside the openevsehttp
and tests directories.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e3f67fe9-8ae5-4307-aeca-a2c4d1f0b240
📒 Files selected for processing (21)
.github/workflows/test.yml.pre-commit-config.yamlEXTERNAL_SESSION.mdexample_external_session.pyopenevsehttp/__main__.pyopenevsehttp/websocket.pypylintrcpyproject.tomlrequirements_lint.txtrequirements_test.txtsetup.pytests/fixtures/github_v2.jsontests/fixtures/github_v4.jsontests/fixtures/v4_json/config-new.jsontests/fixtures/v4_json/status-broken.jsontests/fixtures/v4_json/status-new.jsontests/fixtures/v4_json/status.jsontests/fixtures/websocket.jsontests/test_main.pytests/test_websocket.pytox.ini
💤 Files with no reviewable changes (4)
- tests/fixtures/github_v2.json
- tests/fixtures/github_v4.json
- pylintrc
- tests/test_websocket.py
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Adopt ruff for linting and formatting, add Python 3.14 support and update development dependencies.
Summary by CodeRabbit