diff -Nru python-crispy-bootstrap3-2022.1/.github/workflows/publish.yml python-crispy-bootstrap3-2024.1/.github/workflows/publish.yml
--- python-crispy-bootstrap3-2022.1/.github/workflows/publish.yml 2022-12-23 17:25:13.000000000 +0000
+++ python-crispy-bootstrap3-2024.1/.github/workflows/publish.yml 2024-01-13 09:02:24.000000000 +0000
@@ -12,7 +12,6 @@
strategy:
matrix:
python-version:
- - '3.7'
- '3.8'
- '3.9'
- '3.10'
diff -Nru python-crispy-bootstrap3-2022.1/.github/workflows/test.yml python-crispy-bootstrap3-2024.1/.github/workflows/test.yml
--- python-crispy-bootstrap3-2022.1/.github/workflows/test.yml 2022-12-23 17:25:13.000000000 +0000
+++ python-crispy-bootstrap3-2024.1/.github/workflows/test.yml 2024-01-13 09:02:24.000000000 +0000
@@ -14,7 +14,6 @@
strategy:
matrix:
python-version:
- - '3.7'
- '3.8'
- '3.9'
- '3.10'
diff -Nru python-crispy-bootstrap3-2022.1/CHANGELOG.md python-crispy-bootstrap3-2024.1/CHANGELOG.md
--- python-crispy-bootstrap3-2022.1/CHANGELOG.md 2022-12-23 17:25:13.000000000 +0000
+++ python-crispy-bootstrap3-2024.1/CHANGELOG.md 2024-01-13 09:02:24.000000000 +0000
@@ -1,5 +1,12 @@
# CHANGELOG FOR CRISPY-BOOTSTRAP3
+## 2024.1
+
+* Updated supported versions:
+ * Django 3.2, 4.2 and 5.0.
+ * Python 3.8+.
+* Fixed form-control class issue with checkboxes.
+
## 2022.1
* Initial release to move the template pack from core crispy-forms to a
diff -Nru python-crispy-bootstrap3-2022.1/crispy_bootstrap3/__init__.py python-crispy-bootstrap3-2024.1/crispy_bootstrap3/__init__.py
--- python-crispy-bootstrap3-2022.1/crispy_bootstrap3/__init__.py 2022-12-23 17:25:13.000000000 +0000
+++ python-crispy-bootstrap3-2024.1/crispy_bootstrap3/__init__.py 2024-01-13 09:02:24.000000000 +0000
@@ -1 +1 @@
-__version__ = "2022.1"
+__version__ = "2024.1"
diff -Nru python-crispy-bootstrap3-2022.1/crispy_bootstrap3/templates/bootstrap3/field.html python-crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/field.html
--- python-crispy-bootstrap3-2022.1/crispy_bootstrap3/templates/bootstrap3/field.html 2022-12-23 17:25:13.000000000 +0000
+++ python-crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/field.html 2024-01-13 09:02:24.000000000 +0000
@@ -25,11 +25,15 @@
{% endif %}
{% if not field|is_checkboxselectmultiple and not field|is_radioselect %}
- {% if field|is_checkbox and form_show_labels %}
-
+ {% endif %}
{% include 'bootstrap3/layout/help_text_and_errors.html' %}
{% else %}
diff -Nru python-crispy-bootstrap3-2022.1/debian/changelog python-crispy-bootstrap3-2024.1/debian/changelog
--- python-crispy-bootstrap3-2022.1/debian/changelog 2023-11-20 20:02:26.000000000 +0000
+++ python-crispy-bootstrap3-2024.1/debian/changelog 2024-01-24 07:35:03.000000000 +0000
@@ -1,3 +1,11 @@
+python-crispy-bootstrap3 (2024.1-1) unstable; urgency=medium
+
+ * Team upload
+ * New upstream version 2024.1
+ * Testsuite: autopkgtest-pkg-pybuild instead of debian/tests
+
+ -- Jérémy Lal
Wed, 24 Jan 2024 08:35:03 +0100
+
python-crispy-bootstrap3 (2022.1-1) unstable; urgency=low
* Initial release (Closes: #1056326).
diff -Nru python-crispy-bootstrap3-2022.1/debian/control python-crispy-bootstrap3-2024.1/debian/control
--- python-crispy-bootstrap3-2022.1/debian/control 2023-11-20 20:02:26.000000000 +0000
+++ python-crispy-bootstrap3-2024.1/debian/control 2024-01-24 07:30:12.000000000 +0000
@@ -19,6 +19,7 @@
Vcs-Browser: https://salsa.debian.org/python-team/packages/python-crispy-bootstrap3
Vcs-Git: https://salsa.debian.org/python-team/packages/python-crispy-bootstrap3.git
Rules-Requires-Root: no
+Testsuite: autopkgtest-pkg-pybuild
Package: python3-crispy-bootstrap3
Architecture: all
diff -Nru python-crispy-bootstrap3-2022.1/debian/tests/control python-crispy-bootstrap3-2024.1/debian/tests/control
--- python-crispy-bootstrap3-2022.1/debian/tests/control 2023-11-20 20:02:26.000000000 +0000
+++ python-crispy-bootstrap3-2024.1/debian/tests/control 1970-01-01 00:00:00.000000000 +0000
@@ -1,6 +0,0 @@
-Tests: upstream
-Depends:
- python3-all,
- @,
- @builddeps@,
-Restrictions: allow-stderr
diff -Nru python-crispy-bootstrap3-2022.1/debian/tests/upstream python-crispy-bootstrap3-2024.1/debian/tests/upstream
--- python-crispy-bootstrap3-2022.1/debian/tests/upstream 2023-11-20 20:02:26.000000000 +0000
+++ python-crispy-bootstrap3-2024.1/debian/tests/upstream 1970-01-01 00:00:00.000000000 +0000
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-set -e
-
-cp -r pyproject.toml tests ${AUTOPKGTEST_TMP}
-cd ${AUTOPKGTEST_TMP}
-for p in $(py3versions -s); do
- $p -m pytest
-done
diff -Nru python-crispy-bootstrap3-2022.1/tests/forms.py python-crispy-bootstrap3-2024.1/tests/forms.py
--- python-crispy-bootstrap3-2022.1/tests/forms.py 2022-12-23 17:25:13.000000000 +0000
+++ python-crispy-bootstrap3-2024.1/tests/forms.py 2024-01-13 09:02:24.000000000 +0000
@@ -82,6 +82,12 @@
)
+class SimpleCheckboxSampleForm(forms.Form):
+ is_company = forms.CharField(
+ label="company", required=False, widget=forms.CheckboxInput()
+ )
+
+
class SelectSampleForm(forms.Form):
select = forms.ChoiceField(
choices=((1, "Option one"), (2, "Option two"), (3, "Option three")),
diff -Nru python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_false_gte50.html python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_false_gte50.html
--- python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_false_gte50.html 1970-01-01 00:00:00.000000000 +0000
+++ python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_false_gte50.html 2024-01-13 09:02:24.000000000 +0000
@@ -0,0 +1,45 @@
+
diff -Nru python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_true_gte50.html python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_true_gte50.html
--- python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_true_gte50.html 1970-01-01 00:00:00.000000000 +0000
+++ python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_true_gte50.html 2024-01-13 09:02:24.000000000 +0000
@@ -0,0 +1,49 @@
+
diff -Nru python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_form_helper/test_form_show_errors_non_field_errors_false_gte50.html python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper/test_form_show_errors_non_field_errors_false_gte50.html
--- python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_form_helper/test_form_show_errors_non_field_errors_false_gte50.html 1970-01-01 00:00:00.000000000 +0000
+++ python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper/test_form_show_errors_non_field_errors_false_gte50.html 2024-01-13 09:02:24.000000000 +0000
@@ -0,0 +1,40 @@
+
\ No newline at end of file
diff -Nru python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_form_helper/test_form_show_errors_non_field_errors_true_gte50.html python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper/test_form_show_errors_non_field_errors_true_gte50.html
--- python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_form_helper/test_form_show_errors_non_field_errors_true_gte50.html 1970-01-01 00:00:00.000000000 +0000
+++ python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper/test_form_show_errors_non_field_errors_true_gte50.html 2024-01-13 09:02:24.000000000 +0000
@@ -0,0 +1,49 @@
+
\ No newline at end of file
diff -Nru python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_layout/test_layout_composition_gte50.html python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout/test_layout_composition_gte50.html
--- python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_layout/test_layout_composition_gte50.html 1970-01-01 00:00:00.000000000 +0000
+++ python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout/test_layout_composition_gte50.html 2024-01-13 09:02:24.000000000 +0000
@@ -0,0 +1,35 @@
+
\ No newline at end of file
diff -Nru python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_layout/test_second_layout_multifield_column_buttonholder_submit_div_gte50.html python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout/test_second_layout_multifield_column_buttonholder_submit_div_gte50.html
--- python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_layout/test_second_layout_multifield_column_buttonholder_submit_div_gte50.html 1970-01-01 00:00:00.000000000 +0000
+++ python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout/test_second_layout_multifield_column_buttonholder_submit_div_gte50.html 2024-01-13 09:02:24.000000000 +0000
@@ -0,0 +1,41 @@
+
\ No newline at end of file
diff -Nru python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_layout_objects/test_prepended_appended_text_gte50.html python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout_objects/test_prepended_appended_text_gte50.html
--- python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_layout_objects/test_prepended_appended_text_gte50.html 1970-01-01 00:00:00.000000000 +0000
+++ python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout_objects/test_prepended_appended_text_gte50.html 2024-01-13 09:02:24.000000000 +0000
@@ -0,0 +1,37 @@
+
\ No newline at end of file
diff -Nru python-crispy-bootstrap3-2022.1/tests/test_form_helper.py python-crispy-bootstrap3-2024.1/tests/test_form_helper.py
--- python-crispy-bootstrap3-2022.1/tests/test_form_helper.py 2022-12-23 17:25:13.000000000 +0000
+++ python-crispy-bootstrap3-2024.1/tests/test_form_helper.py 2024-01-13 09:02:24.000000000 +0000
@@ -139,6 +139,13 @@
"bootstrap3/test_form_helper/"
"test_form_show_errors_non_field_errors_true_lte40.html"
)
+ elif django.VERSION >= (5, 0):
+ # Added 'aria-describedby' for fields with help_text
+ # https://docs.djangoproject.com/en/5.0/releases/5.0/#forms
+ expected = parse_expected(
+ "bootstrap3/test_form_helper/"
+ "test_form_show_errors_non_field_errors_true_gte50.html"
+ )
else:
expected = parse_expected(
"bootstrap3/test_form_helper/"
@@ -155,6 +162,13 @@
"bootstrap3/test_form_helper/"
"test_form_show_errors_non_field_errors_false_lte40.html"
)
+ elif django.VERSION >= (5, 0):
+ # Added 'aria-describedby' for fields with help_text
+ # https://docs.djangoproject.com/en/5.0/releases/5.0/#forms
+ expected = parse_expected(
+ "bootstrap3/test_form_helper/"
+ "test_form_show_errors_non_field_errors_false_gte50.html"
+ )
else:
expected = parse_expected(
"bootstrap3/test_form_helper/"
@@ -528,14 +542,31 @@
form.is_valid()
form.helper.form_show_errors = True
- assert parse_form(form) == parse_expected(
- "bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_true.html"
- )
+ if django.VERSION >= (5, 0):
+ # Added 'aria-describedby' for fields with help_text
+ # https://docs.djangoproject.com/en/5.0/releases/5.0/#forms
+ expected = parse_expected(
+ "bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_true_gte50.html"
+ )
+ else:
+ expected = parse_expected(
+ "bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_true.html"
+ )
+ assert parse_form(form) == expected
form.helper.form_show_errors = False
- assert parse_form(form) == parse_expected(
- "bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_false.html"
- )
+ if django.VERSION >= (5, 0):
+ # Added 'aria-describedby' for fields with help_text
+ # https://docs.djangoproject.com/en/5.0/releases/5.0/#forms
+ expected = parse_expected(
+ "bootstrap3/test_form_helper/"
+ "bootstrap_form_show_errors_bs3_false_gte50.html"
+ )
+ else:
+ expected = parse_expected(
+ "bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_false.html"
+ )
+ assert parse_form(form) == expected
def test_error_text_inline(settings):
diff -Nru python-crispy-bootstrap3-2022.1/tests/test_layout.py python-crispy-bootstrap3-2024.1/tests/test_layout.py
--- python-crispy-bootstrap3-2022.1/tests/test_layout.py 2022-12-23 17:25:13.000000000 +0000
+++ python-crispy-bootstrap3-2024.1/tests/test_layout.py 2024-01-13 09:02:24.000000000 +0000
@@ -1,3 +1,4 @@
+import django
import pytest
from crispy_forms import __version__
from crispy_forms.bootstrap import Field, InlineCheckboxes
@@ -34,6 +35,7 @@
SampleForm4,
SampleForm5,
SampleForm6,
+ SimpleCheckboxSampleForm,
)
from .test_settings import TEMPLATE_DIRS
from .utils import contains_partial, parse_expected, parse_form
@@ -462,9 +464,15 @@
html = template.render(c)
# Bootstrap 4 does not contain a multifield template
- assert parse_html(html) == parse_expected(
- "bootstrap3/test_layout/test_layout_composition.html"
- )
+ if django.VERSION >= (5, 0):
+ # Added 'aria-describedby' for fields with help_text
+ # https://docs.djangoproject.com/en/5.0/releases/5.0/#forms
+ expected = parse_expected(
+ "bootstrap3/test_layout/test_layout_composition_gte50.html"
+ )
+ else:
+ expected = parse_expected("bootstrap3/test_layout/test_layout_composition.html")
+ assert parse_html(html) == expected
@override_settings(CRISPY_CLASS_CONVERTERS=CONVERTERS)
@@ -516,10 +524,19 @@
html = template.render(c)
# Bootstrap 4 does not contain a multifield template
- assert parse_html(html) == parse_expected(
- "bootstrap3/test_layout/"
- "test_second_layout_multifield_column_buttonholder_submit_div.html"
- )
+ if django.VERSION >= (5, 0):
+ # Added 'aria-describedby' for fields with help_text
+ # https://docs.djangoproject.com/en/5.0/releases/5.0/#forms
+ expected = parse_expected(
+ "bootstrap3/test_layout/"
+ "test_second_layout_multifield_column_buttonholder_submit_div_gte50.html"
+ )
+ else:
+ expected = parse_expected(
+ "bootstrap3/test_layout/"
+ "test_second_layout_multifield_column_buttonholder_submit_div.html"
+ )
+ assert parse_html(html) == expected
@override_settings(
@@ -570,6 +587,19 @@
)
+def test_no_label_checkboxes_bs3():
+ form = SimpleCheckboxSampleForm()
+ form.helper = FormHelper()
+ # no form-control class when labels are rendered
+ html = render_crispy_form(form)
+ assert html.count("form-control") == 0
+ form.helper.form_show_labels = False
+ # no labels or form-control class when labels are hidden
+ html = render_crispy_form(form)
+ assert html.count("= (5, 0):
+ # Added 'aria-describedby' for fields with help_text
+ # https://docs.djangoproject.com/en/5.0/releases/5.0/#forms
+ expected = parse_expected(
+ "bootstrap3/test_layout_objects/test_prepended_appended_text_gte50.html"
+ )
+ else:
+ expected = parse_expected(
+ "bootstrap3/test_layout_objects/test_prepended_appended_text.html"
+ )
+ assert parse_form(test_form) == expected
def test_inline_radios(self):
test_form = CheckboxesSampleForm()
diff -Nru python-crispy-bootstrap3-2022.1/tox.ini python-crispy-bootstrap3-2024.1/tox.ini
--- python-crispy-bootstrap3-2022.1/tox.ini 2022-12-23 17:25:13.000000000 +0000
+++ python-crispy-bootstrap3-2024.1/tox.ini 2024-01-13 09:02:24.000000000 +0000
@@ -1,16 +1,17 @@
[tox]
envlist =
- {py37,py38,py39,py310}-django{32}-crispy{1,-latest},
- {py38,py39,py310}-django{40,41,-latest}-crispy{1,-latest},
- {py311}-django{41,-latest}-crispy{1,-latest},
+ {py38,py39,py310}-django32-crispy1,
+ {py38,py39,py310}-django42-crispy{1,2,-latest},
+ {py311}-django{42,50}-crispy{2,-latest},
lint
[testenv]
deps =
- django32: django>=3.2,<3.3
- django40: django>=4.0a,<4.1
- django41: django>=4.1a,<4.2
+ django32: django>=3.2,<4
+ django42: django>=4.2,<5
+ django50: django>=5.0,<5.1
crispy1: django-crispy-forms<=2.0
+ crispy2: django-crispy-forms>=2.0,<3
crispy-latest: https://github.com/django-crispy-forms/django-crispy-forms/archive/main.tar.gz
-rrequirements/testing.txt
commands = python -W error::DeprecationWarning -W error::PendingDeprecationWarning -m pytest {posargs}