Skip to content

Commit 5433763

Browse files
fix(deps): update all minor dependencies (#404)
* fix(deps): update all minor dependencies * No python bump, fix awscli version mismatch * Formatting because Ruff was updated * Add Ruff formatting commit to ignore list * Keep waffles at python 3.12 for now --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: wbanks <william.banks@cds-snc.ca>
1 parent 31c2f71 commit 5433763

10 files changed

Lines changed: 183 additions & 188 deletions

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@
99
98dbf4c5234239e761375402a87a17ee07acc0d0
1010
# Ruff formatter https://github.com/cds-snc/notification-utils/commit/56c2f9ff16038e1c6eb63979d5166e08110d3ec9
1111
56c2f9ff16038e1c6eb63979d5166e08110d3ec9
12+
# Updated Ruff formatter
13+
14fe357b78af00835a592d61301b3171677208ca

notifications_utils/formatters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def make_quotes_smart(value):
247247
def replace_hyphens_with_en_dashes(value):
248248
return re.sub(
249249
hyphens_surrounded_by_spaces,
250-
(" " "\u2013" " "), # space # en dash # space
250+
(" \u2013 "), # space # en dash # space
251251
value,
252252
)
253253

notifications_utils/logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from flask.ctx import has_request_context
1212
from pythonjsonlogger.jsonlogger import JsonFormatter as BaseJSONFormatter
1313

14-
LOG_FORMAT = "%(asctime)s %(app_name)s %(name)s %(levelname)s " '%(request_id)s "%(message)s" [in %(pathname)s:%(lineno)d]'
14+
LOG_FORMAT = '%(asctime)s %(app_name)s %(name)s %(levelname)s %(request_id)s "%(message)s" [in %(pathname)s:%(lineno)d]'
1515
TIME_FORMAT = "%Y-%m-%dT%H:%M:%S"
1616

1717
regex_pattern_for_replace_api_signed_secret = "[a-zA-Z0-9]{51}\.[a-zA-Z0-9-_]{27}" # noqa: W605

poetry.lock

Lines changed: 96 additions & 89 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ build-backend = "poetry.core.masonry.api"
1414
[tool.poetry.dependencies]
1515
python = "~3.12.7"
1616
# required by both api and admin
17-
awscli = "1.44.55"
17+
awscli = "1.45.59"
1818
bleach = "6.3.0"
19-
boto3 = "1.42.65"
19+
boto3 = "1.43.54"
2020
cachetools = "4.2.4"
2121

2222
# Pinned dependencies
@@ -46,21 +46,21 @@ beautifulsoup4 = "^4.12.3"
4646
click = "8.3.1"
4747
fakeredis = "^2.24.1"
4848
freezegun = "1.5.5"
49-
mypy = "1.19.1"
49+
mypy = "1.20.2"
5050
pytest = "7.4.4"
5151
pytest-cov = "2.12.1"
5252
pytest-mock = "3.15.1"
5353
pytest-xdist = "2.5.0"
5454
requests-mock = "1.12.1"
55-
ruff = "^0.8.2"
55+
ruff = "^0.15.0"
5656
types-beautifulsoup4 = "^4.12.0.20240229"
5757
types-bleach = "5.0.3.1"
5858
types-cachetools = "5.5.0.20240820"
5959
types-python-dateutil = "2.9.0.20260518"
6060
types-pytz = "2022.7.1.2"
6161
types-PyYAML = "6.0.12.20260518"
6262
types-redis = "4.6.0.20241004"
63-
types-requests = "2.32.4.20250913"
63+
types-requests = "2.33.0.20260712"
6464

6565
[tool.ruff]
6666
target-version = "py310"

tests/test_field.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,7 @@ def test_replacement_of_placeholders(template_content: str, data: Dict[str, Any]
9090
(
9191
"Hey ((name)), click http://example.com/reset-password/?token=((token))",
9292
{"name": "Example"},
93-
(
94-
"Hey Example, click "
95-
"http://example.com/reset-password/?token="
96-
"<mark class='placeholder-redacted'>[hidden]</mark>"
97-
),
93+
("Hey Example, click http://example.com/reset-password/?token=<mark class='placeholder-redacted'>[hidden]</mark>"),
9894
),
9995
],
10096
)
@@ -206,7 +202,7 @@ def test_handling_of_missing_values(content, values, expected):
206202
99.99999,
207203
"off",
208204
"exclude",
209-
"no" "any random string",
205+
"noany random string",
210206
"false",
211207
False,
212208
[],

