Skip to content

chore: Adopt ruff for linting, add Python 3.14 support, and update dependencies#525

Merged
firstof9 merged 5 commits intomainfrom
update-tests
Mar 4, 2026
Merged

chore: Adopt ruff for linting, add Python 3.14 support, and update dependencies#525
firstof9 merged 5 commits intomainfrom
update-tests

Conversation

@firstof9
Copy link
Owner

@firstof9 firstof9 commented Mar 4, 2026

Adopt ruff for linting and formatting, add Python 3.14 support and update development dependencies.

Summary by CodeRabbit

  • Chores
    • Bumped minimum Python to >=3.13, added Python 3.14 test support, and updated CI test matrix.
    • Replaced legacy lint tooling with Ruff, updated pre-commit hooks and packaging classifiers; removed old lint config.
  • Style
    • Project-wide formatting and whitespace normalizations across fixtures and configs.
  • Documentation
    • Minor docstring and typo corrections.
  • Tests
    • Small test adjustments and fixture formatting updates.

@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4925735d-458c-48ce-9c9b-7709b8295129

📥 Commits

Reviewing files that changed from the base of the PR and between 67bff3f and f98c212.

📒 Files selected for processing (1)
  • openevsehttp/__main__.py

📝 Walkthrough

Walkthrough

Modernizes 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

Cohort / File(s) Summary
CI & Packaging
.github/workflows/test.yml, setup.py, tox.ini
Adds Python 3.14 to CI matrix and tox envs; conditions coverage upload to 3.14; bumps python_requires to >=3.13 and updates classifiers.
Pre-commit / Linting
.pre-commit-config.yaml, pyproject.toml, requirements_lint.txt
Replaces black/flake8/isort/pydocstyle/pylint with ruff and ruff-format; updates pre-commit hooks, lint deps, and adds Ruff config in pyproject.toml.
Config removal
pylintrc
Deletes the pylintrc configuration file.
HTTP module typing & refactor
openevsehttp/__main__.py
Adopts 3.10+ union types (e.g., `dict[str, str]
Websocket comment
openevsehttp/websocket.py
Minor comment typo fix ("Negitive" → "Negative").
Examples & docs
example_external_session.py, EXTERNAL_SESSION.md
Docstring wording and whitespace/formatting adjustments; no behavioral changes.
Tests & fixtures
tests/test_main.py, tests/test_websocket.py, tests/fixtures/*, tests/fixtures/v4_json/*, tests/fixtures/websocket.json
Whitespace normalization (EOF newlines, trailing-space removal), small test assignment style change (setattr → attribute assignment), and minor punctuation fixes in tests.
Pre-commit pins
.pre-commit-config.yaml (hooks list changes)
Bumps/changes many hook revisions (codespell, yamllint, pre-commit-hooks) and replaces several hooks with Ruff-based hooks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

code quality

Poem

🐰 I nibble lint with ruffful glee,
CI sprouts carrots, Python three-fourteen,
Types refreshed and whitespace neat,
Docstrings tidy, tests still sweet,
Hop — the codebase feels so clean! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the three main changes: adopting ruff for linting, adding Python 3.14 support, and updating dependencies.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ 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 update-tests

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.

@firstof9 firstof9 marked this pull request as ready for review March 4, 2026 14:21
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
pyproject.toml (1)

1-3: Align Ruff target-version with the project's declared Python minimum.

The target-version = "py310" at line 2 is misaligned with python_requires=">=3.13" declared in setup.py. Since the Ruff config enables the UP (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 openevsehttp and tests, missing setup.py and example_external_session.py at 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

📥 Commits

Reviewing files that changed from the base of the PR and between 40edceb and 8b88ce1.

📒 Files selected for processing (21)
  • .github/workflows/test.yml
  • .pre-commit-config.yaml
  • EXTERNAL_SESSION.md
  • example_external_session.py
  • openevsehttp/__main__.py
  • openevsehttp/websocket.py
  • pylintrc
  • pyproject.toml
  • requirements_lint.txt
  • requirements_test.txt
  • setup.py
  • tests/fixtures/github_v2.json
  • tests/fixtures/github_v4.json
  • tests/fixtures/v4_json/config-new.json
  • tests/fixtures/v4_json/status-broken.json
  • tests/fixtures/v4_json/status-new.json
  • tests/fixtures/v4_json/status.json
  • tests/fixtures/websocket.json
  • tests/test_main.py
  • tests/test_websocket.py
  • tox.ini
💤 Files with no reviewable changes (4)
  • tests/fixtures/github_v2.json
  • tests/fixtures/github_v4.json
  • pylintrc
  • tests/test_websocket.py

@firstof9
Copy link
Owner Author

firstof9 commented Mar 4, 2026

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@firstof9 firstof9 merged commit f7cc8db into main Mar 4, 2026
6 checks passed
@firstof9 firstof9 deleted the update-tests branch March 4, 2026 15:03
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