Skip to content

Conversation

@techouse
Copy link
Owner

@techouse techouse commented Nov 10, 2025

This pull request expands Python version support and updates documentation, packaging, and tests to reflect these changes. It also adds new test cases and improves development dependencies. The most significant changes are grouped below.

Python Version Support and CI:

  • Added support for CPython 3.8–3.14 and PyPy 3.8–3.11 in the codebase, packaging metadata, documentation, and CI workflows (.github/workflows/test.yml, tox.ini, pyproject.toml, README.rst, docs/index.rst, CONTRIBUTING.md). [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Documentation and Metadata Improvements:

  • Updated project requirements and classifiers for new Python versions, added topics to classifiers, and bumped the development status to Beta in pyproject.toml.
  • Updated requirements and installation sections in README.rst and docs/index.rst to reflect new Python support. [1] [2]
  • Clarified supported Python versions in CONTRIBUTING.md.

Dependency Updates:

  • Updated minimum versions for qs-codec, pytest, pytest-cov, and mypy in pyproject.toml and requirements_dev.txt. [1] [2]

Testing Enhancements:

  • Added new test cases to tests/unit/test_merge_query.py and tests/unit/test_transport.py to cover string policy values, unchanged URLs, and custom encode options. [1] [2]
  • Added testenv:docs to tox.ini for building documentation with Sphinx.

Tooling:

  • Updated tool.black and tool.mypy configurations for Python 3.8 compatibility in pyproject.toml. [1] [2]

These changes ensure broader compatibility, improved documentation, and better test coverage for the project.

Summary by CodeRabbit

  • Documentation

    • Added Requirements section specifying supported Python versions (3.8–3.14) and dependencies.
  • Tests

    • Expanded test matrix to cover Python 3.8, 3.14, and PyPy 3.8–3.11.
    • Added new test coverage for policy parameters and custom encoding options.
  • Chores

    • Lowered minimum Python requirement to 3.8 (from 3.9).
    • Updated dependency versions for qs-codec, pytest, pytest-cov, and mypy.

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

coderabbitai bot commented Nov 10, 2025

Walkthrough

This PR expands Python version support to CPython 3.8–3.14 and PyPy 3.8–3.11, updates development dependencies, adds Requirements documentation, introduces a Sphinx docs build testenv, and adds new unit tests for policy parameter string handling in query merging and transport operations.

Changes

Cohort / File(s) Summary
CI & Test Configuration
.github/workflows/test.yml, tox.ini
Extended test matrix to include Python 3.8, 3.14, and PyPy 3.8–3.11. Added new [testenv:docs] section in tox.ini for Sphinx documentation builds. Updated GitHub Actions mappings for new Python/PyPy variants.
Documentation
README.rst, docs/index.rst, CONTRIBUTING.md
Added Requirements section documenting supported Python versions (CPython 3.8–3.14, PyPy 3.8–3.11) and dependencies. Minor formatting and wording adjustments in CONTRIBUTING.md.
Project Configuration
pyproject.toml, requirements_dev.txt
Lowered minimum Python requirement from 3.9 to 3.8. Updated Python classifiers and added PyPy classifier. Bumped qs-codec from >=1.2.3 to >=1.3.1. Adjusted development dependencies (pytest, pytest-cov, mypy) and Black/mypy tool configurations.
Unit Tests
tests/unit/test_merge_query.py, tests/unit/test_transport.py
Added test for merge_query with string policy value. Added tests for string policy in extra_query_params, unchanged URLs without extra params, and custom EncodeOptions application. New imports for EncodeOptions and ListFormat.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Version consistency: Verify Python version ranges are consistent across all config files (tox.ini, pyproject.toml, .github/workflows, documentation)
  • Dependency updates: Review intentionality of qs-codec, pytest, pytest-cov, and mypy version downgrades; ensure compatibility
  • New tests: Confirm test logic correctly validates string policy parameter handling and encoding options application
  • Documentation accuracy: Ensure Requirements sections precisely reflect supported versions and dependency constraints

🐰 A rabbit's leap through versions!
From 3.8 to 3.14, we test it all,
PyPy joins the thumping hall,
Dependencies updated with care,
New tests hop through string and pair,
Documentation blooms so fair! 🌿✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive The description is well-structured with detailed sections covering Python version support, documentation improvements, dependency updates, testing enhancements, and tooling changes. However, the required template sections (Type of change, How Has This Been Tested, Checklist) are not filled out. Complete the pull request template by checking relevant change type options, describing test coverage, and confirming the checklist items have been addressed.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'widen Python support' clearly and concisely describes the main change—expanding Python version support. It is specific enough to convey the primary objective.
✨ 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 chore/widen-python-support

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

codacy-production bot commented Nov 10, 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 (d26cef6) 54 54 100.00%
Head commit (5066018) 54 (+0) 54 (+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 (#1) 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 10, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d26cef6 and 5066018.

📒 Files selected for processing (9)
  • .github/workflows/test.yml (3 hunks)
  • CONTRIBUTING.md (2 hunks)
  • README.rst (1 hunks)
  • docs/index.rst (1 hunks)
  • pyproject.toml (5 hunks)
  • requirements_dev.txt (1 hunks)
  • tests/unit/test_merge_query.py (1 hunks)
  • tests/unit/test_transport.py (2 hunks)
  • tox.ini (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
tests/unit/test_merge_query.py (1)
src/httpx_qs/utils/merge_query.py (1)
  • merge_query (35-84)
⏰ 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). (5)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Test (pypy3.11, pypy3.11)
  • GitHub Check: Test (pypy3.10, pypy3.10)
  • GitHub Check: Test (pypy3.8, pypy3.8)
  • GitHub Check: Test (pypy3.9, pypy3.9)
🔇 Additional comments (16)
tests/unit/test_merge_query.py (1)

42-44: LGTM! Good test coverage for string policy values.

This test correctly verifies that merge_query accepts string policy values (e.g., "replace"), complementing the existing parametrized tests that use MergePolicy enum values. The assertion properly validates the replace behavior.

CONTRIBUTING.md (1)

14-16: Clear documentation of expanded Python support.

The updated version support policy clearly communicates the CPython 3.8–3.14 and PyPy 3.8–3.11 range, and appropriately invites users to report issues with unsupported PyPy builds.

tests/unit/test_transport.py (2)

3-3: LGTM! Necessary imports for new test functionality.

The new imports support the added test cases for custom encoding options.


77-108: Excellent test coverage additions.

These three new tests effectively cover:

  • String-based policy values ("replace") for consistent API ergonomics
  • Baseline behavior when no extra params are provided
  • Custom EncodeOptions application with ListFormat.BRACKETS producing URL-encoded bracket syntax

All tests follow established patterns and include clear assertions.

docs/index.rst (1)

94-99: Well-placed Requirements documentation.

The new Requirements section clearly documents supported Python versions and dependency constraints, helping users verify compatibility before installation.

README.rst (1)

94-99: LGTM! Consistent requirements documentation.

This Requirements section matches the documentation in docs/index.rst, ensuring consistent information across user-facing docs.

tox.ini (3)

4-14: Well-structured environment expansion.

The envlist correctly includes Python 3.8, 3.14, and PyPy 3.8–3.11 variants, aligning with the project's expanded version support goals.


22-32: Correct gh-actions mappings.

The GitHub Actions mappings properly associate each Python version with its corresponding tox environment, ensuring CI matrix entries trigger the right test environments.


94-99: Useful docs testenv addition.

The new [testenv:docs] environment enables validation of Sphinx documentation builds, which is valuable for catching documentation build errors early.

.github/workflows/test.yml (1)

45-66: Comprehensive test matrix expansion.

The CI matrix now covers Python 3.8, 3.14, and PyPy 3.8–3.11, ensuring the expanded version support is thoroughly tested. The matrix entries follow the established format and correctly align with the tox.ini configuration.

requirements_dev.txt (1)

2-5: Clarify the pytest version downgrade from 8.3.5 to 8.1.2.

The changes are justified for Python 3.8 compatibility:

  • pytest-cov>=5.0.0 (downgrade from 6.0.0): pytest-cov 6.0.0 requires >=3.9 while 5.0.0 requires >=3.8, maintaining Python 3.8 support ✓
  • mypy>=1.10.0 (downgrade from 1.15.0): mypy 1.15.0 requires >=3.9 while 1.10.0 requires >=3.8, maintaining Python 3.8 support ✓
  • qs-codec>=1.3.1 (upgrade) ✓

However, both pytest 8.1.2 and 8.3.5 support >=3.8, so the downgrade to 8.1.2 is not driven by Python version constraints. Please confirm whether this is intentional or if 8.3.5 (or later) should be used instead.

pyproject.toml (5)

11-11: ✓ Python minimum version correctly set to 3.8.

Aligns with PR objective to support Python 3.8–3.14 and PyPy 3.8–3.11.

Also applies to: 11-11


20-45: ✓ Classifiers comprehensively updated for expanded version support.

Added Python 3.8, 3.14, PyPy implementation, and relevant topic classifiers (CGI Tools/Libraries, Python Modules, Text Processing, Utilities). Development status upgraded to Beta. All changes align with the PR objective.


92-92: ✓ Black target-version correctly expanded for 3.8–3.14 coverage.

Configuration now includes py38 through py314, ensuring consistent code formatting across the entire supported Python range.

Also applies to: 92-92


130-130: ✓ MyPy python_version set to minimum supported version.

Setting python_version to 3.8 ensures type checking is performed against the minimum supported Python version, which is a best practice for broad version support.

Also applies to: 130-130


48-48: No compatibility issues found.

qs-codec 1.3.1 supports CPython 3.8, confirming the version bump from >=1.2.3 to >=1.3.1 is compatible with the minimum Python version.

@techouse techouse merged commit b6997ec into main Nov 10, 2025
20 of 21 checks passed
@techouse techouse deleted the chore/widen-python-support branch November 10, 2025 23:03
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