tests/test_formatters.py

Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def render(i):
7676
def test_makes_links_out_of_URLs(url):
7777
link = '<a style="word-wrap: break-word; word-break: break-word;" href="{}">{}</a>'.format(url, url)
7878
assert notify_email_markdown(url) == (
79-
'<p style="Margin: 0 0 20px 0; font-size: 19px; line-height: 25px; color: #0B0C0C;">' "{}" "</p>"
79+
'<p style="Margin: 0 0 20px 0; font-size: 19px; line-height: 25px; color: #0B0C0C;">{}</p>'
8080
).format(link)
8181

8282

@@ -102,7 +102,7 @@ def test_makes_links_out_of_URLs(url):
102102
)
103103
def test_makes_links_out_of_URLs_in_context(input, output):
104104
assert notify_email_markdown(input) == (
105-
'<p style="Margin: 0 0 20px 0; font-size: 19px; line-height: 25px; color: #0B0C0C;">' "{}" "</p>"
105+
'<p style="Margin: 0 0 20px 0; font-size: 19px; line-height: 25px; color: #0B0C0C;">{}</p>'
106106
).format(output)
107107

108108

@@ -119,7 +119,7 @@ def test_makes_links_out_of_URLs_in_context(input, output):
119119
)
120120
def test_doesnt_make_links_out_of_invalid_urls(url):
121121
assert notify_email_markdown(url) == (
122-
'<p style="Margin: 0 0 20px 0; font-size: 19px; line-height: 25px; color: #0B0C0C;">' "{}" "</p>"
122+
'<p style="Margin: 0 0 20px 0; font-size: 19px; line-height: 25px; color: #0B0C0C;">{}</p>'
123123
).format(url)
124124

125125

@@ -151,7 +151,7 @@ def test_handles_placeholders_in_urls():
151151
)
152152
def test_URLs_get_escaped(url, expected_html, expected_html_in_template):
153153
assert notify_email_markdown(url) == (
154-
'<p style="Margin: 0 0 20px 0; font-size: 19px; line-height: 25px; color: #0B0C0C;">' "{}" "</p>"
154+
'<p style="Margin: 0 0 20px 0; font-size: 19px; line-height: 25px; color: #0B0C0C;">{}</p>'
155155
).format(expected_html)
156156
assert expected_html_in_template in str(HTMLEmailTemplate({"content": url, "subject": ""}))
157157

@@ -192,11 +192,11 @@ def test_HTML_template_has_URLs_replaced_with_links():
192192
"</p>"
193193
),
194194
),
195-
(notify_plain_text_email_markdown, ("\n" "\nhttps://example.com" "\n" "\nNext paragraph")),
195+
(notify_plain_text_email_markdown, ("\n\nhttps://example.com\n\nNext paragraph")),
196196
],
197197
)
198198
def test_preserves_whitespace_when_making_links(markdown_function, expected_output):
199-
assert markdown_function("https://example.com\n" "\n" "Next paragraph") == expected_output
199+
assert markdown_function("https://example.com\n\nNext paragraph") == expected_output
200200

201201

