From 6eff72e1be5fd8359f58c519091016f3e6709e23 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 1 Jul 2024 10:39:28 -0700 Subject: [PATCH 01/14] Scheduled biweekly dependency update for week 26 (#1242) * Update flake8 from 7.0.0 to 7.1.0 * Update twine from 5.0.0 to 5.1.1 * Update faker from 25.0.1 to 26.0.0 * Update pytest from 8.2.0 to 8.2.2 --- requirements/requirements-codestyle.txt | 2 +- requirements/requirements-packaging.txt | 2 +- requirements/requirements-testing.txt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements/requirements-codestyle.txt b/requirements/requirements-codestyle.txt index 4c270607..50c073e5 100644 --- a/requirements/requirements-codestyle.txt +++ b/requirements/requirements-codestyle.txt @@ -1,5 +1,5 @@ black==24.4.2 -flake8==7.0.0 +flake8==7.1.0 flake8-bugbear==24.4.26 flake8-isort==6.1.1 isort==5.13.2 diff --git a/requirements/requirements-packaging.txt b/requirements/requirements-packaging.txt index 489eeb83..e957043a 100644 --- a/requirements/requirements-packaging.txt +++ b/requirements/requirements-packaging.txt @@ -1 +1 @@ -twine==5.0.0 +twine==5.1.1 diff --git a/requirements/requirements-testing.txt b/requirements/requirements-testing.txt index 1dfa20d4..317a12b0 100644 --- a/requirements/requirements-testing.txt +++ b/requirements/requirements-testing.txt @@ -1,6 +1,6 @@ factory-boy==3.3.0 -Faker==25.0.1 -pytest==8.2.0 +Faker==26.0.0 +pytest==8.2.2 pytest-cov==5.0.0 pytest-django==4.8.0 pytest-factoryboy==2.7.0 From 75a5424fb429196675e437889000a9ba40287670 Mon Sep 17 00:00:00 2001 From: Humayun Ahmad Date: Tue, 23 Jul 2024 11:52:45 +0500 Subject: [PATCH 02/14] Handle zero as valid pk/id in get_resource_id util method (#1245) --------- Co-authored-by: Oliver Sauder --- AUTHORS | 1 + CHANGELOG.md | 6 ++++++ rest_framework_json_api/utils.py | 10 ++++------ tests/test_utils.py | 7 +++++++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/AUTHORS b/AUTHORS index 7f4a8237..d421d5e6 100644 --- a/AUTHORS +++ b/AUTHORS @@ -15,6 +15,7 @@ David Guillot, for Contexte David Vogt Felix Viernickel Greg Aker +Humayun Ahmad Jamie Bliss Jason Housley Jeppe Fihl-Pearson diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c3c7720..4fb30d1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Note that in line with [Django REST framework policy](https://www.django-rest-framework.org/topics/release-notes/), any parts of the framework not mentioned in the documentation should generally be considered private API, and may be subject to change. +## [Unreleased] + +### Fixed + +* Handled zero as a valid ID for resource (regression since 6.1.0) + ## [7.0.2] - 2024-06-28 ### Fixed diff --git a/rest_framework_json_api/utils.py b/rest_framework_json_api/utils.py index e12080ac..805f5f09 100644 --- a/rest_framework_json_api/utils.py +++ b/rest_framework_json_api/utils.py @@ -307,13 +307,11 @@ def get_resource_type_from_serializer(serializer): def get_resource_id(resource_instance, resource): """Returns the resource identifier for a given instance (`id` takes priority over `pk`).""" if resource and "id" in resource: - return resource["id"] and encoding.force_str(resource["id"]) or None + _id = resource["id"] + return encoding.force_str(_id) if _id is not None else None if resource_instance: - return ( - hasattr(resource_instance, "pk") - and encoding.force_str(resource_instance.pk) - or None - ) + pk = getattr(resource_instance, "pk", None) + return encoding.force_str(pk) if pk is not None else None return None diff --git a/tests/test_utils.py b/tests/test_utils.py index 4e103ae2..a3beb12e 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -403,6 +403,13 @@ class SerializerWithoutResourceName(serializers.Serializer): (None, {"id": 11}, "11"), (object(), {"pk": 11}, None), (BasicModel(id=6), {"id": 11}, "11"), + (BasicModel(id=0), None, "0"), + (None, {"id": 0}, "0"), + ( + BasicModel(id=0), + {"id": 0}, + "0", + ), ], ) def test_get_resource_id(resource_instance, resource, expected): From e4c587177483a6cc0bc3248c6183da6734e97289 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 5 Aug 2024 10:54:51 -0700 Subject: [PATCH 03/14] Scheduled biweekly dependency update for week 31 (#1246) * Update black from 24.4.2 to 24.8.0 * Update flake8 from 7.1.0 to 7.1.1 * Update sphinx from 7.3.7 to 7.4.7 * Update django-filter from 24.2 to 24.3 * Update faker from 26.0.0 to 26.1.0 * Update pytest from 8.2.2 to 8.3.2 --------- Co-authored-by: Oliver Sauder --- requirements/requirements-codestyle.txt | 4 ++-- requirements/requirements-documentation.txt | 2 +- requirements/requirements-optionals.txt | 2 +- requirements/requirements-testing.txt | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements/requirements-codestyle.txt b/requirements/requirements-codestyle.txt index 50c073e5..d826f918 100644 --- a/requirements/requirements-codestyle.txt +++ b/requirements/requirements-codestyle.txt @@ -1,5 +1,5 @@ -black==24.4.2 -flake8==7.1.0 +black==24.8.0 +flake8==7.1.1 flake8-bugbear==24.4.26 flake8-isort==6.1.1 isort==5.13.2 diff --git a/requirements/requirements-documentation.txt b/requirements/requirements-documentation.txt index 13a66219..ea5200ab 100644 --- a/requirements/requirements-documentation.txt +++ b/requirements/requirements-documentation.txt @@ -1,3 +1,3 @@ recommonmark==0.7.1 -Sphinx==7.3.7 +Sphinx==7.4.7 sphinx_rtd_theme==2.0.0 diff --git a/requirements/requirements-optionals.txt b/requirements/requirements-optionals.txt index efc82a58..df0ef24d 100644 --- a/requirements/requirements-optionals.txt +++ b/requirements/requirements-optionals.txt @@ -1,4 +1,4 @@ -django-filter==24.2 +django-filter==24.3 # once next version has been released (>3.1.0) this # should be set to pinned version again # see https://github.com/django-polymorphic/django-polymorphic/pull/541 diff --git a/requirements/requirements-testing.txt b/requirements/requirements-testing.txt index 317a12b0..9c7ebb66 100644 --- a/requirements/requirements-testing.txt +++ b/requirements/requirements-testing.txt @@ -1,6 +1,6 @@ factory-boy==3.3.0 -Faker==26.0.0 -pytest==8.2.2 +Faker==26.1.0 +pytest==8.3.2 pytest-cov==5.0.0 pytest-django==4.8.0 pytest-factoryboy==2.7.0 From cecd31faa99575202f9223f8566e27383a05cb64 Mon Sep 17 00:00:00 2001 From: Oliver Sauder Date: Sun, 1 Sep 2024 01:15:31 +0400 Subject: [PATCH 04/14] Added support for Django 5.1 (#1249) --- CHANGELOG.md | 4 ++++ README.rst | 2 +- docs/getting-started.md | 2 +- tox.ini | 5 +++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fb30d1b..3b200cdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ any parts of the framework not mentioned in the documentation should generally b * Handled zero as a valid ID for resource (regression since 6.1.0) +### Added + +* Added support for Django 5.1 + ## [7.0.2] - 2024-06-28 ### Fixed diff --git a/README.rst b/README.rst index fd340af6..423f132a 100644 --- a/README.rst +++ b/README.rst @@ -93,7 +93,7 @@ Requirements ------------ 1. Python (3.8, 3.9, 3.10, 3.11, 3.12) -2. Django (4.2, 5.0) +2. Django (4.2, 5.0, 5.1) 3. Django REST framework (3.14, 3.15) We **highly** recommend and only officially support the latest patch release of each Python, Django and REST framework series. diff --git a/docs/getting-started.md b/docs/getting-started.md index fd70c79a..cef2c5b4 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -52,7 +52,7 @@ like the following: ## Requirements 1. Python (3.8, 3.9, 3.10, 3.11, 3.12) -2. Django (4.2, 5.0) +2. Django (4.2, 5.0, 5.1) 3. Django REST framework (3.14, 3.15) We **highly** recommend and only officially support the latest patch release of each Python, Django and REST framework series. diff --git a/tox.ini b/tox.ini index 68646fb4..0f65b588 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = py{38,39,310,311,312}-django42-drf{314,315,master}, - py{310,311,312}-django50-drf{314,315,master}, + py{310,311,312}-django{50,51}-drf{314,315,master}, black, docs, lint @@ -10,6 +10,7 @@ envlist = deps = django42: Django>=4.2,<4.3 django50: Django>=5.0,<5.1 + django51: Django>=5.1,<5.2 drf314: djangorestframework>=3.14,<3.15 drf315: djangorestframework>=3.15,<3.16 drfmaster: https://github.com/encode/django-rest-framework/archive/master.zip @@ -49,5 +50,5 @@ commands = [testenv:py{38,39,310,311,312}-django42-drfmaster] ignore_outcome = true -[testenv:py{310,311,312}-django50-drfmaster] +[testenv:py{310,311,312}-django{50,51}-drfmaster] ignore_outcome = true From e745d6bee508a7ea10080cd51f7f311d5de6e585 Mon Sep 17 00:00:00 2001 From: Oliver Sauder Date: Tue, 10 Sep 2024 15:32:16 +0400 Subject: [PATCH 05/14] Ensured that patching a To-Many relationship correctly raises request error (#1251) --- CHANGELOG.md | 2 ++ example/tests/test_views.py | 21 ++++++++++++++++++--- rest_framework_json_api/parsers.py | 2 +- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b200cdf..ae0aaf32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ any parts of the framework not mentioned in the documentation should generally b ### Fixed * Handled zero as a valid ID for resource (regression since 6.1.0) +* Ensured that patching a To-Many relationship with the `RelationshipView` correctly raises request error when passing in `None`. + For emptying a To-Many relationship an empty array should be used as per [JSON:API spec](https://jsonapi.org/format/#crud-updating-to-many-relationships) ### Added diff --git a/example/tests/test_views.py b/example/tests/test_views.py index ad3fe124..47d4adb1 100644 --- a/example/tests/test_views.py +++ b/example/tests/test_views.py @@ -2,6 +2,7 @@ from django.test import RequestFactory, override_settings from django.utils import timezone +from rest_framework import status from rest_framework.exceptions import NotFound from rest_framework.request import Request from rest_framework.reverse import reverse @@ -174,16 +175,30 @@ def test_patch_one_to_many_relationship(self): response = self.client.get(url) assert response.data == request_data["data"] - def test_patch_one_to_many_relaitonship_with_none(self): + def test_patch_one_to_many_relaitonship_with_empty(self): url = f"/blogs/{self.first_entry.id}/relationships/entry_set" - request_data = {"data": None} + + request_data = {"data": []} response = self.client.patch(url, data=request_data) - assert response.status_code == 200, response.content.decode() + assert response.status_code == status.HTTP_200_OK assert response.data == [] response = self.client.get(url) assert response.data == [] + def test_patch_one_to_many_relaitonship_with_none(self): + """ + None for a to many relationship is invalid and should return a request error. + + see https://jsonapi.org/format/#crud-updating-to-many-relationships + """ + + url = f"/blogs/{self.first_entry.id}/relationships/entry_set" + + request_data = {"data": None} + response = self.client.patch(url, data=request_data) + assert response.status_code == status.HTTP_400_BAD_REQUEST + def test_patch_many_to_many_relationship(self): url = f"/entries/{self.first_entry.id}/relationships/authors" request_data = { diff --git a/rest_framework_json_api/parsers.py b/rest_framework_json_api/parsers.py index a0a2aeb2..8940c653 100644 --- a/rest_framework_json_api/parsers.py +++ b/rest_framework_json_api/parsers.py @@ -98,7 +98,7 @@ def parse_data(self, result, parser_context): "Received data contains one or more malformed JSON:API " "Resource Identifier Object(s)" ) - elif not (data.get("id") and data.get("type")): + elif isinstance(data, dict) and not (data.get("id") and data.get("type")): raise ParseError( "Received data is not a valid JSON:API Resource Identifier Object" ) From 5123a267be5abc37dd45c3f982e54c39fe335314 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 10 Sep 2024 11:48:39 -0700 Subject: [PATCH 06/14] Scheduled biweekly dependency update for week 35 (#1250) * Update flake8-bugbear from 24.4.26 to 24.8.19 * Update pyyaml from 6.0.1 to 6.0.2 * Update factory-boy from 3.3.0 to 3.3.1 * Update faker from 26.1.0 to 28.1.0 * Update syrupy from 4.6.1 to 4.7.1 * Updated to Python 3.10 for checks * As for sphinx-rtd-theme Sphinx needs to be lower than 8 --------- Co-authored-by: Oliver Sauder --- .github/workflows/tests.yml | 4 ++-- requirements/requirements-codestyle.txt | 2 +- requirements/requirements-optionals.txt | 2 +- requirements/requirements-testing.txt | 6 +++--- tox.ini | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2f966adc..622e45b9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -43,10 +43,10 @@ jobs: tox-env: ["black", "lint", "docs"] steps: - uses: actions/checkout@v2 - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: "3.10" - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/requirements/requirements-codestyle.txt b/requirements/requirements-codestyle.txt index d826f918..fcbf26ec 100644 --- a/requirements/requirements-codestyle.txt +++ b/requirements/requirements-codestyle.txt @@ -1,5 +1,5 @@ black==24.8.0 flake8==7.1.1 -flake8-bugbear==24.4.26 +flake8-bugbear==24.8.19 flake8-isort==6.1.1 isort==5.13.2 diff --git a/requirements/requirements-optionals.txt b/requirements/requirements-optionals.txt index df0ef24d..589636e6 100644 --- a/requirements/requirements-optionals.txt +++ b/requirements/requirements-optionals.txt @@ -3,5 +3,5 @@ django-filter==24.3 # should be set to pinned version again # see https://github.com/django-polymorphic/django-polymorphic/pull/541 django-polymorphic@git+https://github.com/django-polymorphic/django-polymorphic@master # pyup: ignore -pyyaml==6.0.1 +pyyaml==6.0.2 uritemplate==4.1.1 diff --git a/requirements/requirements-testing.txt b/requirements/requirements-testing.txt index 9c7ebb66..b95d04d8 100644 --- a/requirements/requirements-testing.txt +++ b/requirements/requirements-testing.txt @@ -1,7 +1,7 @@ -factory-boy==3.3.0 -Faker==26.1.0 +factory-boy==3.3.1 +Faker==28.1.0 pytest==8.3.2 pytest-cov==5.0.0 pytest-django==4.8.0 pytest-factoryboy==2.7.0 -syrupy==4.6.1 +syrupy==4.7.1 diff --git a/tox.ini b/tox.ini index 0f65b588..2b89dc40 100644 --- a/tox.ini +++ b/tox.ini @@ -25,13 +25,13 @@ commands = pytest --cov --no-cov-on-fail --cov-report xml {posargs} [testenv:black] -basepython = python3.9 +basepython = python3.10 deps = -rrequirements/requirements-codestyle.txt commands = black --check . [testenv:lint] -basepython = python3.9 +basepython = python3.10 deps = -rrequirements/requirements-codestyle.txt -rrequirements/requirements-testing.txt @@ -40,7 +40,7 @@ commands = flake8 [testenv:docs] # keep in sync with .readthedocs.yml -basepython = python3.9 +basepython = python3.10 deps = -rrequirements/requirements-optionals.txt -rrequirements/requirements-documentation.txt From 4ceee03893434056d28318fb6bd4ee85f26d57fe Mon Sep 17 00:00:00 2001 From: Oliver Sauder Date: Thu, 3 Oct 2024 20:42:29 +0400 Subject: [PATCH 07/14] Deprecated built-in support for OpenAPI schema generation (#1253) --- CHANGELOG.md | 4 ++++ docs/usage.md | 20 +++++++++++++++++++- example/tests/test_openapi.py | 3 +++ rest_framework_json_api/schemas/openapi.py | 10 ++++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae0aaf32..cebd3f8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,10 @@ any parts of the framework not mentioned in the documentation should generally b * Added support for Django 5.1 +### Deprecated + +* Deprecated built-in support for generating OpenAPI schema. Use [drf-spectacular-json-api](https://github.com/jokiefer/drf-spectacular-json-api/) instead. + ## [7.0.2] - 2024-06-28 ### Fixed diff --git a/docs/usage.md b/docs/usage.md index a50a97f7..1a2cb195 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -31,7 +31,6 @@ REST_FRAMEWORK = { 'rest_framework_json_api.renderers.BrowsableAPIRenderer' ), 'DEFAULT_METADATA_CLASS': 'rest_framework_json_api.metadata.JSONAPIMetadata', - 'DEFAULT_SCHEMA_CLASS': 'rest_framework_json_api.schemas.openapi.AutoSchema', 'DEFAULT_FILTER_BACKENDS': ( 'rest_framework_json_api.filters.QueryParameterValidationFilter', 'rest_framework_json_api.filters.OrderingFilter', @@ -1062,6 +1061,20 @@ DRF has a [OAS schema functionality](https://www.django-rest-framework.org/api-g DJA extends DRF's schema support to generate an OAS schema in the JSON:API format. +--- + +**Deprecation notice:** + +REST framework's built-in support for generating OpenAPI schemas is +**deprecated** in favor of 3rd party packages that can provide this +functionality instead. Therefore we have also deprecated the schema support in +Django REST framework JSON:API. The built-in support will be retired over the +next releases. + +As a full-fledged replacement, we recommend the [drf-spectacular-json-api] package. + +--- + ### AutoSchema Settings In order to produce an OAS schema that properly represents the JSON:API structure @@ -1187,3 +1200,8 @@ We aim to make creating third party packages as easy as possible, whilst keeping To submit new content, [open an issue](https://github.com/django-json-api/django-rest-framework-json-api/issues/new/choose) or [create a pull request](https://github.com/django-json-api/django-rest-framework-json-api/compare). * [drf-yasg-json-api](https://github.com/glowka/drf-yasg-json-api) - Automated generation of Swagger/OpenAPI 2.0 from Django REST framework JSON:API endpoints. +* [drf-spectacular-json-api] - OpenAPI 3 schema generator for Django REST framework JSON:API based on drf-spectacular. + + + +[drf-spectacular-json-api]: https://github.com/jokiefer/drf-spectacular-json-api/ diff --git a/example/tests/test_openapi.py b/example/tests/test_openapi.py index 2333dd6a..fa2f9c73 100644 --- a/example/tests/test_openapi.py +++ b/example/tests/test_openapi.py @@ -1,6 +1,7 @@ # largely based on DRF's test_openapi import json +import pytest from django.test import RequestFactory, override_settings from django.urls import re_path from rest_framework.request import Request @@ -9,6 +10,8 @@ from example import views +pytestmark = pytest.mark.filterwarnings("ignore:Built-in support") + def create_request(path): factory = RequestFactory() diff --git a/rest_framework_json_api/schemas/openapi.py b/rest_framework_json_api/schemas/openapi.py index b44ce7a4..6892e991 100644 --- a/rest_framework_json_api/schemas/openapi.py +++ b/rest_framework_json_api/schemas/openapi.py @@ -423,6 +423,16 @@ def get_operation(self, path, method): - collections - special handling for POST, PATCH, DELETE """ + + warnings.warn( + DeprecationWarning( + "Built-in support for generating OpenAPI schema is deprecated. " + "Use drf-spectacular-json-api instead see " + "https://github.com/jokiefer/drf-spectacular-json-api/" + ), + stacklevel=2, + ) + operation = {} operation["operationId"] = self.get_operation_id(path, method) operation["description"] = self.get_description(path, method) From b0c6aee1e7e7edc5e32bf5ae992eaa6b3b40840a Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 7 Oct 2024 08:17:57 -0700 Subject: [PATCH 08/14] Scheduled biweekly dependency update for week 40 (#1254) * Update sphinx from 7.4.7 to 8.0.2 * Update sphinx_rtd_theme from 2.0.0 to 3.0.0 * Update faker from 28.1.0 to 30.1.0 * Update pytest from 8.3.2 to 8.3.3 * Update pytest-django from 4.8.0 to 4.9.0 * Update syrupy from 4.7.1 to 4.7.2 --- requirements/requirements-documentation.txt | 4 ++-- requirements/requirements-testing.txt | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements/requirements-documentation.txt b/requirements/requirements-documentation.txt index ea5200ab..4a2139cd 100644 --- a/requirements/requirements-documentation.txt +++ b/requirements/requirements-documentation.txt @@ -1,3 +1,3 @@ recommonmark==0.7.1 -Sphinx==7.4.7 -sphinx_rtd_theme==2.0.0 +Sphinx==8.0.2 +sphinx_rtd_theme==3.0.0 diff --git a/requirements/requirements-testing.txt b/requirements/requirements-testing.txt index b95d04d8..05c423b4 100644 --- a/requirements/requirements-testing.txt +++ b/requirements/requirements-testing.txt @@ -1,7 +1,7 @@ factory-boy==3.3.1 -Faker==28.1.0 -pytest==8.3.2 +Faker==30.1.0 +pytest==8.3.3 pytest-cov==5.0.0 -pytest-django==4.8.0 +pytest-django==4.9.0 pytest-factoryboy==2.7.0 -syrupy==4.7.1 +syrupy==4.7.2 From c82ea18d5eb71c1cc0bceee6869eb426c53060f0 Mon Sep 17 00:00:00 2001 From: Oliver Sauder Date: Tue, 8 Oct 2024 15:26:26 +0400 Subject: [PATCH 09/14] Bumped docs Python version to 3.10 (#1255) --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 997afe3f..fa503604 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,7 +3,7 @@ version: 2 build: os: "ubuntu-22.04" tools: - python: "3.9" + python: "3.10" sphinx: configuration: docs/conf.py From c686ded0559dcb6cddc630c72ab163c720175970 Mon Sep 17 00:00:00 2001 From: Oliver Sauder Date: Tue, 8 Oct 2024 15:51:59 +0400 Subject: [PATCH 10/14] Added support for 3.13 (#1256) * Added support for 3.13 This will only be supported on Django 5.1 and above. see https://forum.djangoproject.com/t/backport-python-3-13-support-in-django-5-0/34671 * As Github as not officially released 3.13 yet use latest dev version * There was an upstream change in DRF which as not been release yet so only master till it is released. see https://github.com/encode/django-rest-framework/pull/9527/files * Remove ignoring with drfmaster --- .github/workflows/tests.yml | 4 ++-- CHANGELOG.md | 1 + README.rst | 2 +- docs/getting-started.md | 2 +- setup.py | 1 + tox.ini | 7 +------ 6 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 622e45b9..29a36a3c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13-dev"] env: PYTHON: ${{ matrix.python-version }} steps: @@ -28,7 +28,7 @@ jobs: python -m pip install --upgrade pip pip install tox - name: Run tox targets for ${{ matrix.python-version }} - run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .) + run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d . | cut -f 1 -d '-') - name: Upload coverage report uses: codecov/codecov-action@v4 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index cebd3f8a..a0ad16ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ any parts of the framework not mentioned in the documentation should generally b ### Added * Added support for Django 5.1 +* Added support for Python 3.13 ### Deprecated diff --git a/README.rst b/README.rst index 423f132a..0c9b842f 100644 --- a/README.rst +++ b/README.rst @@ -92,7 +92,7 @@ As a Django REST framework JSON:API (short DJA) we are trying to address followi Requirements ------------ -1. Python (3.8, 3.9, 3.10, 3.11, 3.12) +1. Python (3.8, 3.9, 3.10, 3.11, 3.12, 3.13) 2. Django (4.2, 5.0, 5.1) 3. Django REST framework (3.14, 3.15) diff --git a/docs/getting-started.md b/docs/getting-started.md index cef2c5b4..a7de353a 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -51,7 +51,7 @@ like the following: ## Requirements -1. Python (3.8, 3.9, 3.10, 3.11, 3.12) +1. Python (3.8, 3.9, 3.10, 3.11, 3.12, 3.13) 2. Django (4.2, 5.0, 5.1) 3. Django REST framework (3.14, 3.15) diff --git a/setup.py b/setup.py index 95d5ca0b..652ab85b 100755 --- a/setup.py +++ b/setup.py @@ -91,6 +91,7 @@ def get_package_data(package): "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries :: Application Frameworks", "Topic :: Software Development :: Libraries :: Python Modules", diff --git a/tox.ini b/tox.ini index 2b89dc40..a2accaad 100644 --- a/tox.ini +++ b/tox.ini @@ -2,6 +2,7 @@ envlist = py{38,39,310,311,312}-django42-drf{314,315,master}, py{310,311,312}-django{50,51}-drf{314,315,master}, + py313-django51-drf{master}, black, docs, lint @@ -46,9 +47,3 @@ deps = -rrequirements/requirements-documentation.txt commands = sphinx-build -W -b html -d docs/_build/doctrees docs docs/_build/html - -[testenv:py{38,39,310,311,312}-django42-drfmaster] -ignore_outcome = true - -[testenv:py{310,311,312}-django{50,51}-drfmaster] -ignore_outcome = true From 9598b0c259b3cb0bc9a35e8c0b1acddca948c47b Mon Sep 17 00:00:00 2001 From: Oliver Sauder Date: Wed, 9 Oct 2024 15:21:14 +0400 Subject: [PATCH 11/14] Remove obsolete CodeQL Workflow (#1257) --- .github/workflows/codeql-analysis.yml | 74 --------------------------- 1 file changed, 74 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 8faf1a2f..00000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,74 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ "main" ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ "main" ] - schedule: - - cron: '39 4 * * 2' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'python' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:${{matrix.language}}" From dc2354bf221e965cb43c96d4b1fdbc7a5d1b29df Mon Sep 17 00:00:00 2001 From: Oliver Sauder Date: Wed, 9 Oct 2024 21:26:26 +0400 Subject: [PATCH 12/14] Use final release of 3.13 (#1258) This has been released now on Github. --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 29a36a3c..ca736986 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13-dev"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] env: PYTHON: ${{ matrix.python-version }} steps: From cedeb3b5bd7c4b342109b0180e39eb15109ac78e Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 21 Oct 2024 08:02:08 -0700 Subject: [PATCH 13/14] Scheduled biweekly dependency update for week 42 (#1259) * Update black from 24.8.0 to 24.10.0 * Update sphinx from 8.0.2 to 8.1.3 * Update sphinx_rtd_theme from 3.0.0 to 3.0.1 * Update faker from 30.1.0 to 30.6.0 --- requirements/requirements-codestyle.txt | 2 +- requirements/requirements-documentation.txt | 4 ++-- requirements/requirements-testing.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements/requirements-codestyle.txt b/requirements/requirements-codestyle.txt index fcbf26ec..f5e5e92c 100644 --- a/requirements/requirements-codestyle.txt +++ b/requirements/requirements-codestyle.txt @@ -1,4 +1,4 @@ -black==24.8.0 +black==24.10.0 flake8==7.1.1 flake8-bugbear==24.8.19 flake8-isort==6.1.1 diff --git a/requirements/requirements-documentation.txt b/requirements/requirements-documentation.txt index 4a2139cd..aa120a8e 100644 --- a/requirements/requirements-documentation.txt +++ b/requirements/requirements-documentation.txt @@ -1,3 +1,3 @@ recommonmark==0.7.1 -Sphinx==8.0.2 -sphinx_rtd_theme==3.0.0 +Sphinx==8.1.3 +sphinx_rtd_theme==3.0.1 diff --git a/requirements/requirements-testing.txt b/requirements/requirements-testing.txt index 05c423b4..b56d8185 100644 --- a/requirements/requirements-testing.txt +++ b/requirements/requirements-testing.txt @@ -1,5 +1,5 @@ factory-boy==3.3.1 -Faker==30.1.0 +Faker==30.6.0 pytest==8.3.3 pytest-cov==5.0.0 pytest-django==4.9.0 From f2c489bff211cd38d4f5850b2cbc9373958e4037 Mon Sep 17 00:00:00 2001 From: Oliver Sauder Date: Fri, 25 Oct 2024 14:26:59 +0400 Subject: [PATCH 14/14] Release 7.1.0 (#1260) --- CHANGELOG.md | 2 +- rest_framework_json_api/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0ad16ed..07cd7d8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Note that in line with [Django REST framework policy](https://www.django-rest-framework.org/topics/release-notes/), any parts of the framework not mentioned in the documentation should generally be considered private API, and may be subject to change. -## [Unreleased] +## [7.1.0] - 2024-10-25 ### Fixed diff --git a/rest_framework_json_api/__init__.py b/rest_framework_json_api/__init__.py index 3008837c..a69daa9f 100644 --- a/rest_framework_json_api/__init__.py +++ b/rest_framework_json_api/__init__.py @@ -1,5 +1,5 @@ __title__ = "djangorestframework-jsonapi" -__version__ = "7.0.2" +__version__ = "7.1.0" __author__ = "" __license__ = "BSD" __copyright__ = "" pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy