diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8a527a1..2839db5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,7 +22,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14', 'pypy-3.11'] fail-fast: false runs-on: ${{ matrix.os }} steps: diff --git a/.gitignore b/.gitignore index b6e4761..ce75252 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,6 @@ dmypy.json # Pyre type checker .pyre/ + +mise.toml +requirements*.txt diff --git a/examples/app.py b/examples/app.py index 5726ced..ebfaf57 100644 --- a/examples/app.py +++ b/examples/app.py @@ -23,12 +23,12 @@ class UserSchema(ma.Schema): class Meta: description = 'This schema represents a user' - id = ma.String(dump_only=True, description="The user's id") - username = ma.String(required=True, description="The user's username") - first_name = ma.String(description="The user's first name") - last_name = ma.String(description="The user's last name") - age = ma.Integer(description="The user's age") - password = ma.String(load_only=True, description="The user's password") + id = ma.String(dump_only=True, metadata={"description": "The user's id"}) + username = ma.String(required=True, metadata={"description": "The user's username"}) + first_name = ma.String(metadata={"description": "The user's first name"}) + last_name = ma.String(metadata={"description": "The user's last name"}) + age = ma.Integer(metadata={"description": "The user's age"}) + password = ma.String(load_only=True, metadata={"description": "The user's password"}) @app.get('/users') diff --git a/examples/app_with_class_views.py b/examples/app_with_class_views.py index 87c9350..4faf867 100644 --- a/examples/app_with_class_views.py +++ b/examples/app_with_class_views.py @@ -25,12 +25,12 @@ class UserSchema(ma.Schema): class Meta: description = 'This schema represents a user' - id = ma.String(dump_only=True, description="The user's id") - username = ma.String(required=True, description="The user's username") - first_name = ma.String(description="The user's first name") - last_name = ma.String(description="The user's last name") - age = ma.Integer(description="The user's age") - password = ma.String(load_only=True, description="The user's password") + id = ma.String(dump_only=True, metadata={"description": "The user's id"}) + username = ma.String(required=True, metadata={"description": "The user's username"}) + first_name = ma.String(metadata={"description": "The user's first name"}) + last_name = ma.String(metadata={"description": "The user's last name"}) + age = ma.Integer(metadata={"description": "The user's age"}) + password = ma.String(load_only=True, metadata={"description": "The user's password"}) class GetUsersEndpoint(MethodView): diff --git a/pyproject.toml b/pyproject.toml index a2d5a79..1aa1937 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ] -requires-python = ">=3.6" +requires-python = ">=3.9" dependencies = [ "flask >= 1.1.0", "flask-marshmallow", @@ -32,6 +32,9 @@ Homepage = "https://github.com/miguelgrinberg/apifairy" docs = [ "sphinx", ] +dev = [ + "tox", +] [tool.setuptools] zip-safe = false diff --git a/tests/test_apifairy.py b/tests/test_apifairy.py index ec1d8f1..238dbbb 100644 --- a/tests/test_apifairy.py +++ b/tests/test_apifairy.py @@ -23,7 +23,7 @@ class Schema(ma.Schema): class Meta: unknown = EXCLUDE - id = ma.Integer(default=123) + id = ma.Integer(dump_default=123) name = ma.Str(required=True) @@ -31,17 +31,17 @@ class Schema2(ma.Schema): class Meta: unknown = EXCLUDE - id2 = ma.Integer(default=123) + id2 = ma.Integer(dump_default=123) name2 = ma.Str(required=True) class FooSchema(ma.Schema): - id = ma.Integer(default=123) + id = ma.Integer(dump_default=123) name = ma.Str() class QuerySchema(ma.Schema): - id = ma.Integer(missing=1) + id = ma.Integer(load_default=1) class FormSchema(ma.Schema): diff --git a/tox.ini b/tox.ini index 2c2834d..cceb75d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,14 +1,15 @@ [tox] -envlist=flake8,py38,py39,py310,py311,py312,pypy3,docs +envlist=flake8,py39,py310,py311,py312,py313,py314,pypy3,docs skip_missing_interpreters=True [gh-actions] python = - 3.8: py38 3.9: py39 3.10: py310 3.11: py311 3.12: py312 + 3.13: py313 + 3.14: py314 pypy-3: pypy3 [testenv]