202202
@pytest.mark.parametrize(
@@ -289,7 +289,7 @@ def test_block_code(markdown_function, expected):
289289
],
290290
[
291291
notify_plain_text_email_markdown,
292-
("\n" "\ninset text"),
292+
("\n\ninset text"),
293293
],
294294
),
295295
)
@@ -319,7 +319,7 @@ def test_block_quote(markdown_function, expected):
319319
],
320320
[
321321
notify_plain_text_email_markdown,
322-
("\n" "\n" "\nheading" "\n-----------------------------------------------------------------"),
322+
("\n\n\nheading\n-----------------------------------------------------------------"),
323323
],
324324
),
325325
)
@@ -338,7 +338,7 @@ def test_level_1_header(markdown_function, heading, expected):
338338
],
339339
[
340340
notify_plain_text_email_markdown,
341-
("\n" "\ninset text" "\n-----------------------------------------------------------------"),
341+
("\n\ninset text\n-----------------------------------------------------------------"),
342342
],
343343
),
344344
)
@@ -349,7 +349,7 @@ def test_level_2_header(markdown_function, expected):
349349
@pytest.mark.parametrize(
350350
"markdown_function, expected",
351351
(
352-
[notify_letter_preview_markdown, ("<p>a</p>" '<div class="page-break">&nbsp;</div>' "<p>b</p>")],
352+
[notify_letter_preview_markdown, ('<p>a</p><div class="page-break">&nbsp;</div><p>b</p>')],
353353
[
354354
notify_email_markdown,
355355
(
@@ -360,7 +360,7 @@ def test_level_2_header(markdown_function, expected):
360360
],
361361
[
362362
notify_plain_text_email_markdown,
363-
("\n" "\na" "\n" "\n=================================================================" "\n" "\nb"),
363+
("\n\na\n\n=================================================================\n\nb"),
364364
],
365365
),
366366
)
@@ -374,13 +374,13 @@ def test_hrule(markdown_function, expected):
374374
(
375375
[
376376
notify_letter_preview_markdown,
377-
"1. one\n" "2. two\n" "3. three\n",
378-
("<ol>\n" "<li>one</li>\n" "<li>two</li>\n" "<li>three</li>\n" "</ol>\n"),
377+
"1. one\n2. two\n3. three\n",
378+
("<ol>\n<li>one</li>\n<li>two</li>\n<li>three</li>\n</ol>\n"),
379379
],
380-
[notify_letter_preview_markdown, "1.one\n" "2.two\n" "3.three\n", "<p>1.one<br>2.two<br>3.three</p>"],
380+
[notify_letter_preview_markdown, "1.one\n2.two\n3.three\n", "<p>1.one<br>2.two<br>3.three</p>"],
381381
[
382382
notify_email_markdown,
383-
"1. one\n" "2. two\n" "3. three\n",
383+
"1. one\n2. two\n3. three\n",
384384
(
385385
'<table role="presentation" style="padding: 0 0 20px 0;">'
386386
"<tr>"
@@ -397,7 +397,7 @@ def test_hrule(markdown_function, expected):
397397
],
398398
[
399399
notify_email_markdown,
400-
"1.one\n" "2.two\n" "3.three\n",
400+
"1.one\n2.two\n3.three\n",
401401
(
402402
'<p style="Margin: 0 0 20px 0; font-size: 19px; line-height: 25px; color: #0B0C0C;">'
403403
"1.one"
@@ -410,12 +410,12 @@ def test_hrule(markdown_function, expected):
410410
],
411411
[
412412
notify_plain_text_email_markdown,
413-
"1. one\n" "2. two\n" "3. three\n",
414-
("\n" "\n1. one" "\n2. two" "\n3. three"),
413+
"1. one\n2. two\n3. three\n",
414+
("\n\n1. one\n2. two\n3. three"),
415415
],
416416
[
417417
notify_plain_text_email_markdown,
418-
"1.one\n" "2.two\n" "3.three\n",
418+
"1.one\n2.two\n3.three\n",
419419
"\n\n1.one\n2.two\n3.three",
420420
],
421421
),
@@ -427,18 +427,18 @@ def test_ordered_list(markdown_function, markdown_input, expected):
427427
@pytest.mark.parametrize(
428428
"markdown",
429429
(
430-
("* one\n" "* two\n" "* three\n"), # single space
431-
("* one\n" "* two\n" "* three\n"), # two spaces
432-
("* one\n" "* two\n" "* three\n"), # tab
433-
("- one\n" "- two\n" "- three\n"), # dash as bullet
434-
pytest.param(("+ one\n" "+ two\n" "+ three\n"), marks=pytest.mark.xfail(raises=AssertionError)), # plus as bullet
435-
("• one\n" "• two\n" "• three\n"), # bullet as bullet
430+
("* one\n* two\n* three\n"), # single space
431+
("* one\n* two\n* three\n"), # two spaces
432+
("* one\n* two\n* three\n"), # tab
433+
("- one\n- two\n- three\n"), # dash as bullet
434+
pytest.param(("+ one\n+ two\n+ three\n"), marks=pytest.mark.xfail(raises=AssertionError)), # plus as bullet
435+
("• one\n• two\n• three\n"), # bullet as bullet
436436
),
437437
)
438438
@pytest.mark.parametrize(
439439
"markdown_function, expected",
440440
(
441-
[notify_letter_preview_markdown, ("<ul>\n" "<li>one</li>\n" "<li>two</li>\n" "<li>three</li>\n" "</ul>\n")],
441+
[notify_letter_preview_markdown, ("<ul>\n<li>one</li>\n<li>two</li>\n<li>three</li>\n</ul>\n")],
442442
[
443443
notify_email_markdown,
444444
(
@@ -457,7 +457,7 @@ def test_ordered_list(markdown_function, markdown_input, expected):
457457
],
458458
[
459459
notify_plain_text_email_markdown,
460-
("\n" "\n• one" "\n• two" "\n• three"),
460+
("\n\n• one\n• two\n• three"),
461461
],
462462
),
463463
)
@@ -467,7 +467,7 @@ def test_unordered_list(markdown, markdown_function, expected):
467467

468468
@pytest.mark.parametrize(
469469
"markdown",
470-
(("*one\n" "*two\n" "*three\n"),), # no space
470+
(("*one\n*two\n*three\n"),), # no space
471471
)
472472
@pytest.mark.parametrize(
473473
"markdown_function, expected",
@@ -506,12 +506,12 @@ def test_unordered_list_with_no_spaces(markdown, markdown_function, expected):
506506
],
507507
[
508508
notify_plain_text_email_markdown,
509-
("\n\n+ one" "\n\n+ two" "\n\n+ three"),
509+
("\n\n+ one\n\n+ two\n\n+ three"),
510510
],
511511
),
512512
)
513513
def test_pluses_dont_render_as_lists(markdown_function, expected):
514-
assert markdown_function("+ one\n" "+ two\n" "+ three\n") == expected
514+
assert markdown_function("+ one\n+ two\n+ three\n") == expected
515515

516516

517517
@pytest.mark.parametrize(
@@ -547,7 +547,7 @@ def test_list_and_bold_or_italic(markdown_function, input, expected):
547547
@pytest.mark.parametrize(
548548
"markdown_function, expected",
549549
(
550-
[notify_letter_preview_markdown, ("<p>" "line one<br>" "line two" "</p>" "<p>" "new paragraph" "</p>")],
550+
[notify_letter_preview_markdown, ("<p>line one<br>line two</p><p>new paragraph</p>")],
551551
[
552552
notify_email_markdown,
553553
(
@@ -558,18 +558,18 @@ def test_list_and_bold_or_italic(markdown_function, input, expected):
558558
],
559559
[
560560
notify_plain_text_email_markdown,
561-
("\n" "\nline one" "\nline two" "\n" "\nnew paragraph"),
561+
("\n\nline one\nline two\n\nnew paragraph"),
562562
],
563563
),
564564
)
565565
def test_paragraphs(markdown_function, expected):
566-
assert markdown_function("line one\n" "line two\n" "\n" "new paragraph") == expected
566+
assert markdown_function("line one\nline two\n\nnew paragraph") == expected
567567

568568

569569
@pytest.mark.parametrize(
570570
"markdown_function, expected",
571571
(
572-
[notify_letter_preview_markdown, ("<p>before</p>" "<p>after</p>")],
572+
[notify_letter_preview_markdown, ("<p>before</p><p>after</p>")],
573573
[
574574
notify_email_markdown,
575575
(
@@ -579,7 +579,7 @@ def test_paragraphs(markdown_function, expected):
579579
],
580580
[
581581
notify_plain_text_email_markdown,
582-
("\n" "\nbefore" "\n" "\nafter"),
582+
("\n\nbefore\n\nafter"),
583583
],
584584
),
585585
)
@@ -591,7 +591,7 @@ def test_multiple_newlines_get_truncated(markdown_function, expected):
591591
"markdown_function", (notify_letter_preview_markdown, notify_email_markdown, notify_plain_text_email_markdown)
592592
)
593593
def test_table(markdown_function):
594-
assert markdown_function("col | col\n" "----|----\n" "val | val\n") == ("")
594+
assert markdown_function("col | col\n----|----\nval | val\n") == ("")
595595

596596

597597
@pytest.mark.parametrize(
@@ -621,7 +621,7 @@ def test_table(markdown_function):
621621
[
622622
notify_plain_text_email_markdown,
623623
"http://example.com",
624-
("\n" "\nhttp://example.com"),
624+
("\n\nhttp://example.com"),
625625
],
626626
),
627627
)
@@ -673,8 +673,7 @@ def test_double_emphasis(markdown_function, expected, emphasis_style):
673673
[notify_letter_preview_markdown, "<p>something important</p>"],
674674
[
675675
notify_email_markdown,
676-
'<p style="Margin: 0 0 20px 0; font-size: 19px; line-height: 25px; color: #0B0C0C;">'
677-
"something <em>important</em></p>",
676+
'<p style="Margin: 0 0 20px 0; font-size: 19px; line-height: 25px; color: #0B0C0C;">something <em>important</em></p>',
678677
],
679678
[
680679
notify_plain_text_email_markdown,
@@ -727,7 +726,7 @@ def test_image(markdown_function):
727726
],
728727
[
729728
notify_plain_text_email_markdown,
730-
("\n" "\nExample: http://example.com"),
729+
("\n\nExample: http://example.com"),
731730
],
732731
),
733732
)
@@ -752,7 +751,7 @@ def test_link(markdown_function, expected):
752751
],
753752
[
754753
notify_plain_text_email_markdown,
755-
("\n" "\nExample (An example URL): http://example.com"),
754+
("\n\nExample (An example URL): http://example.com"),
756755
],
757756
),
758757
)
@@ -1034,7 +1033,7 @@ def test_tweaking_dvla_list_markup(markup, expected_fixed):
10341033

10351034

10361035
def test_make_list_from_linebreaks():
1037-
assert nl2li("a\n" "b\n" "c\n") == ("<ul>" "<li>a</li>" "<li>b</li>" "<li>c</li>" "</ul>")
1036+
assert nl2li("a\nb\nc\n") == ("<ul><li>a</li><li>b</li><li>c</li></ul>")
10381037

10391038

10401039
@pytest.mark.parametrize(

tests/test_international_billing_rates_updater.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def test_build_international_rates_uses_max_on_shared_prefix_when_strategy_max(t
5656
max_price_by_iso = {"CA": 0.02183, "US": 0.007}
5757

5858
prefixes_csv = tmp_path / "prefixes.csv"
59-
prefixes_csv.write_text("COUNTRY,ISO_CODE,DIALING_CODE\n" "Canada,CA,1\n" "United States,US,1\n")
59+
prefixes_csv.write_text("COUNTRY,ISO_CODE,DIALING_CODE\nCanada,CA,1\nUnited States,US,1\n")
6060
prefix_by_name, feature_by_iso = load_prefixes_by_name(prefixes_csv)
6161

6262
rates = build_international_rates(

0 commit comments

Comments
 (0)