Skip to content

Commit

Permalink
feat: add Django 5.1 support for Django package (#783)
Browse files Browse the repository at this point in the history
  • Loading branch information
browniebroke authored Aug 6, 2024
1 parent 835f81a commit 4d8ca93
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
1 change: 0 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions project/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ classifiers = [
"Framework :: Django",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Framework :: Django :: 5.1",
{%- endif %}
"Topic :: Software Development :: Libraries",
]
Expand Down
7 changes: 4 additions & 3 deletions project/{% if is_django_package %}tox.ini{% endif %}.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ isolated_build = true
requires =
tox>=4.2
env_list =
py312-django{50,42}
py311-django{50,42}
py310-django{50,42}
py312-django{51,50,42}
py311-django{51,50,42}
py310-django{51,50,42}
py39-django{42}
py38-django{42}

Expand All @@ -17,6 +17,7 @@ deps =
# poetry export --without-hashes --only=dev --format=requirements.txt --output=requirements-dev.txt
-r requirements-dev.txt
# All supported Django versions
django51: Django>=5.1a1,<5.2
django50: Django>=5.0,<5.1
django42: Django>=4.2,<5.0
commands =
Expand Down
8 changes: 7 additions & 1 deletion tests/test_generate_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,12 @@ def test_django_package_yes(
expected_strs=["Add the app to your `INSTALLED_APPS`:"],
)
_check_file_contents(
dst_path / "tox.ini", expected_strs=["django42: Django>=4.2,<5.0"]
dst_path / "tox.ini",
expected_strs=[
"django42: Django>=4.2,<5.0",
"django50: Django>=5.0,<5.1",
"django51: Django>=5.1a1,<5.2",
],
)
_check_file_contents(
dst_path / ".gitignore", expected_strs=["requirements-dev.txt"]
Expand Down Expand Up @@ -356,6 +361,7 @@ def test_django_package_no(
unexpect_strs=[
'"Framework :: Django :: 4.2",',
'"Framework :: Django :: 5.0",',
'"Framework :: Django :: 5.1",',
'django = ">=4.2"',
'pytest-django = "^4.5"',
"django_find_project = false",
Expand Down

0 comments on commit 4d8ca93

Please sign in to comment.