Skip to content

Commit

Permalink
Fix Python versions in test matrix (#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyve authored Oct 10, 2023
1 parent 787258d commit 29a0eae
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ python = ["3.11"]
[tool.hatch.envs.all.overrides]
matrix.django.dependencies = [
{value = "django~=3.2.0", if = ["3.2"]},
{value = "django~=4.0.0", if = ["4.0"]},
{value = "django~=4.1.0", if = ["4.1"]},
{value = "django~=4.2.0", if = ["4.2"]},
{value = "django @ git+https://github.com/django/django.git", if = ["main"]},
]

Expand Down
4 changes: 1 addition & 3 deletions src/bootstrap4/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ def render_alert(content, alert_type=None, dismissible=True):
if dismissible:
css_classes.append("alert-dismissible")
close = _("close")
button = (
'<button type="button" class="close" data-dismiss="alert" aria-label="{close}">&times;</button>'
).format(close=close)
button = f'<button type="button" class="close" data-dismiss="alert" aria-label="{close}">&times;</button>'
button_placeholder = "__BUTTON__"
return mark_safe(
render_tag(
Expand Down
6 changes: 2 additions & 4 deletions src/bootstrap4/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,8 @@ def render_button(
if button_type:
if button_type not in ("submit", "reset", "button", "link"):
raise BootstrapError(
(
'Parameter "button_type" should be "submit", "reset", "button", "link" or empty '
'("{button_type}" given).'
).format(button_type=button_type)
'Parameter "button_type" should be "submit", "reset", "button", "link" or empty '
f'("{button_type}" given).'
)
if button_type != "link":
attrs["type"] = button_type
Expand Down
6 changes: 1 addition & 5 deletions src/bootstrap4/templatetags/bootstrap4.py
Original file line number Diff line number Diff line change
Expand Up @@ -898,11 +898,7 @@ def get_pagination_context(
"""Generate Bootstrap pagination context from a page object."""
pages_to_show = int(pages_to_show)
if pages_to_show < 1:
raise ValueError(
"Pagination pages_to_show should be a positive integer, you specified {pages_to_show}.".format(
pages_to_show=pages_to_show
)
)
raise ValueError(f"Pagination pages_to_show should be a positive integer, you specified {pages_to_show}.")
num_pages = page.paginator.num_pages
current_page = page.number
half_page_num = int(floor(pages_to_show / 2))
Expand Down

0 comments on commit 29a0eae

Please sign in to comment.