diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f90480ac..b167fde5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,10 +42,10 @@ jobs: tox-env: ["black", "lint", "docs"] steps: - uses: actions/checkout@v2 - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.9 - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.readthedocs.yaml b/.readthedocs.yaml index d70a3ae5..997afe3f 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,7 +3,7 @@ version: 2 build: os: "ubuntu-22.04" tools: - python: "3.8" + python: "3.9" sphinx: configuration: docs/conf.py diff --git a/example/factories.py b/example/factories.py index 37340df4..87698fa2 100644 --- a/example/factories.py +++ b/example/factories.py @@ -37,6 +37,7 @@ class Meta: class AuthorFactory(factory.django.DjangoModelFactory): class Meta: + skip_postgeneration_save = True model = Author name = factory.LazyAttribute(lambda x: faker.name()) @@ -49,6 +50,7 @@ class Meta: class AuthorBioFactory(factory.django.DjangoModelFactory): class Meta: model = AuthorBio + skip_postgeneration_save = True author = factory.SubFactory(AuthorFactory) body = factory.LazyAttribute(lambda x: faker.text()) @@ -69,6 +71,7 @@ class Meta: class EntryFactory(factory.django.DjangoModelFactory): class Meta: model = Entry + skip_postgeneration_save = True headline = factory.LazyAttribute(lambda x: faker.sentence(nb_words=4)) body_text = factory.LazyAttribute(lambda x: faker.text()) @@ -130,6 +133,7 @@ class Meta: class CompanyFactory(factory.django.DjangoModelFactory): class Meta: model = Company + skip_postgeneration_save = True name = factory.LazyAttribute(lambda x: faker.company()) current_project = factory.SubFactory(ArtProjectFactory) diff --git a/example/tests/__snapshots__/test_errors.ambr b/example/tests/__snapshots__/test_errors.ambr index fe872b46..5dca2771 100644 --- a/example/tests/__snapshots__/test_errors.ambr +++ b/example/tests/__snapshots__/test_errors.ambr @@ -1,3 +1,4 @@ +# serializer version: 1 # name: test_first_level_attribute_error dict({ 'errors': list([ diff --git a/example/tests/__snapshots__/test_openapi.ambr b/example/tests/__snapshots__/test_openapi.ambr index 18aec07f..1de8057b 100644 --- a/example/tests/__snapshots__/test_openapi.ambr +++ b/example/tests/__snapshots__/test_openapi.ambr @@ -1,3 +1,4 @@ +# serializer version: 1 # name: test_delete_request ''' { diff --git a/example/tests/integration/test_polymorphism.py b/example/tests/integration/test_polymorphism.py index 116243f1..836a9046 100644 --- a/example/tests/integration/test_polymorphism.py +++ b/example/tests/integration/test_polymorphism.py @@ -50,7 +50,6 @@ def test_polymorphism_on_included_relations(single_company, client): for rel in content["data"]["relationships"]["futureProjects"]["data"] } == {"researchProjects", "artProjects"} assert {x.get("type") for x in content.get("included")} == { - "artProjects", "artProjects", "researchProjects", }, "Detail included types are incorrect" diff --git a/requirements/requirements-codestyle.txt b/requirements/requirements-codestyle.txt index 8eba9fae..cc8adaed 100644 --- a/requirements/requirements-codestyle.txt +++ b/requirements/requirements-codestyle.txt @@ -1,5 +1,5 @@ -black==23.3.0 -flake8==6.0.0 -flake8-bugbear==23.3.23 -flake8-isort==6.0.0 +black==23.9.1 +flake8==6.1.0 +flake8-bugbear==23.9.16 +flake8-isort==6.1.0 isort==5.12.0 diff --git a/requirements/requirements-documentation.txt b/requirements/requirements-documentation.txt index 36e96657..8dc46ee5 100644 --- a/requirements/requirements-documentation.txt +++ b/requirements/requirements-documentation.txt @@ -1,3 +1,3 @@ recommonmark==0.7.1 -Sphinx==6.1.3 -sphinx_rtd_theme==1.2.0 +Sphinx==7.2.6 +sphinx_rtd_theme==1.3.0 diff --git a/requirements/requirements-optionals.txt b/requirements/requirements-optionals.txt index b8a8b54d..fc16b02c 100644 --- a/requirements/requirements-optionals.txt +++ b/requirements/requirements-optionals.txt @@ -1,4 +1,4 @@ -django-filter==23.1 +django-filter==23.3 django-polymorphic==3.1.0 -pyyaml==6.0 +pyyaml==6.0.1 uritemplate==4.1.1 diff --git a/requirements/requirements-testing.txt b/requirements/requirements-testing.txt index 7fac28a4..64cb57b7 100644 --- a/requirements/requirements-testing.txt +++ b/requirements/requirements-testing.txt @@ -1,7 +1,7 @@ -factory-boy==3.2.1 -Faker==18.4.0 -pytest==7.3.1 -pytest-cov==4.0.0 +factory-boy==3.3.0 +Faker==19.6.1 +pytest==7.4.2 +pytest-cov==4.1.0 pytest-django==4.5.2 pytest-factoryboy==2.5.1 -syrupy==3.0.6 +syrupy==4.5.0 diff --git a/setup.cfg b/setup.cfg index d3ea5ebc..f55ed558 100644 --- a/setup.cfg +++ b/setup.cfg @@ -68,6 +68,9 @@ filterwarnings = # can be removed once fixed in django polymorphic ignore:pkg_resources is deprecated as an API ignore:Deprecated call to `pkg_resource + # Django filter schema generation. Can be removed once we remove + # schema support + ignore:Built-in schema generation is deprecated. testpaths = example tests diff --git a/tox.ini b/tox.ini index 9fb72d1c..8d6df244 100644 --- a/tox.ini +++ b/tox.ini @@ -28,13 +28,13 @@ commands = pytest --cov --no-cov-on-fail --cov-report xml {posargs} [testenv:black] -basepython = python3.8 +basepython = python3.9 deps = -rrequirements/requirements-codestyle.txt commands = black --check . [testenv:lint] -basepython = python3.8 +basepython = python3.9 deps = -rrequirements/requirements-codestyle.txt -rrequirements/requirements-testing.txt @@ -43,7 +43,7 @@ commands = flake8 [testenv:docs] # keep in sync with .readthedocs.yml -basepython = python3.8 +basepython = python3.9 deps = -rrequirements/requirements-optionals.txt -rrequirements/requirements-documentation.txt