mirror of
https://github.com/encode/django-rest-framework.git
synced 2026-02-17 20:50:35 +03:00
Merge branch 'main' into feat/mkdocs-material
# Conflicts: # requirements/requirements-documentation.txt
This commit is contained in:
commit
4efe942cd3
36
.github/dependabot.yml
vendored
36
.github/dependabot.yml
vendored
|
|
@ -11,3 +11,39 @@ updates:
|
|||
- "*" # Group all Action updates into a single larger pull request
|
||||
schedule:
|
||||
interval: weekly
|
||||
cooldown:
|
||||
default-days: 7
|
||||
|
||||
- package-ecosystem: "pip"
|
||||
directory: "/"
|
||||
|
||||
groups:
|
||||
test:
|
||||
patterns:
|
||||
- "pytest*"
|
||||
- "attrs"
|
||||
- "importlib-metadata"
|
||||
- "pytz"
|
||||
|
||||
docs:
|
||||
patterns:
|
||||
- "mkdocs"
|
||||
- "pylinkvalidator"
|
||||
|
||||
optional:
|
||||
patterns:
|
||||
- "coreapi"
|
||||
- "coreschema"
|
||||
- "django-filter"
|
||||
- "django-guardian"
|
||||
- "inflection"
|
||||
- "legacy-cgi"
|
||||
- "markdown"
|
||||
- "psycopg*"
|
||||
- "pygments"
|
||||
- "pyyaml"
|
||||
|
||||
schedule:
|
||||
interval: weekly
|
||||
cooldown:
|
||||
default-days: 7
|
||||
|
|
|
|||
8
.github/workflows/main.yml
vendored
8
.github/workflows/main.yml
vendored
|
|
@ -6,6 +6,10 @@ on:
|
|||
- main
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: Python ${{ matrix.python-version }}
|
||||
|
|
@ -28,7 +32,6 @@ jobs:
|
|||
python-version: ${{ matrix.python-version }}
|
||||
allow-prereleases: true
|
||||
cache: 'pip'
|
||||
cache-dependency-path: 'requirements/*.txt'
|
||||
|
||||
- name: Upgrade packaging tools
|
||||
run: python -m pip install --upgrade pip setuptools virtualenv wheel
|
||||
|
|
@ -60,7 +63,7 @@ jobs:
|
|||
python-version: '3.13'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install -r requirements/requirements-documentation.txt
|
||||
run: pip install --group docs
|
||||
|
||||
# Start mkdocs server and wait for it to be ready
|
||||
- run: mkdocs serve &
|
||||
|
|
@ -68,7 +71,6 @@ jobs:
|
|||
- run: if [ $WAIT_TIME == 5 ]; then echo cannot start mkdocs server on http://localhost:8000; exit 1; fi
|
||||
|
||||
- name: Check links
|
||||
continue-on-error: true
|
||||
run: pylinkvalidate.py -P http://localhost:8000/
|
||||
|
||||
- run: echo "Done"
|
||||
|
|
|
|||
4
.github/workflows/mkdocs-deploy.yml
vendored
4
.github/workflows/mkdocs-deploy.yml
vendored
|
|
@ -7,7 +7,7 @@ on:
|
|||
paths:
|
||||
- docs/**
|
||||
- docs_theme/**
|
||||
- requirements/requirements-documentation.txt
|
||||
- pyproject.toml
|
||||
- mkdocs.yml
|
||||
- .github/workflows/mkdocs-deploy.yml
|
||||
|
||||
|
|
@ -25,5 +25,5 @@ jobs:
|
|||
- uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: 3.x
|
||||
- run: pip install -r requirements/requirements-documentation.txt
|
||||
- run: pip install --group docs
|
||||
- run: mkdocs gh-deploy
|
||||
|
|
|
|||
|
|
@ -24,27 +24,21 @@ repos:
|
|||
hooks:
|
||||
- id: blacken-docs
|
||||
additional_dependencies:
|
||||
- black==25.9.0
|
||||
- black==26.1.0
|
||||
- repo: https://github.com/codespell-project/codespell
|
||||
# Configuration for codespell is in .codespellrc
|
||||
# Configuration for codespell is in pyproject.toml
|
||||
rev: v2.4.1
|
||||
hooks:
|
||||
- id: codespell
|
||||
args: [
|
||||
"--builtin", "clear,rare,code,names,en-GB_to_en-US",
|
||||
"--ignore-words", "codespell-ignore-words.txt",
|
||||
"--skip", "*.css",
|
||||
]
|
||||
exclude: locale|kickstarter-announcement.md|coreapi-0.1.1.js
|
||||
additional_dependencies:
|
||||
# python doesn't come with a toml parser prior to 3.11
|
||||
- "tomli; python_version < '3.11'"
|
||||
- repo: https://github.com/asottile/pyupgrade
|
||||
rev: v3.21.0
|
||||
rev: v3.21.2
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: ["--py310-plus", "--keep-percent-format"]
|
||||
- repo: https://github.com/tox-dev/pyproject-fmt
|
||||
rev: v2.11.0
|
||||
rev: v2.11.1
|
||||
hooks:
|
||||
- id: pyproject-fmt
|
||||
|
|
|
|||
|
|
@ -4,4 +4,7 @@ IAM
|
|||
endcode
|
||||
deque
|
||||
thead
|
||||
lets
|
||||
lets
|
||||
fo
|
||||
malcom
|
||||
ser
|
||||
|
|
@ -89,7 +89,7 @@ Note that when a request may successfully authenticate, but still be denied perm
|
|||
|
||||
## Django 5.1+ `LoginRequiredMiddleware`
|
||||
|
||||
If you're running Django 5.1+ and use the [`LoginRequiredMiddleware`][login-required-middleware], please note that all views from DRF are opted-out of this middleware. This is because the authentication in DRF is based authentication and permissions classes, which may be determined after the middleware has been applied. Additionally, when the request is not authenticated, the middleware redirects the user to the login page, which is not suitable for API requests, where it's preferable to return a 401 status code.
|
||||
If you're running Django 5.1+ and use the [`LoginRequiredMiddleware`][login-required-middleware], please note that all views from DRF are opted-out of this middleware. This is because the authentication in DRF is based on authentication and permissions classes, which may be determined after the middleware has been applied. Additionally, when the request is not authenticated, the middleware redirects the user to the login page, which is not suitable for API requests, where it's preferable to return a 401 status code.
|
||||
|
||||
REST framework offers an equivalent mechanism for DRF views via the global settings, `DEFAULT_AUTHENTICATION_CLASSES` and `DEFAULT_PERMISSION_CLASSES`. They should be changed accordingly if you need to enforce that API requests are logged in.
|
||||
|
||||
|
|
|
|||
|
|
@ -849,10 +849,6 @@ the [djangorestframework-recursive][djangorestframework-recursive] package provi
|
|||
|
||||
The [django-rest-framework-gis][django-rest-framework-gis] package provides geographic addons for django rest framework like a `GeometryField` field and a GeoJSON serializer.
|
||||
|
||||
## django-rest-framework-hstore
|
||||
|
||||
The [django-rest-framework-hstore][django-rest-framework-hstore] package provides an `HStoreField` to support [django-hstore][django-hstore] `DictionaryField` model field.
|
||||
|
||||
[cite]: https://docs.djangoproject.com/en/stable/ref/forms/api/#django.forms.Form.cleaned_data
|
||||
[html-and-forms]: ../topics/html-and-forms.md
|
||||
[FILE_UPLOAD_HANDLERS]: https://docs.djangoproject.com/en/stable/ref/settings/#std:setting-FILE_UPLOAD_HANDLERS
|
||||
|
|
@ -862,8 +858,6 @@ The [django-rest-framework-hstore][django-rest-framework-hstore] package provide
|
|||
[drf-extra-fields]: https://github.com/Hipo/drf-extra-fields
|
||||
[djangorestframework-recursive]: https://github.com/heywbj/django-rest-framework-recursive
|
||||
[django-rest-framework-gis]: https://github.com/djangonauts/django-rest-framework-gis
|
||||
[django-rest-framework-hstore]: https://github.com/djangonauts/django-rest-framework-hstore
|
||||
[django-hstore]: https://github.com/djangonauts/django-hstore
|
||||
[python-decimal-rounding-modes]: https://docs.python.org/3/library/decimal.html#rounding-modes
|
||||
[django-current-timezone]: https://docs.djangoproject.com/en/stable/topics/i18n/timezones/#default-time-zone-and-current-time-zone
|
||||
[django-docs-select-related]: https://docs.djangoproject.com/en/stable/ref/models/querysets/#django.db.models.query.QuerySet.select_related
|
||||
|
|
|
|||
|
|
@ -138,7 +138,10 @@ Provided they inherit from `rest_framework.permissions.BasePermission`, permissi
|
|||
return Response(content)
|
||||
|
||||
!!! note
|
||||
Composition of permissions supports `&` (and), `|` (or) and `~` (not) operators.
|
||||
Composition of permissions supports the `&` (and), `|` (or) and `~` (not) operators, and also allows the use of brackets `(` `)` to group expressions.
|
||||
|
||||
Operators follow the same precedence and associativity rules as standard logical operators (`~` highest, then `&`, then `|`).
|
||||
|
||||
|
||||
# API Reference
|
||||
|
||||
|
|
|
|||
|
|
@ -145,4 +145,4 @@ continued development by **[signing up for a paid plan][funding]**.
|
|||
|
||||
[legacy-core-api-docs]:https://github.com/encode/django-rest-framework/blob/3.14.0/docs/coreapi/index.md
|
||||
[sponsors]: https://fund.django-rest-framework.org/topics/funding/#our-sponsors
|
||||
[funding]: funding.md
|
||||
[funding]: https://opencollective.com/django-rest-framework
|
||||
|
|
|
|||
|
|
@ -111,4 +111,4 @@ continued development by **[signing up for a paid plan][funding]**.
|
|||
*Many thanks to all our [wonderful sponsors][sponsors], and in particular to our premium backers, [Sentry](https://getsentry.com/welcome/), [Stream](https://getstream.io/?utm_source=drf&utm_medium=banner&utm_campaign=drf), [ESG](https://software.esg-usa.com/), [Rollbar](https://rollbar.com/?utm_source=django&utm_medium=sponsorship&utm_campaign=freetrial), [Cadre](https://cadre.com), [Kloudless](https://hubs.ly/H0f30Lf0), [Lights On Software](https://lightsonsoftware.com), and [Retool](https://retool.com/?utm_source=djangorest&utm_medium=sponsorship).*
|
||||
|
||||
[sponsors]: https://fund.django-rest-framework.org/topics/funding/#our-sponsors
|
||||
[funding]: funding.md
|
||||
[funding]: https://opencollective.com/django-rest-framework
|
||||
|
|
|
|||
|
|
@ -178,4 +178,4 @@ continued development by **[signing up for a paid plan][funding]**.
|
|||
*Many thanks to all our [wonderful sponsors][sponsors], and in particular to our premium backers, [Sentry](https://getsentry.com/welcome/), [Stream](https://getstream.io/?utm_source=drf&utm_medium=banner&utm_campaign=drf), [ESG](https://software.esg-usa.com/), [Rollbar](https://rollbar.com/?utm_source=django&utm_medium=sponsorship&utm_campaign=freetrial), [Cadre](https://cadre.com), [Kloudless](https://hubs.ly/H0f30Lf0), [Lights On Software](https://lightsonsoftware.com), and [Retool](https://retool.com/?utm_source=djangorest&utm_medium=sponsorship).*
|
||||
|
||||
[sponsors]: https://fund.django-rest-framework.org/topics/funding/#our-sponsors
|
||||
[funding]: funding.md
|
||||
[funding]: https://opencollective.com/django-rest-framework
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ The full set of itemized release notes [are available here][release-notes].
|
|||
|
||||
[sponsors]: https://fund.django-rest-framework.org/topics/funding/#our-sponsors
|
||||
[moss]: mozilla-grant.md
|
||||
[funding]: funding.md
|
||||
[funding]: https://opencollective.com/django-rest-framework
|
||||
[core-api]: https://www.coreapi.org/
|
||||
[command-line-client]: https://github.com/encode/django-rest-framework/blob/3.4.7/docs/topics/api-clients.md#command-line-client
|
||||
[client-library]: https://github.com/encode/django-rest-framework/blob/3.4.7/docs/topics/api-clients.md#python-client-library
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ in version 3.3 and raised a deprecation warning in 3.4. Its usage is now mandato
|
|||
---
|
||||
|
||||
[sponsors]: https://fund.django-rest-framework.org/topics/funding/#our-sponsors
|
||||
[funding]: funding.md
|
||||
[funding]: https://opencollective.com/django-rest-framework
|
||||
[uploads]: https://core-api.github.io/python-client/api-guide/utils/#file
|
||||
[downloads]: https://core-api.github.io/python-client/api-guide/codecs/#downloadcodec
|
||||
[schema-generation-api]: ../api-guide/schemas.md#schemagenerator
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ Once work on those refinements is complete, we'll be starting feature work
|
|||
on realtime support, for the 3.7 release.
|
||||
|
||||
[sponsors]: https://fund.django-rest-framework.org/topics/funding/#our-sponsors
|
||||
[funding]: funding.md
|
||||
[funding]: https://opencollective.com/django-rest-framework
|
||||
[api-docs]: ../topics/documenting-your-api.md
|
||||
[js-docs]: https://github.com/encode/django-rest-framework/blob/3.14.0/docs/topics/api-clients.md#javascript-client-library
|
||||
[py-docs]: https://github.com/encode/django-rest-framework/blob/3.14.0/docs/topics/api-clients.md#python-client-library
|
||||
|
|
|
|||
|
|
@ -125,6 +125,6 @@ We're still planning to work on improving real-time support for REST framework b
|
|||
|
||||
This will likely be timed so that any REST framework development here ties in with similar work on [API Star][api-star].
|
||||
|
||||
[funding]: funding.md
|
||||
[funding]: https://opencollective.com/django-rest-framework
|
||||
[schema-docs]: ../api-guide/schemas.md
|
||||
[api-star]: https://github.com/encode/apistar
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ We're currently working towards moving to using [OpenAPI][openapi] as our defaul
|
|||
|
||||
We're doing some consolidation in order to make this happen. It's planned that 3.9 will drop the `coreapi` and `coreschema` libraries, and instead use `apistar` for the API documentation generation, schema generation, and API client libraries.
|
||||
|
||||
[funding]: funding.md
|
||||
[funding]: https://opencollective.com/django-rest-framework
|
||||
[gh5886]: https://github.com/encode/django-rest-framework/issues/5886
|
||||
[gh5705]: https://github.com/encode/django-rest-framework/issues/5705
|
||||
[openapi]: https://www.openapis.org/
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ web framework, which is building a foundational set of tooling for working with
|
|||
ASGI.
|
||||
|
||||
|
||||
[funding]: funding.md
|
||||
[funding]: https://opencollective.com/django-rest-framework
|
||||
[gh5886]: https://github.com/encode/django-rest-framework/issues/5886
|
||||
[gh5705]: https://github.com/encode/django-rest-framework/issues/5705
|
||||
[openapi]: https://www.openapis.org/
|
||||
|
|
|
|||
|
|
@ -75,8 +75,7 @@ To run the tests, clone the repository, and then:
|
|||
# Setup the virtual environment
|
||||
python3 -m venv env
|
||||
source env/bin/activate
|
||||
pip install -e .
|
||||
pip install -r requirements.txt
|
||||
pip install -e . --group dev
|
||||
|
||||
# Run the tests
|
||||
./runtests.py
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Jobs
|
||||
|
||||
Looking for a new Django REST Framework related role? On this site we provide a list of job resources that may be helpful. It's also worth checking out if any of [our sponsors are hiring][drf-funding].
|
||||
Looking for a new Django REST Framework related role? On this site we provide a list of job resources that may be helpful. It's also worth checking out if any of [our sponsors are hiring][sponsors].
|
||||
|
||||
|
||||
## Places to look for Django REST Framework Jobs
|
||||
|
|
@ -22,7 +22,7 @@ Looking for a new Django REST Framework related role? On this site we provide a
|
|||
|
||||
Know of any other great resources for Django REST Framework jobs that are missing in our list? Please [submit a pull request][submit-pr] or [email us][anna-email].
|
||||
|
||||
Wonder how else you can help? One of the best ways you can help Django REST Framework is to ask interviewers if their company is signed up for [REST Framework sponsorship][drf-funding] yet.
|
||||
Wonder how else you can help? One of the best ways you can help Django REST Framework is to ask interviewers if their company is signed up for [REST Framework sponsorship][sponsors] yet.
|
||||
|
||||
|
||||
[djangoproject-website]: https://www.djangoproject.com/community/jobs/
|
||||
|
|
@ -38,6 +38,6 @@ Wonder how else you can help? One of the best ways you can help Django REST Fram
|
|||
[remoteok-com]: https://remoteok.com/remote-django-jobs
|
||||
[remotepython-com]: https://www.remotepython.com/jobs/
|
||||
[pyjobs-com]: https://www.pyjobs.com/
|
||||
[drf-funding]: https://fund.django-rest-framework.org/topics/funding/
|
||||
[sponsors]: https://fund.django-rest-framework.org/topics/funding/#our-sponsors
|
||||
[submit-pr]: https://github.com/encode/django-rest-framework
|
||||
[anna-email]: mailto:anna@django-rest-framework.org
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ at the end of May 2016.
|
|||
I have formed a UK limited company, [Encode](https://www.encode.io/), which will
|
||||
act as the business entity behind REST framework. I will be issuing monthly reports
|
||||
from Encode on progress both towards the Mozilla grant, and for development time
|
||||
funded via the [REST framework paid plans](funding.md).
|
||||
funded via the REST framework paid plans.
|
||||
|
||||
<!-- Begin MailChimp Signup Form -->
|
||||
<link href="//cdn-images.mailchimp.com/embedcode/classic-10_7.css" rel="stylesheet" type="text/css">
|
||||
|
|
|
|||
|
|
@ -81,14 +81,6 @@ When pushing the release to PyPI ensure that your environment has been installed
|
|||
|
||||
---
|
||||
|
||||
## Project requirements
|
||||
|
||||
All our test requirements are pinned to exact versions, in order to ensure that our test runs are reproducible. We maintain the requirements in the `requirements` directory. The requirements files are referenced from the `tox.ini` configuration file, ensuring we have a single source of truth for package versions used in testing.
|
||||
|
||||
Package upgrades should generally be treated as isolated pull requests. You can check if there are any packages available at a newer version, by using the `pip list --outdated`.
|
||||
|
||||
---
|
||||
|
||||
## Project ownership
|
||||
|
||||
The PyPI package is owned by `@tomchristie`. As a backup `@j4mie` also has ownership of the package.
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 82 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 131 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 209 KiB |
|
|
@ -68,7 +68,7 @@ each Python and Django series.
|
|||
|
||||
The following packages are optional:
|
||||
|
||||
* [PyYAML][pyyaml], [uritemplate][uriteemplate] (5.1+, 3.0.0+) - Schema generation support.
|
||||
* [PyYAML][pyyaml], [uritemplate][uritemplate] (5.1+, 3.0.0+) - Schema generation support.
|
||||
* [Markdown][markdown] (3.3.0+) - Markdown support for the browsable API.
|
||||
* [Pygments][pygments] (2.7.0+) - Add syntax highlighting to Markdown processing.
|
||||
* [django-filter][django-filter] (1.0.1+) - Filtering support.
|
||||
|
|
@ -221,7 +221,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
[heroku]: https://www.heroku.com/
|
||||
[eventbrite]: https://www.eventbrite.co.uk/about/
|
||||
[pyyaml]: https://pypi.org/project/PyYAML/
|
||||
[uriteemplate]: https://pypi.org/project/uritemplate/
|
||||
[uritemplate]: https://pypi.org/project/uritemplate/
|
||||
[markdown]: https://pypi.org/project/Markdown/
|
||||
[pygments]: https://pypi.org/project/Pygments/
|
||||
[django-filter]: https://pypi.org/project/django-filter/
|
||||
|
|
|
|||
|
|
@ -4,10 +4,11 @@
|
|||
>
|
||||
> — Roy Fielding, [REST APIs must be hypertext driven][cite]
|
||||
|
||||
REST framework provides a range of different choices for documenting your API. The following
|
||||
is a non-exhaustive list of the most popular ones.
|
||||
REST framework provides a range of different choices for documenting your API. The following is a non-exhaustive list of some of the most popular options.
|
||||
|
||||
## Third party packages for OpenAPI support
|
||||
## Third-party packages for OpenAPI support
|
||||
|
||||
REST framework recommends using third-party packages for generating and presenting OpenAPI schemas, as they provide more features and flexibility than the built-in (deprecated) implementation.
|
||||
|
||||
### drf-spectacular
|
||||
|
||||
|
|
@ -37,9 +38,9 @@ This also translates into a very useful interactive documentation viewer in the
|
|||
|
||||
## Built-in OpenAPI schema generation (deprecated)
|
||||
|
||||
**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.
|
||||
As replacement, we recommend using the [drf-spectacular](#drf-spectacular) package.**
|
||||
!!! warning
|
||||
**Deprecation notice:** REST framework's built-in support for generating OpenAPI schemas is deprecated in favor of third-party packages that provide this functionality instead. As a replacement, we recommend using **drf-spectacular**.
|
||||
|
||||
|
||||
There are a number of packages available that allow you to generate HTML
|
||||
documentation pages from OpenAPI schemas.
|
||||
|
|
|
|||
|
|
@ -31,13 +31,57 @@ classifiers = [
|
|||
"Topic :: Internet :: WWW/HTTP",
|
||||
]
|
||||
dynamic = [ "version" ]
|
||||
|
||||
dependencies = [ "django>=4.2" ]
|
||||
urls.Changelog = "https://www.django-rest-framework.org/community/release-notes/"
|
||||
urls.Funding = "https://fund.django-rest-framework.org/topics/funding/"
|
||||
urls.Homepage = "https://www.django-rest-framework.org"
|
||||
urls.Source = "https://github.com/encode/django-rest-framework"
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
{ include-group = "docs" },
|
||||
{ include-group = "optional" },
|
||||
{ include-group = "test" },
|
||||
]
|
||||
test = [
|
||||
"importlib-metadata<9.0",
|
||||
|
||||
# Pytest for running the tests.
|
||||
"pytest==9.*",
|
||||
"pytest-cov==7.*",
|
||||
"pytest-django>=4.5.2,<5",
|
||||
|
||||
# Remove when dropping support for Django<5.0
|
||||
"pytz",
|
||||
]
|
||||
docs = [
|
||||
# MkDocs to build our documentation.
|
||||
"mkdocs==1.6.1",
|
||||
# pylinkvalidator to check for broken links in documentation.
|
||||
"pylinkvalidator==0.3",
|
||||
]
|
||||
optional = [
|
||||
# Optional packages which may be used with REST framework.
|
||||
"coreapi==2.3.3",
|
||||
"coreschema==0.0.4",
|
||||
"django-filter",
|
||||
"django-guardian>=2.4.0,<3.3",
|
||||
"inflection==0.5.1",
|
||||
"legacy-cgi; python_version>='3.13'",
|
||||
"markdown>=3.3.7",
|
||||
"psycopg[binary]>=3.1.8",
|
||||
"pygments>=2.17,<2.20",
|
||||
"pyyaml>=5.3.1,<6.1",
|
||||
# setuptools is needed for coreapi (imports pkg_resources)
|
||||
"setuptools",
|
||||
]
|
||||
django42 = [ "django>=4.2,<5.0" ]
|
||||
django50 = [ "django>=5.0,<5.1" ]
|
||||
django51 = [ "django>=5.1,<5.2" ]
|
||||
django52 = [ "django>=5.2,<6.0" ]
|
||||
django60 = [ "django>=6.0,<6.1" ]
|
||||
djangomain = [ "django @ https://github.com/django/django/archive/main.tar.gz" ]
|
||||
|
||||
[tool.setuptools]
|
||||
|
||||
[tool.setuptools.dynamic]
|
||||
|
|
@ -63,16 +107,21 @@ known_first_party = [ "rest_framework", "tests" ]
|
|||
|
||||
[tool.codespell]
|
||||
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
|
||||
skip = "*/kickstarter-announcement.md,*.js,*.map,*.po"
|
||||
ignore-words-list = "fo,malcom,ser"
|
||||
skip = "*/kickstarter-announcement.md,*.js,*.map,*.po,*.css,locale"
|
||||
ignore-words = "codespell-ignore-words.txt"
|
||||
builtin = "clear,rare,code,names,en-GB_to_en-US"
|
||||
|
||||
[tool.pyproject-fmt]
|
||||
max_supported_python = "3.14"
|
||||
keep_full_version = true
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
addopts = "--tb=short --strict-markers -ra"
|
||||
testpaths = [ "tests" ]
|
||||
filterwarnings = [ "ignore:CoreAPI compatibility is deprecated*:rest_framework.RemovedInDRF318Warning" ]
|
||||
filterwarnings = [
|
||||
"ignore:CoreAPI compatibility is deprecated*:rest_framework.RemovedInDRF318Warning",
|
||||
"ignore:'cgi' is deprecated:DeprecationWarning",
|
||||
]
|
||||
|
||||
[tool.coverage.run]
|
||||
# NOTE: source is ignored with pytest-cov (but uses the same).
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
# The base set of requirements for REST framework is actually
|
||||
# just Django and pytz, but for the purposes of development
|
||||
# and testing there are a number of packages that are useful
|
||||
# to install.
|
||||
|
||||
# Laying these out as separate requirements files, allows us to
|
||||
# only included the relevant sets when running tox, and ensures
|
||||
# we are only ever declaring our dependencies in one place.
|
||||
|
||||
-r requirements/requirements-optionals.txt
|
||||
-r requirements/requirements-testing.txt
|
||||
-r requirements/requirements-documentation.txt
|
||||
-r requirements/requirements-packaging.txt
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
# MkDocs to build our documentation.
|
||||
mkdocs==1.6.0
|
||||
mkdocs-material[imaging]==9.7.0
|
||||
# pylinkvalidator to check for broken links in documentation.
|
||||
pylinkvalidator==0.3
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# Optional packages which may be used with REST framework.
|
||||
coreapi==2.3.1
|
||||
coreschema==0.0.4
|
||||
django-filter
|
||||
django-guardian>=2.4.0,<2.5
|
||||
inflection==0.5.1
|
||||
legacy-cgi; python_version>="3.13"
|
||||
markdown>=3.3.7
|
||||
psycopg[binary]>=3.1.8
|
||||
pygments~=2.17.0
|
||||
pyyaml>=5.3.1,<5.4
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
# Wheel for PyPI installs.
|
||||
wheel>=0.36.2,<0.40.0
|
||||
|
||||
# Twine for secured PyPI uploads.
|
||||
twine>=3.4.2,<4.0.2
|
||||
|
||||
# Transifex client for managing translation resources.
|
||||
transifex-client
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# Pytest for running the tests.
|
||||
pytest>=7.0.1,<8.0
|
||||
pytest-cov>=4.0.0,<5.0
|
||||
pytest-django>=4.5.2,<5.0
|
||||
importlib-metadata<5.0
|
||||
# temporary pin of attrs
|
||||
attrs==22.1.0
|
||||
pytz # Remove when dropping support for Django<5.0
|
||||
setuptools>=77.0.3
|
||||
40
tox.ini
40
tox.ini
|
|
@ -10,40 +10,40 @@ envlist =
|
|||
docs
|
||||
|
||||
[testenv]
|
||||
commands = python -W error::DeprecationWarning -W error::PendingDeprecationWarning runtests.py --coverage {posargs}
|
||||
commands = pytest --cov --cov-report xml {posargs}
|
||||
envdir = {toxworkdir}/venvs/{envname}
|
||||
setenv =
|
||||
PYTHONDONTWRITEBYTECODE=1
|
||||
PYTHONWARNINGS=once
|
||||
deps =
|
||||
django42: Django>=4.2,<5.0
|
||||
django50: Django>=5.0,<5.1
|
||||
django51: Django>=5.1,<5.2
|
||||
django52: Django>=5.2,<6.0
|
||||
django60: Django>=6.0,<6.1
|
||||
djangomain: https://github.com/django/django/archive/main.tar.gz
|
||||
-rrequirements/requirements-testing.txt
|
||||
-rrequirements/requirements-optionals.txt
|
||||
dependency_groups =
|
||||
test
|
||||
optional
|
||||
django42: django42
|
||||
django50: django50
|
||||
django51: django51
|
||||
django52: django52
|
||||
django60: django60
|
||||
djangomain: djangomain
|
||||
|
||||
[testenv:base]
|
||||
; Ensure optional dependencies are not required
|
||||
dependency_groups =
|
||||
test
|
||||
deps =
|
||||
django<6.1
|
||||
-rrequirements/requirements-testing.txt
|
||||
|
||||
[testenv:dist]
|
||||
commands = python -W error::DeprecationWarning -W error::PendingDeprecationWarning runtests.py --no-pkgroot --staticfiles {posargs}
|
||||
deps =
|
||||
django<6.1
|
||||
-rrequirements/requirements-testing.txt
|
||||
-rrequirements/requirements-optionals.txt
|
||||
dependency_groups =
|
||||
test
|
||||
optional
|
||||
|
||||
[testenv:docs]
|
||||
skip_install = true
|
||||
commands = mkdocs build
|
||||
deps =
|
||||
-rrequirements/requirements-testing.txt
|
||||
-rrequirements/requirements-documentation.txt
|
||||
commands =
|
||||
mkdocs build
|
||||
dependency_groups =
|
||||
test
|
||||
docs
|
||||
|
||||
[testenv:py312-djangomain]
|
||||
ignore_outcome = true
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user