Skip to content

Commit

Permalink
Fix AnyUrl not being encodable
Browse files Browse the repository at this point in the history
and set compatible pymongo
  • Loading branch information
07pepa committed Nov 28, 2024
1 parent b4244ff commit 9d318f0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/github-actions-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ]
mongodb-version: [4.4, 5.0, 6.0, 7.0, 8.0 ]
pydantic-version: [ "1.10.18", "2.9.2" ]
pydantic-version: [ "1.10.18", "2.10.1" ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions beanie/odm/utils/encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import bson
import pydantic
from pydantic import AnyUrl

import beanie
from beanie.odm.fields import Link, LinkTypes
Expand All @@ -45,6 +46,7 @@
decimal.Decimal: bson.Decimal128,
uuid.UUID: bson.Binary.from_uuid,
re.Pattern: bson.Regex.from_native,
AnyUrl: str,
}
if IS_PYDANTIC_V2:
from pydantic_core import Url
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ classifiers = [
dependencies = [
"pydantic>=1.10.18,<3.0",
"motor>=2.5.0,<4.0.0",
"pymongo<4.10.0",
"click>=7",
"toml",
"lazy-model==0.2.0",
Expand Down

0 comments on commit 9d318f0

Please sign in to comment.