Skip to content

STF-2455: Release 5.4.0 - #558

Open
oschwald wants to merge 4 commits into
mainfrom
greg/release-5.4.0
Open

oschwald wants to merge 4 commits into
mainfrom
greg/release-5.4.0

Conversation

@oschwald

@oschwald oschwald commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Release 5.4.0. The only user-facing change is the higher maxminddb floor. maxminddb 3.3.0 gives geoip2.database.Reader new behavior (a binary file object works in MODE_AUTO), so this is a minor release rather than a patch.

This PR has three commits:

  • Require maxminddb 3.3.0. maxminddb 3.3.0 fixes memory-safety and free-threading bugs in the C extension, and it raises InvalidDatabaseError for more corrupt databases. The commit also:
    • Updates uv.lock.
    • Updates the Reader docstrings to match maxminddb 3.3.0. A binary file object works with MODE_FD or MODE_AUTO, and MODE_MMAP, MODE_FILE, and MODE_MEMORY also accept a file descriptor. The old text said that only MODE_FD takes a file object, and it called that object a file descriptor.
    • Adds a test that opens a file object in MODE_AUTO.
    • Changes the fileish type hint to maxminddb.types.DatabaseSource. maxminddb 3.3.0 narrowed the type that open_database accepts, so mypy rejected our IO[str] annotation. A text file object never worked at runtime.
  • Update the tools in mise.lock. uv 0.13.7 → 0.13.8.
  • Set the release date. If the release happens on a later day, the date needs another commit first, because release.sh checks it.

uv run tox passes locally, including on Python 3.10 to 3.14 and the lint environment.

dev-bin/release.sh sets the version in pyproject.toml, runs tox, and creates the release. The release workflow publishes to PyPI.

Part of STF-2455.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Database readers can open binary file objects in automatic mode, loading their contents into memory.
  • Compatibility
    • The minimum supported maxminddb version is now 3.3.0.
    • Text file objects are not accepted as database sources in automatic or file-descriptor mode.
  • Documentation
    • Clarified supported database sources, including paths, binary file objects, and regular file descriptors, as well as how automatic and file-descriptor modes handle file objects.

Copilot AI balanced review requested due to automatic review settings November 17, 2026 22:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The minimum maxminddb dependency version is now 3.3.0. Reader uses DatabaseSource for its input type. Its documentation and a test cover binary file objects with MODE_AUTO.

Changes: Reader input typing

Layer / File(s) Summary
Update Reader input contract and dependency
pyproject.toml, src/geoip2/database.py, HISTORY.rst
The project version is 5.4.0, and the minimum maxminddb version is 3.3.0. Reader.__init__ uses DatabaseSource. The documentation and release notes describe accepted binary file object inputs.
Test automatic mode with a binary file object
tests/database_test.py
A test opens the City database as a binary file object, performs a lookup in automatic mode, and checks that the country ISO code is GB.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Possibly related PRs

Suggested reviewers: horgh

Merge Risk: Minimal · up to 1432a

This release raises the maxminddb minimum version and clarifies that Reader accepts binary file objects. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "STF-2455: Release 5.4.0" names the release version and ticket. The changeset does prepare the 5.4.0 release: pyproject.toml bumps the version from 5.3.0 to 5.4.0, HISTORY.rst adds the 5.4.0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "STF-2455: Release 5.4.0" names the release version and ticket. The changeset does prepare the 5.4.0 release: pyproject.toml bumps the version from 5.3.0 to 5.4.0, HISTORY.rst adds the 5.4.0 entry, and the maxminddb minimum rises to 3.3.0. The title does not mention the main user-facing change, which is Reader accepting binary file objects in MODE_AUTO. It is still related to the main change, so the title is partially related and passes.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit reads bytes from a file,
Then checks a country with a smile.
In automatic mode, paths pass through,
Binary readers work there too.
A fresh release notes what is new,
While carrots wait in morning dew.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: e27e116c-ac2a-487b-951d-cce98ae98a2a
Commits

Reviewing files that changed from the base of the PR and between 45da970 and 1432a51.

Files ignored due to path filters: 1

  • uv.lock is excluded by !**/*.lock
Files selected for processing: 1

  • pyproject.toml

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

oschwald and others added 3 commits November 17, 2026 22:59
maxminddb 3.3.0 fixes C extension memory-safety and free-threading
bugs, and raises InvalidDatabaseError for more corrupt databases. With
it, geoip2.database.Reader accepts a binary file object in MODE_AUTO,
so the docstring now says so.

3.3.0 also narrows the type of open_database's database argument, so
mypy rejected our IO[str] annotation. Use maxminddb.types.DatabaseSource
instead. A text file object never worked at runtime.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 17, 2026 22:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Copilot AI balanced review requested due to automatic review settings November 17, 2026 23:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch was successfully deployed

1 active deployment
release — 1432a510 Deployed Nov 17, 2026 by oschwald via upload_pypi #876
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants