Skip to content

Commit ff7fa19

Browse files
Bump nameparser from 1.2.1 to 1.3.1 (#3569)
1 parent eb21700 commit ff7fa19

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ dependencies = [
6969
"jwcrypto>=1.5.8,<2",
7070
"levenshtein>=0.27,<0.28",
7171
"lxml[html-clean]==6.1.1",
72-
"nameparser>=1.2.1,<2", # nameparser is for author name manipulations
72+
"nameparser>=1.3.1,<2", # nameparser is for author name manipulations
7373
"openpyxl>=3.1,<4",
7474
"opensearch-py>=3.2.0,<4",
7575
"palace-opds",

tests/manager/core/test_personal_names.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def unchanged(x):
2121
unchanged("Bitshifter, Bob")
2222
unchanged("Prince")
2323
unchanged("Pope Francis")
24-
unchanged("Heliodorus (bp. of Tricca.)")
24+
unchanged("Heliodorus (bp. of Tricca)")
2525
unchanged("谢新源 (Xie Xinyuan)")
2626
unchanged("Alfred, Lord Tennyson")
2727
unchanged("Bob, The Grand Duke of Awesomeness")
@@ -58,6 +58,14 @@ def unchanged(x):
5858
sort_name = m("John Doe, M.D.")
5959
assert "Doe, John MD" == sort_name
6060

61+
# Parenthesized professional suffixes are treated as suffixes (nameparser
62+
# >= 1.3.0), matching how the comma-separated forms above are handled,
63+
# rather than being appended as a parenthetical nickname.
64+
assert "Doe, John PhD" == m("John Doe (Ph.D.)")
65+
assert "Jones, Bob MD" == m("Bob Jones (M.D.)")
66+
assert "Jones, Bob MBA" == m("Bob Jones (MBA)")
67+
assert "Doe, John Jr." == m("John Doe (Jr.)")
68+
6169
# corporate names are unchanged
6270
unchanged("Church of Jesus Christ of Latter-day Saints")
6371
unchanged("(C) 2006 Vanguard")

uv.lock

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

0 commit comments

Comments
 (0)