Skip to content

Commit 0f34f85

Browse files
authored
Merge pull request #88 from cuenca-mx/update/py3-13-deps
Update/py3 13 deps
2 parents b8c5874 + d7184bb commit 0f34f85

File tree

11 files changed

+53
-44
lines changed

11 files changed

+53
-44
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
permissions:
1515
id-token: write
1616
steps:
17-
- uses: actions/checkout@master
18-
- name: Set up Python 3.8
19-
uses: actions/setup-python@v2.2.2
17+
- uses: actions/checkout@v4
18+
- name: Set up Python 3.13
19+
uses: actions/setup-python@v5
2020
with:
21-
python-version: 3.8
21+
python-version: 3.13
2222
- name: Install dependencies
2323
run: pip install -qU setuptools wheel twine
2424
- name: Generating distribution archives

.github/workflows/test.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ jobs:
66
lint:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v4
1010
- name: Set up Python
11-
uses: actions/setup-python@v2.2.2
11+
uses: actions/setup-python@v5
1212
with:
13-
python-version: 3.8
13+
python-version: 3.13
1414
- name: Install dependencies
1515
run: make install-test
1616
- name: Lint
@@ -20,11 +20,11 @@ jobs:
2020
runs-on: ubuntu-latest
2121
strategy:
2222
matrix:
23-
python-version: [3.8]
23+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
2424
steps:
25-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v4
2626
- name: Set up Python ${{ matrix.python-version }}
27-
uses: actions/setup-python@v2.2.2
27+
uses: actions/setup-python@v5
2828
with:
2929
python-version: ${{ matrix.python-version }}
3030
- name: Install dependencies
@@ -38,11 +38,11 @@ jobs:
3838
coverage:
3939
runs-on: ubuntu-latest
4040
steps:
41-
- uses: actions/checkout@master
41+
- uses: actions/checkout@v4
4242
- name: Setup Python
43-
uses: actions/setup-python@v2.2.2
43+
uses: actions/setup-python@v5
4444
with:
45-
python-version: 3.8
45+
python-version: 3.13
4646
- name: Install dependencies
4747
run: make install-test
4848
- name: Generate coverage report
@@ -51,9 +51,9 @@ jobs:
5151
export SSL_CERT_FILE=$(pwd)/tests/localhost.crt
5252
pytest --cov-report=xml
5353
- name: Upload coverage to Codecov
54-
uses: codecov/codecov-action@v1.5.0
54+
uses: codecov/codecov-action@v5
5555
with:
56-
token: 1455e721-304d-43a9-b346-bcdacfac6631
56+
token: ${{ secrets.CODECOV_TOKEN }}
5757
file: ./coverage.xml
5858
flags: unittests
5959
name: codecov-umbrella

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
SHELL := bash
22
PATH := ./venv/bin:${PATH}
3-
PYTHON = python3.8
3+
PYTHON = python3.13
44
PROJECT = mongoengine_plus
55
isort = isort $(PROJECT) tests setup.py
6-
black = black -S -l 79 --target-version py38 $(PROJECT) tests setup.py
6+
black = black -S -l 79 --target-version py313 $(PROJECT) tests setup.py
77

88

99
venv:

mongoengine_plus/types/encrypted_string/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def cache_kms_data_key(
4444
content = (
4545
'{'
4646
'"EncryptionAlgorithm":"SYMMETRIC_DEFAULT",'
47-
f'"Plaintext":"{decrypted_data_key}"'
47+
f'"Plaintext": "{decrypted_data_key}"'
4848
'}'
4949
)
5050

mongoengine_plus/types/enum_field.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from enum import Enum
2-
from typing import Type
2+
from typing import Any, Type, Union
33

44
from mongoengine.base import BaseField
55

@@ -18,7 +18,7 @@ def __init__(self, enum: Type[Enum], *args, **kwargs):
1818
kwargs['choices'] = [choice for choice in enum]
1919
super(EnumField, self).__init__(*args, **kwargs)
2020

21-
def __get_value(self, enum: Enum) -> str:
21+
def __get_value(self, enum: Enum) -> Union[str, Any]:
2222
return enum.value if hasattr(enum, 'value') else enum
2323

2424
def to_python(self, value: Enum) -> Enum: # pragma: no cover

mongoengine_plus/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.2.2'
1+
__version__ = '1.0.0'

requirements-test.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
black==22.3.0
2-
flake8==3.9.*
3-
isort==5.8.*
4-
mypy==0.812
5-
moto[server,kms]==5.0.8
6-
pytest==6.2.*
7-
pytest-asyncio==0.15.1
8-
pytest-cov==2.12.*
9-
pytest-freezegun==0.4.*
10-
testcontainers==3.7.1
1+
black==24.10.0
2+
flake8==7.1.1
3+
isort==5.13.2
4+
mypy==1.14.1
5+
moto[server,kms]==5.0.26
6+
pytest==8.3.4
7+
pytest-asyncio==0.25.2
8+
pytest-cov==6.0.0
9+
pytest-freezegun==0.4.2
10+
testcontainers==4.9.0

requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
blinker==1.8.2
2-
dnspython==2.1.0
3-
mongoengine==0.27.0
1+
blinker==1.9.0
2+
dnspython==2.7.0
3+
mongoengine==0.29.1
44
pymongo==3.13.0
5-
pymongocrypt==1.9.2
6-
boto3==1.34.106
5+
pymongocrypt==1.12.2
6+
boto3==1.35.95

setup.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,20 @@
2323
packages=find_packages(),
2424
include_package_data=True,
2525
package_data=dict(mongoengine_plus=['py.typed']),
26-
python_requires='>=3.8',
26+
python_requires='>=3.9',
2727
install_requires=[
28-
'mongoengine>=0.20.0',
29-
'dnspython>=2.0.0,<2.2.0',
30-
'pymongo>=3.11.0,<4.0.0',
31-
'pymongocrypt>=1.9.2,<2.0.0',
32-
'boto3>=1.34.106',
28+
'mongoengine>=0.29.1',
29+
'dnspython>=2.7.0',
30+
'pymongo>=3.13.0,<4.0.0',
31+
'pymongocrypt>=1.12.2,<2.0.0',
32+
'boto3>=1.34.106,<1.35.96',
3333
],
3434
classifiers=[
35-
'Programming Language :: Python :: 3.8',
35+
'Programming Language :: Python :: 3.9',
36+
'Programming Language :: Python :: 3.10',
37+
'Programming Language :: Python :: 3.11',
38+
'Programming Language :: Python :: 3.12',
39+
'Programming Language :: Python :: 3.13',
3640
'License :: OSI Approved :: MIT License',
3741
'Operating System :: OS Independent',
3842
],

tests/models/test_helpers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,8 @@ def test_mongo_to_dict():
103103
'lastname': 'other',
104104
}
105105
assert model_dict['code'] == 0
106+
107+
108+
def test_mongo_to_dict_with_none():
109+
result = mongo_to_dict(None)
110+
assert result == {}

0 commit comments

Comments
 (0)