Skip to content

Commit a154037

Browse files
authored
Merge branch 'main' into add-unaccent-to-search-filter
2 parents 227b72f + 65aa4b8 commit a154037

184 files changed

Lines changed: 2558 additions & 16480 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/theme/src/drf-logos.fig filter=lfs diff=lfs merge=lfs -text

.github/FUNDING.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github: encode
2-
custom: https://fund.django-rest-framework.org/topics/funding/
1+
github: [browniebroke]
2+
open_collective: django-rest-framework

.github/dependabot.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,37 @@ updates:
1111
- "*" # Group all Action updates into a single larger pull request
1212
schedule:
1313
interval: weekly
14+
cooldown:
15+
default-days: 7
16+
17+
- package-ecosystem: "pip"
18+
directory: "/"
19+
20+
groups:
21+
test:
22+
patterns:
23+
- "pytest*"
24+
- "attrs"
25+
- "importlib-metadata"
26+
- "pytz"
27+
28+
docs:
29+
patterns:
30+
- "mkdocs"
31+
- "pylinkvalidator"
32+
33+
optional:
34+
patterns:
35+
- "django-filter"
36+
- "django-guardian"
37+
- "inflection"
38+
- "legacy-cgi"
39+
- "markdown"
40+
- "psycopg*"
41+
- "pygments"
42+
- "pyyaml"
43+
44+
schedule:
45+
interval: weekly
46+
cooldown:
47+
default-days: 7

.github/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- dependencies
5+
- Internal
6+
- CI
7+
- Documentation
8+
authors:
9+
- dependabot[bot]
10+
- pre-commit-ci[bot]
11+
categories:
12+
- title: Breaking changes
13+
labels:
14+
- Breaking
15+
- title: Features
16+
labels:
17+
- Feature
18+
- title: Bug fixes
19+
labels:
20+
- Bug
21+
- title: Translations
22+
labels:
23+
- Translations
24+
- title: Packaging
25+
labels:
26+
- Packaging
27+
- title: Other changes
28+
labels:
29+
- '*'

.github/workflows/main.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,24 @@ on:
66
- main
77
pull_request:
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
14+
pre-commit:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v6
18+
with:
19+
fetch-depth: 0
20+
21+
- uses: actions/setup-python@v6
22+
with:
23+
python-version: "3.10"
24+
25+
- uses: pre-commit/action@v3.0.1
26+
1027
tests:
1128
name: Python ${{ matrix.python-version }}
1229
runs-on: ubuntu-24.04
@@ -21,14 +38,13 @@ jobs:
2138
- '3.14'
2239

2340
steps:
24-
- uses: actions/checkout@v5
41+
- uses: actions/checkout@v6
2542

2643
- uses: actions/setup-python@v6
2744
with:
2845
python-version: ${{ matrix.python-version }}
2946
allow-prereleases: true
3047
cache: 'pip'
31-
cache-dependency-path: 'requirements/*.txt'
3248

3349
- name: Upgrade packaging tools
3450
run: python -m pip install --upgrade pip setuptools virtualenv wheel
@@ -53,22 +69,21 @@ jobs:
5369
name: Test documentation links
5470
runs-on: ubuntu-24.04
5571
steps:
56-
- uses: actions/checkout@v5
72+
- uses: actions/checkout@v6
5773

5874
- uses: actions/setup-python@v6
5975
with:
6076
python-version: '3.13'
6177

6278
- name: Install dependencies
63-
run: pip install -r requirements/requirements-documentation.txt
79+
run: pip install --group docs
6480

6581
# Start mkdocs server and wait for it to be ready
6682
- run: mkdocs serve &
6783
- run: WAIT_TIME=0 && until nc -vzw 2 localhost 8000 || [ $WAIT_TIME -eq 5 ]; do sleep $(( WAIT_TIME++ )); done
6884
- run: if [ $WAIT_TIME == 5 ]; then echo cannot start mkdocs server on http://localhost:8000; exit 1; fi
6985

7086
- name: Check links
71-
continue-on-error: true
7287
run: pylinkvalidate.py -P http://localhost:8000/
7388

7489
- run: echo "Done"

