Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ jobs:
- '3.9'
- '3.10'
- '3.11'
- '3.12'

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
Expand All @@ -49,7 +50,7 @@ jobs:
run: tox --py current

- name: Run extra tox targets
if: ${{ matrix.python-version == '3.9' }}
if: ${{ matrix.python-version == '3.x' }}
run: |
tox -e base,dist,docs

Expand All @@ -61,11 +62,11 @@ jobs:
name: Test documentation links
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.x'

- name: Install dependencies
run: pip install -r requirements/requirements-documentation.txt
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.11"

- uses: pre-commit/[email protected]
with:
Expand Down
5 changes: 4 additions & 1 deletion rest_framework/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import uuid
from collections.abc import Mapping
from enum import Enum
from sys import version_info

from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
Expand Down Expand Up @@ -866,7 +867,9 @@ def __init__(self, protocol='both', **kwargs):
self.protocol = protocol.lower()
self.unpack_ipv4 = (self.protocol == 'both')
super().__init__(**kwargs)
validators, error_message = ip_address_validators(protocol, self.unpack_ipv4)
validators = ip_address_validators(protocol, self.unpack_ipv4)
if version_info < (3, 12): # encode/django-rest-framework#9180
validators = validators[0] # Used to return a tuple: validators, error_message
self.validators.extend(validators)

def to_internal_value(self, data):
Expand Down
18 changes: 11 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ envlist =
{py36,py37,py38,py39}-django30
{py36,py37,py38,py39}-django31
{py36,py37,py38,py39,py310}-django32
{py38,py39,py310}-{django40,django41,django42,djangomain}
{py38,py39}-{django40,django41,django42}
{py310}-{django40,django41,django42,djangomain}
{py311}-{django41,django42,djangomain}
{py312}-{django42,djangomain}
; To enable Django 5.0 testing, uncomment the following lines
; {py310}-{django40,django41,django42,django50,djangomain}
; {py311}-{django41,django42,django50,djangomain}
; {py312}-{django42,django50,djangomain}
base
dist
docs
Expand All @@ -22,6 +28,7 @@ deps =
django40: Django>=4.0,<4.1
django41: Django>=4.1,<4.2
django42: Django>=4.2,<5.0
django50: Django>=5.0,<5.1
djangomain: https://github.com/django/django/archive/main.tar.gz
-rrequirements/requirements-testing.txt
-rrequirements/requirements-optionals.txt
Expand All @@ -46,14 +53,11 @@ deps =
-rrequirements/requirements-testing.txt
-rrequirements/requirements-documentation.txt

[testenv:py38-djangomain]
ignore_outcome = true

[testenv:py39-djangomain]
ignore_outcome = true

[testenv:py310-djangomain]
ignore_outcome = true

[testenv:py311-djangomain]
ignore_outcome = true

[testenv:py312-djangomain]
ignore_outcome = true