Skip to content

Commit 8afbbb2

Browse files
authored
Merge branch 'main' into 6202-partial-update-respect-ordered-sequence
2 parents 471ce01 + dff3c8d commit 8afbbb2

4 files changed

Lines changed: 144 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: Publish Release
2+
3+
concurrency:
4+
# stop previous release runs if tag is recreated
5+
group: release-${{ github.ref }}
6+
cancel-in-progress: true
7+
8+
on:
9+
push:
10+
tags:
11+
# Order matters, the last rule that applies to a tag
12+
# is the one that takes effect:
13+
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-including-and-excluding-branches-and-tags
14+
- '*.*.*'
15+
# There should be no dev tags created, but to be safe,
16+
# let's not publish them.
17+
- '!*.*.*.dev*'
18+
19+
env:
20+
PYPI_URL: https://pypi.org/p/djangorestframework
21+
PYPI_TEST_URL: https://test.pypi.org/p/djangorestframework
22+
23+
jobs:
24+
build:
25+
name: Build distribution 📦
26+
runs-on: ubuntu-24.04
27+
steps:
28+
- uses: actions/checkout@v6
29+
- name: Set up Python
30+
uses: actions/setup-python@v6
31+
with:
32+
python-version: "3.x"
33+
- name: Install pypa/build
34+
run: python3 -m pip install build
35+
- name: Build a binary wheel and a source tarball
36+
run: python3 -m build
37+
- name: Store the distribution packages
38+
uses: actions/upload-artifact@v7
39+
with:
40+
name: python-package-distributions
41+
path: dist/
42+
43+
publish-to-testpypi:
44+
name: Publish Python 🐍 distribution 📦 to TestPyPI
45+
needs:
46+
- build
47+
runs-on: ubuntu-24.04
48+
environment:
49+
name: testpypi
50+
url: ${{ env.PYPI_TEST_URL }}
51+
permissions:
52+
id-token: write # IMPORTANT: mandatory for trusted publishing
53+
steps:
54+
- name: Download all the dists
55+
uses: actions/download-artifact@v8
56+
with:
57+
name: python-package-distributions
58+
path: dist/
59+
- name: Publish distribution 📦 to TestPyPI
60+
uses: pypa/gh-action-pypi-publish@release/v1.13
61+
with:
62+
repository-url: https://test.pypi.org/legacy/
63+
skip-existing: true
64+
65+
publish-to-pypi:
66+
name: Publish Python 🐍 distribution 📦 to PyPI
67+
needs:
68+
- build
69+
- publish-to-testpypi
70+
runs-on: ubuntu-24.04
71+
environment:
72+
name: pypi
73+
url: ${{ env.PYPI_URL }}
74+
permissions:
75+
id-token: write # IMPORTANT: mandatory for trusted publishing
76+
steps:
77+
- name: Download all the dists
78+
uses: actions/download-artifact@v8
79+
with:
80+
name: python-package-distributions
81+
path: dist/
82+
- name: Publish distribution 📦 to PyPI
83+
uses: pypa/gh-action-pypi-publish@release/v1.13
84+
85+
github-release:
86+
name: >-
87+
Sign the Python 🐍 distribution 📦 with Sigstore
88+
and upload them to GitHub Release
89+
needs:
90+
- publish-to-pypi
91+
runs-on: ubuntu-24.04
92+
permissions:
93+
contents: write # IMPORTANT: mandatory for making GitHub Releases
94+
id-token: write # IMPORTANT: mandatory for sigstore
95+
steps:
96+
- name: Download all the dists
97+
uses: actions/download-artifact@v8
98+
with:
99+
name: python-package-distributions
100+
path: dist/
101+
- name: Sign the dists with Sigstore
102+
uses: sigstore/gh-action-sigstore-python@v3.2.0
103+
with:
104+
inputs: >-
105+
./dist/*.tar.gz
106+
./dist/*.whl
107+
- name: Create GitHub Release
108+
env:
109+
GITHUB_TOKEN: ${{ github.token }}
110+
run: >-
111+
gh release create
112+
'${{ github.ref_name }}'
113+
--repo '${{ github.repository }}'
114+
--generate-notes
115+
- name: Upload artifact signatures to GitHub Release
116+
env:
117+
GITHUB_TOKEN: ${{ github.token }}
118+
# Upload to GitHub Release using the `gh` CLI.
119+
# `dist/` contains the built packages, and the
120+
# sigstore-produced signatures and certificates.
121+
run: >-
122+
gh release upload
123+
'${{ github.ref_name }}' dist/**
124+
--repo '${{ github.repository }}'

docs/api-guide/serializers.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,10 @@ The [drf-encrypt-content][drf-encrypt-content] package helps you encrypt your da
11801180

11811181
The [drf-shapeless-serializers][drf-shapeless-serializers] package provides dynamic serializer configuration capabilities, allowing runtime field selection, renaming, attribute modification, and nested relationship configuration without creating multiple serializer classes. It helps eliminate serializer boilerplate while providing flexible API responses.
11821182

1183+
### DRF Pydantic
1184+
1185+
The [drf-pydantic][drf-pydantic] package allows you to use Pydantic with Django REST framework for data validation and (de)serialization. If you develop DRF APIs and rely on Pydantic for data validation, this package provides seamless integration between both libraries.
1186+
11831187

11841188
[cite]: https://groups.google.com/d/topic/django-users/sVFaOfQi4wY/discussion
11851189
[relations]: relations.md
@@ -1204,3 +1208,4 @@ The [drf-shapeless-serializers][drf-shapeless-serializers] package provides dyna
12041208
[drf-writable-nested]: https://github.com/beda-software/drf-writable-nested
12051209
[drf-encrypt-content]: https://github.com/oguzhancelikarslan/drf-encrypt-content
12061210
[drf-shapeless-serializers]: https://github.com/khaledsukkar2/drf-shapeless-serializers
1211+
[drf-pydantic]: https://github.com/georgebv/drf-pydantic

docs/community/project-management.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,23 @@ The following template should be used for the description of the issue, and serv
6060
- [ ] `README` Python & Django versions
6161
- [ ] `docs` Python & Django versions
6262
- [ ] Ensure the pull request increments the version to `*.*.*` in [`restframework/__init__.py`](https://github.com/encode/django-rest-framework/blob/main/rest_framework/__init__.py).
63+
- [ ] Update the release-notes.md:
64+
- Start drafting a new release in GitHub: https://github.com/encode/django-rest-framework/releases/new
65+
- Select the tag that you want to give to the next release and the previous tag
66+
- Click the "Generate release notes" button
67+
- Don't confirm anything yet! Copy the generated content to a file `input.md`
68+
- Run `uv tool run linkify-gh-markdown input.md` to make the links absolute
69+
- Put the generated content in the release-notes.md file
6370
- [ ] Ensure documentation validates
6471
- Build and serve docs `mkdocs serve`
6572
- Validate links `pylinkvalidate.py -P http://127.0.0.1:8000`
66-
- [ ] Confirm with @tomchristie that release is finalized and ready to go.
73+
- [ ] Confirm with other maintainers that the release is finalized and ready to go.
6774
- [ ] Ensure that release date is included in pull request.
6875
- [ ] Merge the release pull request.
69-
- [ ] Install the release tools: `pip install build twine`
70-
- [ ] Build the package: `python -m build`
71-
- [ ] Push the package to PyPI with `twine upload dist/*`
72-
- [ ] Tag the release, with `git tag -a *.*.* -m 'version *.*.*'; git push --tags`.
73-
- [ ] Deploy the documentation with `mkdocs gh-deploy`.
76+
- [ ] Tag the release, either with `git tag -a *.*.* -m 'version *.*.*'; git push --tags` or in GitHub.
77+
- [ ] Wait for the release workflow to run. It will build the distribution, upload it to Test PyPI, PyPI and create the GitHub release.
7478
- [ ] Make a release announcement on the [discussion group](https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework).
75-
- [ ] Make a release announcement on twitter.
79+
- [ ] Make a release announcement on social media (Mastodon, etc...) and on the [Django forum](https://forum.djangoproject.com/).
7680
- [ ] Close the milestone on GitHub.
7781

7882
To modify this process for future releases make a pull request to the [project management](https://www.django-rest-framework.org/topics/project-management/) documentation.

docs/community/third-party-packages.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ To submit new content, [create a pull request][drf-create-pr].
7979

8080
* [django-rest-framework-mongoengine][django-rest-framework-mongoengine] - Serializer class that supports using MongoDB as the storage layer for Django REST framework.
8181
* [djangorestframework-gis][djangorestframework-gis] - Geographic add-ons
82+
* [django-pydantic-field][django-pydantic-field] - Provides a way to use Pydantic models as schemas for Django's JSONField with full support for Pydantic v1 and v2, type safety and integration with Django REST Framework.
83+
* [drf-pydantic][drf-pydantic] - Use Pydantic with Django REST framework for data validation and (de)serialization.
8284
* [djangorestframework-hstore][djangorestframework-hstore] - Serializer class to support django-hstore DictionaryField model field and its schema-mode feature.
8385
* [djangorestframework-jsonapi][djangorestframework-jsonapi] - Provides a parser, renderer, serializers, and other tools to help build an API that is compliant with the jsonapi.org spec.
8486
* [html-json-forms][html-json-forms] - Provides an algorithm and serializer to process HTML JSON Form submissions per the (inactive) spec.
@@ -272,3 +274,5 @@ To submit new content, [create a pull request][drf-create-pr].
272274
[drf-shapeless-serializers]: https://github.com/khaledsukkar2/drf-shapeless-serializers
273275
[django-lisan]: https://github.com/Nabute/django-lisan
274276
[axioms-drf-py]: https://github.com/abhishektiwari/axioms-drf-py
277+
[django-pydantic-field]: https://github.com/surenkov/django-pydantic-field
278+
[drf-pydantic]: https://github.com/georgebv/drf-pydantic

0 commit comments

Comments
 (0)