.github/workflows/mkdocs-deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
paths:
88
- docs/**
99
- docs_theme/**
10-
- requirements/requirements-documentation.txt
10+
- pyproject.toml
1111
- mkdocs.yml
1212
- .github/workflows/mkdocs-deploy.yml
1313

@@ -20,10 +20,10 @@ jobs:
2020
concurrency:
2121
group: ${{ github.workflow }}-${{ github.ref }}
2222
steps:
23-
- uses: actions/checkout@v5
23+
- uses: actions/checkout@v6
2424
- run: git fetch --no-tags --prune --depth=1 origin gh-pages
2525
- uses: actions/setup-python@v6
2626
with:
2727
python-version: 3.x
28-
- run: pip install -r requirements/requirements-documentation.txt
28+
- run: pip install --group docs
2929
- run: mkdocs gh-deploy

.github/workflows/pre-commit.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
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+
if: github.repository == 'encode/django-rest-framework'
27+
runs-on: ubuntu-24.04
28+
steps:
29+
- uses: actions/checkout@v6
30+
- name: Set up Python
31+
uses: actions/setup-python@v6
32+
with:
33+
python-version: "3.x"
34+
- name: Install pypa/build
35+
run: python3 -m pip install build
36+
- name: Build a binary wheel and a source tarball
37+
run: python3 -m build
38+
- name: Store the distribution packages
39+
uses: actions/upload-artifact@v7
40+
with:
41+
name: python-package-distributions
42+
path: dist/
43+
44+
publish-to-testpypi:
45+
name: Publish Python 🐍 distribution 📦 to TestPyPI
46+
needs:
47+
- build
48+
runs-on: ubuntu-24.04
49+
environment:
50+
name: testpypi
51+
url: ${{ env.PYPI_TEST_URL }}
52+
permissions:
53+
id-token: write # IMPORTANT: mandatory for trusted publishing
54+
steps:
55+
- name: Download all the dists
56+
uses: actions/download-artifact@v8
57+
with:
58+
name: python-package-distributions
59+
path: dist/
60+
- name: Publish distribution 📦 to TestPyPI
61+
uses: pypa/gh-action-pypi-publish@release/v1.13
62+
with:
63+
repository-url: https://test.pypi.org/legacy/
64+
skip-existing: true
65+
66+
publish-to-pypi:
67+
name: Publish Python 🐍 distribution 📦 to PyPI
68+
needs:
69+
- build
70+
- publish-to-testpypi
71+
runs-on: ubuntu-24.04
72+
environment:
73+
name: pypi
74+
url: ${{ env.PYPI_URL }}
75+
permissions:
76+
id-token: write # IMPORTANT: mandatory for trusted publishing
77+
steps:
78+
- name: Download all the dists
79+
uses: actions/download-artifact@v8
80+
with:
81+
name: python-package-distributions
82+
path: dist/
83+
- name: Publish distribution 📦 to PyPI
84+
uses: pypa/gh-action-pypi-publish@release/v1.13
85+
86+
github-release:
87+
name: >-
88+
Sign the Python 🐍 distribution 📦 with Sigstore
89+
and upload them to GitHub Release
90+
needs:
91+
- publish-to-pypi
92+
runs-on: ubuntu-24.04
93+
permissions:
94+
contents: write # IMPORTANT: mandatory for making GitHub Releases
95+
id-token: write # IMPORTANT: mandatory for sigstore
96+
steps:
97+
- name: Download all the dists
98+
uses: actions/download-artifact@v8
99+
with:
100+
name: python-package-distributions
101+
path: dist/
102+
- name: Sign the dists with Sigstore
103+
uses: sigstore/gh-action-sigstore-python@v3.2.0
104+
with:
105+
inputs: >-
106+
./dist/*.tar.gz
107+
./dist/*.whl
108+
- name: Create GitHub Release
109+
env:
110+
GITHUB_TOKEN: ${{ github.token }}
111+
run: >-
112+
gh release create
113+
'${{ github.ref_name }}'
114+
--repo '${{ github.repository }}'
115+
--generate-notes
116+
- name: Upload artifact signatures to GitHub Release
117+
env:
118+
GITHUB_TOKEN: ${{ github.token }}
119+
# Upload to GitHub Release using the `gh` CLI.
120+
# `dist/` contains the built packages, and the
121+
# sigstore-produced signatures and certificates.
122+
run: >-
123+
gh release upload
124+
'${{ github.ref_name }}' dist/**
125+
--repo '${{ github.repository }}'

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
*.pyc
22
*.db
33
*~
4-
.*
54
*.py.bak
65

76

@@ -14,7 +13,11 @@
1413
/env/
1514
MANIFEST
1615
coverage.*
16+
.coverage
17+
.cache/
1718

1819
!.github
1920
!.gitignore
2021
!.pre-commit-config.yaml
22+
23+
.idea

.pre-commit-config.yaml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,44 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.5.0
3+
rev: v6.0.0
44
hooks:
55
- id: check-added-large-files
66
- id: check-case-conflict
77
- id: check-json
88
- id: check-merge-conflict
99
- id: check-symlinks
1010
- id: check-toml
11-
- repo: https://github.com/pycqa/isort
12-
rev: 5.13.2
11+
- repo: https://github.com/PyCQA/isort
12+
rev: 7.0.0
1313
hooks:
1414
- id: isort
1515
- repo: https://github.com/PyCQA/flake8
16-
rev: 7.0.0
16+
rev: 7.3.0
1717
hooks:
1818
- id: flake8
1919
additional_dependencies:
2020
- flake8-tidy-imports
21+
- flake8-bugbear
2122
- repo: https://github.com/adamchainz/blacken-docs
22-
rev: 1.16.0
23+
rev: 1.20.0
2324
hooks:
2425
- id: blacken-docs
25-
exclude: ^(?!docs).*$
2626
additional_dependencies:
27-
- black==23.1.0
27+
- black==26.1.0
2828
- repo: https://github.com/codespell-project/codespell
29-
# Configuration for codespell is in .codespellrc
30-
rev: v2.2.6
29+
# Configuration for codespell is in pyproject.toml
30+
rev: v2.4.1
3131
hooks:
3232
- id: codespell
33-
exclude: locale|kickstarter-announcement.md|coreapi-0.1.1.js
3433
additional_dependencies:
3534
# python doesn't come with a toml parser prior to 3.11
3635
- "tomli; python_version < '3.11'"
37-
3836
- repo: https://github.com/asottile/pyupgrade
39-
rev: v3.19.1
37+
rev: v3.21.2
4038
hooks:
4139
- id: pyupgrade
42-
args: ["--py39-plus", "--keep-percent-format"]
43-
40+
args: ["--py310-plus", "--keep-percent-format"]
4441
- repo: https://github.com/tox-dev/pyproject-fmt
45-
rev: v2.6.0
42+
rev: v2.11.1
4643
hooks:
4744
- id: pyproject-fmt

0 commit comments

Comments
 (0)