Skip to content

Add Python 3.14 support and improve coverage#6

Merged
oleksandr-nc merged 4 commits into
mainfrom
feature/p2-python314-coverage
Mar 24, 2026
Merged

Add Python 3.14 support and improve coverage#6
oleksandr-nc merged 4 commits into
mainfrom
feature/p2-python314-coverage

Conversation

@bigcat88
Copy link
Copy Markdown
Contributor

@bigcat88 bigcat88 commented Mar 24, 2026

Summary

  • Add Python 3.14 to unit test matrix
  • Add Python version badge to README
  • (More commits coming to improve code coverage based on Codecov results)

Test plan

  • CI passes on Python 3.12, 3.13, 3.14
  • Coverage reports upload successfully
  • Improve coverage based on Codecov gaps

Summary by CodeRabbit

  • Documentation

    • Added Python version compatibility badge indicating support for Python 3.12–3.14.
  • Chores

    • Expanded CI test matrix to include Python 3.14.
    • Updated Codecov reporting to evaluate status after 5 builds.
    • Updated packaging/configuration and refreshed formatter pin.
  • Tests

    • Added integration test exercising env-var driven configuration.
    • Added poll close response test verifying voter details.
    • Added state initialization validation tests.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.40%. Comparing base (d609c89) to head (7e212f8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #6      +/-   ##
==========================================
+ Coverage   95.34%   96.40%   +1.05%     
==========================================
  Files          11       11              
  Lines         473      473              
==========================================
+ Hits          451      456       +5     
+ Misses         22       17       -5     
Flag Coverage Δ
integration 94.29% <ø> (+2.32%) ⬆️
nc32 94.29% <ø> (+2.32%) ⬆️
nc33 94.29% <ø> (+2.32%) ⬆️
py3.12 22.83% <ø> (+8.03%) ⬆️
py3.13 22.83% <ø> (+8.03%) ⬆️
py3.14 22.83% <ø> (?)
unit 22.83% <ø> (+8.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 24, 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: 748bf5e1-be4f-45e8-8e94-d96ba10c9a2e

📥 Commits

Reviewing files that changed from the base of the PR and between 61166b7 and 7e212f8.

📒 Files selected for processing (2)
  • .pre-commit-config.yaml
  • pyproject.toml
✅ Files skipped from review due to trivial changes (1)
  • .pre-commit-config.yaml

📝 Walkthrough

Walkthrough

Expanded CI/testing to include Python 3.14, added Codecov status configuration, updated packaging/pytest metadata, bumped a pre-commit hook, and added several new tests (integration and state unit tests); README badge updated to show Python 3.12–3.14.

Changes

Cohort / File(s) Summary
CI Workflows & Coverage
.github/workflows/tests-unit.yml, codecov.yml
Added Python 3.14 to the unit test matrix; added Codecov status for project and patch with after_n_builds: 5.
Documentation
README.md
Added Python compatibility badge showing 3.12–3.14.
Packaging & Tooling
pyproject.toml, .pre-commit-config.yaml
Added Python 3.14 to classifiers, moved/adjusted pytest and setuptools config table keys, and updated pyproject-fmt hook pin.
Integration Tests
tests/integration/test_server.py, tests/integration/test_talk_polls.py
Added env-driven server initialization integration test and a poll-close test that asserts voter details are included for public-result polls.
Unit Tests (state)
tests/test_state.py
New tests asserting get_client()/get_config() raise RuntimeError when module state is uninitialized.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • oleksandr-nc

Poem

🐰 A rabbit hops, nose in the grass,
Python versions tall as blades that pass,
Tests awaken, coverage hums bright,
State and polls snug in the night. 🥕✨

🚥 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 accurately summarizes the two main objectives: adding Python 3.14 support (reflected in the workflow matrix, README badge, and pyproject.toml changes) and improving coverage (reflected in the codecov.yml configuration and new test coverage additions).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/p2-python314-coverage

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.

@oleksandr-nc oleksandr-nc marked this pull request as ready for review March 24, 2026 08:30
Copy link
Copy Markdown

@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 (1)
tests/integration/test_talk_polls.py (1)

373-376: Avoid order-coupled assertion on voter details.

At Line 376, indexing details[0] assumes stable ordering. This can make the test flaky if the API returns the same entries in a different order.

Suggested test hardening
-            assert poll["details"][0]["actorId"] == "admin"
+            assert any(d.get("actorId") == "admin" for d in poll["details"])
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/integration/test_talk_polls.py` around lines 373 - 376, The test
currently assumes a stable order by asserting poll["details"][0]["actorId"] ==
"admin"; change this to a order-agnostic check by verifying that poll contains a
"details" list and that at least one element in poll["details"] has actorId ==
"admin" (e.g., replace the index-based assertion with an any(...) style check
over poll["details"]). This targets the assertions around poll and its "details"
list to avoid flakiness when ordering changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/tests-unit.yml:
- Line 15: The package classifiers in pyproject.toml are missing Python 3.14
even though CI runs tests on 3.14; update the "classifiers" list in
pyproject.toml (the "Programming Language :: Python ::" entries) to include
"Programming Language :: Python :: 3.14" alongside the existing 3.12 and 3.13
entries so the declared supported Python versions match the CI-tested versions.

---

Nitpick comments:
In `@tests/integration/test_talk_polls.py`:
- Around line 373-376: The test currently assumes a stable order by asserting
poll["details"][0]["actorId"] == "admin"; change this to a order-agnostic check
by verifying that poll contains a "details" list and that at least one element
in poll["details"] has actorId == "admin" (e.g., replace the index-based
assertion with an any(...) style check over poll["details"]). This targets the
assertions around poll and its "details" list to avoid flakiness when ordering
changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b88b42e5-c760-4e83-8a1c-7bfdaa4123bc

📥 Commits

Reviewing files that changed from the base of the PR and between d609c89 and 61166b7.

📒 Files selected for processing (6)
  • .github/workflows/tests-unit.yml
  • README.md
  • codecov.yml
  • tests/integration/test_server.py
  • tests/integration/test_talk_polls.py
  • tests/test_state.py

Comment thread .github/workflows/tests-unit.yml
@oleksandr-nc oleksandr-nc merged commit 7461b43 into main Mar 24, 2026
9 checks passed
@oleksandr-nc oleksandr-nc deleted the feature/p2-python314-coverage branch March 24, 2026 09:23
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.

2 participants