Skip to content

Commit

Permalink
Django 4.2 + Python 3.8 (#254)
Browse files Browse the repository at this point in the history
I was trying to figure out why [`Form.get_context()`](https://docs.djangoproject.com/en/4.2/ref/forms/api/#get-context) wasn't getting detected, and realized that sometime between Django 3.2 LTS and Django 4.2 LTS, `BaseForm` became a subclass of `django.forms.utils.RenderableFormMixin`, which doesn't exist in Django 3.2 LTS.

I upgraded both Python and Django to the next major supported version. As a justification for the upgrade, both [Django 3.2](https://www.djangoproject.com/download/#unsupported-versions) and [Python 3.7](https://peps.python.org/pep-0537/#schedule-last-security-only-release) have reached end-of-life and are no longer supported.

What do you think? This should make it easier to keep up with Django's library changes.
  • Loading branch information
noelleleigh authored Jun 20, 2024
1 parent 4ced894 commit f8b2629
Show file tree
Hide file tree
Showing 7 changed files with 199 additions and 227 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: "3.7"
python-version: "3.8"
cache: "poetry"

- name: Install python dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: "3.7"
python-version: "3.8"
cache: "poetry"

- name: Use Node.js
Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.7.13
3.8.19
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Changed

- Dropped support for Python < 3.8 ([Python 3.7 reached end-of-life on 2023-06-06](https://peps.python.org/pep-0537/#schedule-last-security-only-release))
- Dropped support for Django < 4.2 LTS ([Django 3.2 LTS left extended support on 2024-04-01](https://www.djangoproject.com/download/#unsupported-versions))

## 0.5.2 - 2021-04-13

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions django-stubs/db/models/fields/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class PositiveIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField[_I]):

class PositiveSmallIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField[_I]):
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
name: str | None = ...,
Expand Down Expand Up @@ -945,7 +945,7 @@ _B = TypeVar("_B", bound=bool | None)

class BooleanField(Generic[_B], Field[_B | Combinable, _B]):
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
name: str | None = ...,
Expand Down
407 changes: 187 additions & 220 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ keywords = ["django", "types", "mypy", "stubs"]
packages = [{ include = "django-stubs" }]

[tool.poetry.dependencies]
python = "^3.7"
python = "^3.8"
types-psycopg2 = ">=2.9.21.13"

[tool.poetry.dev-dependencies]
Expand All @@ -20,7 +20,7 @@ pytest = "7.1.1"
wheel = "0.35.1"
mypy = "1.2.0"
isort = "5.10.1"
Django = "3.1.7"
Django = "4.2.13"
flake8 = "4.0.1"
flake8-pyi = "^20.10.0"
types-PyYAML = "^6.0.1"
Expand Down

0 comments on commit f8b2629

Please sign in to comment.