Skip to content

Commit

Permalink
Drop support for django < 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
kalekseev committed Oct 2, 2023
1 parent ed9df08 commit a3e5636
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 39 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,13 @@ jobs:
# https://github.com/actions/python-versions/blob/main/versions-manifest.json
python-version: [3.8, 3.9, "3.10", "3.11", "3.12.0-rc.3"]
django-version:
- "Django>=3.2,<4.0"
- "Django>=4.1,<4.2"
- "Django>=4.2,<5.0"
- "Django>=5.0a1,<5.1"
# - "https://github.com/django/django/archive/main.tar.gz"
include:
- drf: djangorestframework
python-version: "3.11"
django-version: "Django<4.2,>=4.1" # must be different from django-version
- django-version: "Django<4.0,>=3.2"
python-version: 3.7
django-version: "Django<5.0,>=4.2" # must be different from django-version
exclude:
- django-version: "Django>=5.0a1,<5.1"
python-version: 3.8
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

### Unreleased

- Drop python 3.6 support
- Remove `field-boolean-null`
- Deprecate `no-index-together`
- Drop support for python < 3.8
- Drop support for django < 4.2

### 0.13.3

Expand Down
2 changes: 1 addition & 1 deletion src/extra_checks/check_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CheckId(str, enum.Enum):
X053 = "field-help-text-gettext"
X054 = "field-file-upload-to"
X055 = "field-text-null"
X056 = "field-boolean-null"
# X056 = "field-boolean-null" - removed
X057 = "field-null"
X058 = "field-foreign-key-db-index"
X059 = "field-default-null"
Expand Down
18 changes: 0 additions & 18 deletions src/extra_checks/checks/model_field_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,24 +163,6 @@ def apply(
)


@registry.register(django.core.checks.Tags.models)
class CheckFieldNullBoolean(CheckModelField):
Id = CheckId.X056
deprecation_warnings = [
"`field-boolean-null` check is deprecated and will be removed in version 0.14.0"
]

def apply(
self, field: models.fields.Field, **kwargs: Any
) -> Iterator[django.core.checks.CheckMessage]:
if isinstance(field, models.NullBooleanField):
yield self.message(
f'Field "{field.name}" should be `BooleanField` with attribute `null=True`.',
hint="Replace `NullBooleanField` by `BooleanField` with attribute `null=True`.",
obj=field,
)


@registry.register(django.core.checks.Tags.models)
class CheckFieldNullFalse(CheckModelField):
Id = CheckId.X057
Expand Down
14 changes: 0 additions & 14 deletions tests/test_model_field_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,6 @@ def test_check_field_verbose_name_gettext_check_case():
assert not is_invalid("abc / def")


def test_check_field_null_boolean(test_case):
messages = (
test_case.models(models.ModelFieldNullFalse)
.settings({"checks": [model_field_checks.CheckFieldNullBoolean.Id.value]})
.check(model_field_checks.CheckFieldNullBoolean)
.run()
)
assert len(messages) == 1
assert messages[0].id == model_field_checks.CheckFieldNullBoolean.Id.name
assert {m.obj.name for m in messages} == {
"null_fail",
}


def test_check_field_help_text_gettext(test_case):
messages = (
test_case.settings(
Expand Down

0 comments on commit a3e5636

Please sign in to comment.