Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"

steps:
- uses: actions/checkout@v3
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG FOR CRISPY-BOOTSTRAP5

## 2025.11 (TBC)
* Confirmed support for Django 6.0.
* Added support for Python 3.14.
* Dropped support for Python 3.8.

## 2025.6 (2025-06-08)
* `<legend>` elements now have `fs-6` class so they are the same font size as `<labels>`.

Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,24 @@ description="Bootstrap5 template pack for django-crispy-forms"
readme = "README.md"
license = {text = "MIT"}
authors = [{name = "David Smith"}]
requires-python = ">=3.8"
requires-python = ">=3.9"
classifiers=[
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Framework :: Django :: 5.1",
"Framework :: Django :: 5.2",
"Framework :: Django :: 6.0",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Software Development :: Libraries :: Python Modules",
Expand Down
4 changes: 3 additions & 1 deletion tests/results/test_clearable_file_field.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<form method="post" enctype="multipart/form-data">
<div id="div_id_clearable_file" class="mb-3">
<label for="id_clearable_file" class="form-label">Clearable file</label>
<fieldset>
<legend for="id_clearable_file" class="form-label fs-6">Clearable file</legend>
<div class="input-group mb-2">
<span class="input-group-text">Currently</span>
<div class="form-control d-flex h-auto">
Expand All @@ -19,5 +20,6 @@
<div>
<input type="file" name="clearable_file" class="form-control" id="id_clearable_file">
</div>
</fieldset>
</div>
</form>
7 changes: 4 additions & 3 deletions tests/results/test_clearable_file_field_failing.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<form method="post" enctype="multipart/form-data">
<div id="div_id_clearable_file" class="mb-3">
<label for="id_clearable_file" class="form-label requiredField">
<fieldset aria-describedby="id_clearable_file_error">
<legend for="id_clearable_file" class="form-label fs-6 requiredField">
Clearable file
<span class="asteriskField">*</span>
</label>
</legend>
<div class="is-invalid">
<input
aria-describedby="id_clearable_file_error"
type="file"
name="clearable_file"
class="form-control is-invalid"
Expand All @@ -20,5 +20,6 @@
</span>
</div>
</div>
</fieldset>
</div>
</form>
24 changes: 24 additions & 0 deletions tests/results/test_clearable_file_field_failing_lt60.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<form method="post" enctype="multipart/form-data">
<div id="div_id_clearable_file" class="mb-3">
<label for="id_clearable_file" class="form-label requiredField">
Clearable file
<span class="asteriskField">*</span>
</label>
<div class="is-invalid">
<input
aria-describedby="id_clearable_file_error"
type="file"
name="clearable_file"
class="form-control is-invalid"
id="id_clearable_file"
required
aria-invalid="true"
>
<div id="id_clearable_file_error" class="invalid-feedback">
<span id="error_1_id_clearable_file">
<strong>This field is required.</strong>
</span>
</div>
</div>
</div>
</form>
23 changes: 23 additions & 0 deletions tests/results/test_clearable_file_field_lt60.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<form method="post" enctype="multipart/form-data">
<div id="div_id_clearable_file" class="mb-3">
<label for="id_clearable_file" class="form-label">Clearable file</label>
<div class="input-group mb-2">
<span class="input-group-text">Currently</span>
<div class="form-control d-flex h-auto">
<span class="text-break flex-grow-1">
<a href="something"></a>
</span>
<span class="align-self-center ml-2">
<span class="form-check">
<input type="checkbox" name="clearable_file-clear" id="clearable_file-clear_id"
class="form-check-input">
<label class="form-check-label mb-0" for="clearable_file-clear_id">Clear</label>
</span>
</span>
</div>
</div>
<div>
<input type="file" name="clearable_file" class="form-control" id="id_clearable_file">
</div>
</div>
</form>
7 changes: 6 additions & 1 deletion tests/test_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,10 @@ def test_file_field():
form.helper = FormHelper()
form.helper.layout = Layout("clearable_file")

assert parse_form(form) == parse_expected("test_clearable_file_field.html")
if django.VERSION < (6, 0):
assert parse_form(form) == parse_expected("test_clearable_file_field_lt60.html")
else:
assert parse_form(form) == parse_expected("test_clearable_file_field.html")

form.helper.layout = Layout("file_field")

Expand All @@ -621,6 +624,8 @@ def test_file_field():
expected = "test_clearable_file_field_failing_lt50.html"
elif django.VERSION < (5, 2):
expected = "test_clearable_file_field_failing_lt52.html"
elif django.VERSION < (6, 0):
expected = "test_clearable_file_field_failing_lt60.html"
else:
expected = "test_clearable_file_field_failing.html"
assert parse_form(form) == parse_expected(expected)
Expand Down
9 changes: 6 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[tox]
envlist =
{py38,py39,py310,py311}-django{42}-crispy{-release,-latest},
{py310,py311,py312}-django{50,51,52,-latest}-crispy{-release,-latest},
{py313}-django{51,52,-latest}-crispy{-release,-latest},
{py39,py310,py311}-django{42}-crispy{-release,-latest},
{py310,py311}-django{50,51,52}-crispy{-release,-latest},
{py312}-django{50,51,52,60,-latest}-crispy{-release,-latest},
{py313}-django{51,52,60,-latest}-crispy{-release,-latest},
{py314}-django{52,60,-latest}-crispy{-release,-latest},
lint

[testenv]
Expand All @@ -13,6 +15,7 @@ deps =
django50: django>=5.0a1,<5.1
django51: django>=5.1a1,<5.2
django52: django>=5.2a1,<5.3
django60: django>=6.0a1,<6.1
crispy-release: django-crispy-forms>=2.3
crispy-latest: https://github.com/django-crispy-forms/django-crispy-forms/archive/main.tar.gz
dependency_groups = test
Expand Down