Skip to content

Commit

Permalink
pydantic versions matrix (#71)
Browse files Browse the repository at this point in the history
* pydantic version ^1.5
  • Loading branch information
roman-right authored Jun 21, 2021
1 parent 19d5f85 commit 51f1533
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/github-actions-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
python-version: [ 3.6, 3.7, 3.8, 3.9 ]
poetry-version: [ 1.1.4 ]
mongodb-version: [ 4.4 ]
pydantic-version: [1.5, 1.6, 1.7, 1.8]
os: [ ubuntu-18.04 ]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -27,5 +28,7 @@ jobs:
poetry-version: ${{ matrix.poetry-version }}
- name: poetry install
run: poetry install
- name: specify pydantic
run: poetry add pydantic==${{ matrix.pydantic-version }}
- name: run tests
run: bash scripts/run_tests.sh
2 changes: 1 addition & 1 deletion beanie/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from beanie.odm.utils.general import init_beanie
from beanie.odm.documents import Document

__version__ = "1.1.5"
__version__ = "1.1.6"
__all__ = [
# ODM
"Document",
Expand Down
14 changes: 4 additions & 10 deletions beanie/migrations/runner.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import importlib.util
import importlib.abc
import logging
from importlib.machinery import SourceFileLoader
from pathlib import Path
from typing import Type, Optional

Expand Down Expand Up @@ -178,14 +177,9 @@ async def build(cls, path: Path):
prev_migration_node = root_migration_node

for name in names:
spec = importlib.util.spec_from_file_location(
(path / name).stem, (path / name).absolute()
)
assert spec is not None
module = importlib.util.module_from_spec(spec)
# Comford mypy that the loader has been returned correctly
assert isinstance(spec.loader, importlib.abc.Loader)
spec.loader.exec_module(module)
module = SourceFileLoader(
(path / name).stem, str((path / name).absolute())
).load_module()
forward_class = getattr(module, "Forward", None)
backward_class = getattr(module, "Backward", None)
migration_node = MigrationNode(
Expand Down
14 changes: 13 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

Beanie project changes

## [1.1.6] - 2021-06-21

### Fix

- Pydantic dependency version ^1.5

### Implementation

- PR - <https://github.com/roman-right/beanie/pull/71>

## [1.1.5] - 2021-06-17

### Fix
Expand Down Expand Up @@ -299,4 +309,6 @@ Beanie project changes

[1.1.4]: https://pypi.org/project/beanie/1.1.4

[1.1.5]: https://pypi.org/project/beanie/1.1.5
[1.1.5]: https://pypi.org/project/beanie/1.1.5

[1.1.6]: https://pypi.org/project/beanie/1.1.6
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "beanie"
version = "1.1.5"
version = "1.1.6"
description = "Asynchronous Python ODM for MongoDB"
authors = ["Roman <[email protected]>"]
license = "Apache-2.0"
Expand All @@ -14,7 +14,7 @@ readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.6.1,<4.0"
pydantic = "^1.8"
pydantic = "^1.5"
motor = "^2.1.0"
click = "^7.1.2"
toml = "^0.10.2"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_beanie.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


def test_version():
assert __version__ == "1.1.5"
assert __version__ == "1.1.6"

0 comments on commit 51f1533

Please sign in to comment.