Skip to content

Commit a2b791d

Browse files
Support Marshmallow 4, add Python 3.13, 3.14 and pypy-3.11 to CI, remove 3.8 (#93)
1 parent f2583d0 commit a2b791d

File tree

7 files changed

+27
-20
lines changed

7 files changed

+27
-20
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
strategy:
2323
matrix:
2424
os: [ubuntu-latest, macos-latest, windows-latest]
25-
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
25+
python: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14', 'pypy-3.11']
2626
fail-fast: false
2727
runs-on: ${{ matrix.os }}
2828
steps:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,6 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
131+
mise.toml
132+
requirements*.txt

examples/app.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ class UserSchema(ma.Schema):
2323
class Meta:
2424
description = 'This schema represents a user'
2525

26-
id = ma.String(dump_only=True, description="The user's id")
27-
username = ma.String(required=True, description="The user's username")
28-
first_name = ma.String(description="The user's first name")
29-
last_name = ma.String(description="The user's last name")
30-
age = ma.Integer(description="The user's age")
31-
password = ma.String(load_only=True, description="The user's password")
26+
id = ma.String(dump_only=True, metadata={"description": "The user's id"})
27+
username = ma.String(required=True, metadata={"description": "The user's username"})
28+
first_name = ma.String(metadata={"description": "The user's first name"})
29+
last_name = ma.String(metadata={"description": "The user's last name"})
30+
age = ma.Integer(metadata={"description": "The user's age"})
31+
password = ma.String(load_only=True, metadata={"description": "The user's password"})
3232

3333

3434
@app.get('/users')

examples/app_with_class_views.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ class UserSchema(ma.Schema):
2525
class Meta:
2626
description = 'This schema represents a user'
2727

28-
id = ma.String(dump_only=True, description="The user's id")
29-
username = ma.String(required=True, description="The user's username")
30-
first_name = ma.String(description="The user's first name")
31-
last_name = ma.String(description="The user's last name")
32-
age = ma.Integer(description="The user's age")
33-
password = ma.String(load_only=True, description="The user's password")
28+
id = ma.String(dump_only=True, metadata={"description": "The user's id"})
29+
username = ma.String(required=True, metadata={"description": "The user's username"})
30+
first_name = ma.String(metadata={"description": "The user's first name"})
31+
last_name = ma.String(metadata={"description": "The user's last name"})
32+
age = ma.Integer(metadata={"description": "The user's age"})
33+
password = ma.String(load_only=True, metadata={"description": "The user's password"})
3434

3535

3636
class GetUsersEndpoint(MethodView):

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ classifiers = [
1111
"License :: OSI Approved :: MIT License",
1212
"Operating System :: OS Independent",
1313
]
14-
requires-python = ">=3.6"
14+
requires-python = ">=3.9"
1515
dependencies = [
1616
"flask >= 1.1.0",
1717
"flask-marshmallow",
@@ -32,6 +32,9 @@ Homepage = "https://github.com/miguelgrinberg/apifairy"
3232
docs = [
3333
"sphinx",
3434
]
35+
dev = [
36+
"tox",
37+
]
3538

3639
[tool.setuptools]
3740
zip-safe = false

tests/test_apifairy.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,25 @@ class Schema(ma.Schema):
2323
class Meta:
2424
unknown = EXCLUDE
2525

26-
id = ma.Integer(default=123)
26+
id = ma.Integer(dump_default=123)
2727
name = ma.Str(required=True)
2828

2929

3030
class Schema2(ma.Schema):
3131
class Meta:
3232
unknown = EXCLUDE
3333

34-
id2 = ma.Integer(default=123)
34+
id2 = ma.Integer(dump_default=123)
3535
name2 = ma.Str(required=True)
3636

3737

3838
class FooSchema(ma.Schema):
39-
id = ma.Integer(default=123)
39+
id = ma.Integer(dump_default=123)
4040
name = ma.Str()
4141

4242

4343
class QuerySchema(ma.Schema):
44-
id = ma.Integer(missing=1)
44+
id = ma.Integer(load_default=1)
4545

4646

4747
class FormSchema(ma.Schema):

tox.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
[tox]
2-
envlist=flake8,py38,py39,py310,py311,py312,pypy3,docs
2+
envlist=flake8,py39,py310,py311,py312,py313,py314,pypy3,docs
33
skip_missing_interpreters=True
44

55
[gh-actions]
66
python =
7-
3.8: py38
87
3.9: py39
98
3.10: py310
109
3.11: py311
1110
3.12: py312
11+
3.13: py313
12+
3.14: py314
1213
pypy-3: pypy3
1314

1415
[testenv]

0 commit comments

Comments
 (0)