Skip to content

Conversation

@techouse
Copy link
Owner

@techouse techouse commented Nov 9, 2025

This pull request adds official support for PyPy 3.8–3.11 across the project, updating configuration, documentation, and tests to ensure compatibility. It also makes minor improvements to test reliability and metadata.

PyPy Compatibility and CI Integration

  • Added PyPy 3.8–3.11 environments to the tox.ini configuration and GitHub Actions workflow for automated testing and local development. (tox.ini, .github/workflows/test.yml) [1] [2] [3] [4]
  • Updated documentation (README.rst, docs/index.rst) to reflect support for CPython 3.8–3.14 and PyPy 3.8–3.11. [1] [2]

Metadata and Classifiers

  • Added PyPy as a supported Python implementation and expanded topic classifiers for better discoverability in pyproject.toml.

Test Adjustments for PyPy

  • Modified tests to handle PyPy-specific differences, such as the lack of getsizeof (fallback to len) and explicit gc.collect() calls to ensure weak reference behavior matches CPython. (tests/unit/decode_test.py, tests/unit/weakref_test.py) [1] [2] [3]

Minor Improvements

  • Improved date serialization in test cases to ensure correct handling of naive and timezone-aware datetimes. (tests/unit/example_test.py) [1] [2]

Summary by CodeRabbit

  • New Features

    • Added support for PyPy 3.8–3.11 across CI and test environments
  • Documentation

    • Added Compatibility section documenting supported CPython (3.8–3.14) and PyPy (3.8–3.11) versions
  • Tests

    • Improved test compatibility for PyPy (adjusted size-checking and weakref collection behavior; consistent datetime handling in tests)
  • Chores

    • Updated project metadata with PyPy classifier and CI/tox matrix entries

@techouse techouse self-assigned this Nov 9, 2025
@techouse techouse added the enhancement New feature or request label Nov 9, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 9, 2025

Walkthrough

Adds PyPy 3.8–3.11 support across CI and tox, documents compatibility, updates project classifiers, and tweaks tests for PyPy-specific behaviors (string sizing fallback, gc collection, and naive-datetime normalization).

Changes

Cohort / File(s) Summary
CI & Configuration
​.github/workflows/test.yml, tox.ini
Added PyPy 3.8–3.11 entries to GitHub Actions matrix and new pypy3.8pypy3.11 tox envs with basepython mappings.
Project Metadata
pyproject.toml
Added PyPy implementation classifier and two topic classifiers.
Documentation
README.rst, docs/index.rst
Added Compatibility section describing supported CPython (3.8–3.14) and PyPy (3.8–3.11) and local/CI instructions.
Tests — Memory/Size
tests/unit/decode_test.py
Introduced _approx_size() helper using getsizeof with fallback to len and replaced getsizeof calls to support PyPy environments.
Tests — Datetime encoding
tests/unit/example_test.py
Normalized naive datetime values to UTC prior to timestamp calculation during encode-path tests.
Tests — Weakref cleanup
tests/unit/weakref_test.py
Added gc.collect() calls after deletions to ensure weak references are collected before assertions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Inspect CI matrix and tox basepython mappings for typos or misaligned interpreter names.
  • Verify _approx_size() covers edge cases and doesn't change test semantics on CPython.
  • Confirm naive-datetime-to-UTC normalization matches intended test expectations.
  • Ensure gc.collect() calls are necessary and don't mask issues.

Possibly related PRs

Suggested labels

python

Poem

🐰 PyPy hops into the warren,
New tox beds, CI lights a-glow,
Size fallbacks, gc nudged to clear,
Naive times set to UTC slow,
Tests hop onward — carrots in tow.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'add PyPy support' clearly and concisely summarizes the main change in the PR—adding PyPy 3.8–3.11 support. The emoji is decorative and doesn't obscure the message.
Description check ✅ Passed The PR description comprehensively covers all major changes (CI, documentation, metadata, and tests). While it lacks some template checklist items, it provides excellent context and structure appropriate for the changeset scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/pypy

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0576856 and 44572d8.

📒 Files selected for processing (2)
  • tests/unit/decode_test.py (1 hunks)
  • tests/unit/example_test.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/unit/example_test.py
🧰 Additional context used
📓 Path-based instructions (3)
{src,tests}/**/*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

{src,tests}/**/*.py: Keep docstrings descriptive and parity-focused; match the existing module docstring style
Maintain 120-character line length (Black) and isort import ordering (black profile)

Files:

  • tests/unit/decode_test.py
tests/unit/**/*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Add regression tests for limits (depth, list_limit, parameter_limit), duplicate policies, charset sentinel interactions, dot-notation toggles, and comma round-trip

Files:

  • tests/unit/decode_test.py
{src/qs_codec/enums/**/*.py,tests/unit/**/*.py}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

For new list or formatting strategies, add an Enum member with associated generator/formatter and tests to cover serialization/deserialization round-trip

Files:

  • tests/unit/decode_test.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Test (pypy3.8, pypy-3.8)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (2)
tests/unit/decode_test.py (2)

657-662: LGTM! Clean PyPy compatibility solution.

The fallback from getsizeof to len is well-implemented with appropriate exception handling and clear documentation. For ASCII payloads in this test, len provides a reasonable approximation of memory size.


664-664: Correct usage of the compatibility helper.

The change preserves the test's behavior while enabling PyPy compatibility. The approximate size check is sufficient for verifying that the parser handles large buffers without crashing.


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.

@codacy-production
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (8b5a36d) 1162 1162 100.00%
Head commit (0576856) 1162 (+0) 1162 (+0) 100.00% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#33) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@codacy-production
Copy link

codacy-production bot commented Nov 9, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (8b5a36d) 1162 1162 100.00%
Head commit (44572d8) 1162 (+0) 1162 (+0) 100.00% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#33) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@codecov
Copy link

codecov bot commented Nov 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (8b5a36d) to head (44572d8).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #33   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           16        16           
  Lines         1162      1162           
=========================================
  Hits          1162      1162           

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

@techouse techouse merged commit 52352da into main Nov 9, 2025
23 checks passed
@techouse techouse deleted the feat/pypy branch November 9, 2025 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants