Skip to content

Conversation

bkis
Copy link

@bkis bkis commented Sep 5, 2025

Related issue: #16.
There already is a PR for supporting Beanie 2.x, but I'd argue that it's missing some important details.

First things first – supporting Beanie 2.x is important because the move they made that caused the major version bump is the right one. I am citing the README from the Motor repo:

As of May 14th, 2025, Motor is deprecated in favor of the GA release of the PyMongo Async API. No new features will be added to Motor, and only bug fixes will be provided until it reaches end of life on May 14th, 2026. After that, only critical bug fixes will be made until final support ends on May 14th, 2027. We strongly recommend migrating to the PyMongo Async API while Motor is still supported. For help transitioning, see the Migrate to PyMongo Async guide: https://www.mongodb.com/docs/languages/python/pymongo-driver/current/reference/migration/>.

That's what Beanie 2.x does.

The problem with the other PR is that it still uses Motor in the tests (see below) and the version range defined for the beanie dependency ("beanie >=1.11.0,<2.1.0") seems to be problematic:

  1. hatch run test fails for beanie >=1.11.0, <=1.19.0 (I realized after writing this PR that this has actually nothing to do with the changes made here – this seems to be an issue that's already present, so it's unrelated, but still important!), so Beanie support should start at 1.20.0. This version didn't contain official stable versions of the asyncronous API yet, but it seems to run just fine.
  2. Increasing the upper bound of the supported Beanie version to < 2.1.0 doesn't seem to make any sense, as breaking changes in versions > 0.x should always come with a major version bump and I'd trust the Beanie community to do so. Therefore, setting the dependency to "beanie >=1.20.0,<3.0.0" seems to be the way to go. BTW beanie 1.20.0 is more than two years old right now, so I don't think we're cutting off any significant amounts of projects, here.

As I mentioned above, the test cases are explicitly using modules from the Motor package which will soon be EOL and Beanie stops using it entirely from v2.x on.

  • stop using Motor
  • adjust supported Beanie versions
  • bump major version (because the previous step is technically a breaking change)

- drop usage of Motor
- adjust supported Beanie versions
- bump major version
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