Skip to content

Commit 1b2d5e3

Browse files
authored
Merge pull request #229 from bskinn/release-2.2.2
Merge v2.2.2 to stable
2 parents 98f0f88 + 0ad9860 commit 1b2d5e3

File tree

10 files changed

+59
-11
lines changed

10 files changed

+59
-11
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ repos:
1212
rev: '22.1.0'
1313
hooks:
1414
- id: black
15+
- repo: https://github.com/tox-dev/pyproject-fmt
16+
rev: '0.3.2'
17+
hooks:
18+
- id: pyproject-fmt

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,34 @@ and this project strives to adhere to
77
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).
88

99

10+
### [2.2.2] - 2022-03-22
11+
12+
#### Fixed
13+
14+
* UnicodeDecodeErrors are ignored within the vendored `fuzzywuzzy` package
15+
during `suggest` operations, using the `errors=replace` mode within
16+
bytes.decode().
17+
18+
* This misbehavior emerged after vendoring `fuzzywuzzy`, suggesting that
19+
it was a bug fixed later on in that project's development, after the
20+
point from which it was vendored.
21+
22+
* This change may alter `suggest` behavior for those inventory objects with
23+
pathological characters. But, given their rarity, user experience is not
24+
expected to be noticeably affected.
25+
26+
#### Internal
27+
28+
* The `pyproject-fmt` formatted was added as a pre-commit hook.
29+
30+
* The `flake8-raise` plugin was added to the linting suite.
31+
32+
#### Testing
33+
34+
* A smoke test for error-free `suggest` execution was added for all of the
35+
inventory files in `tests/resource`.
36+
37+
1038
### [2.2.1] - 2022-02-05
1139

1240
#### Internal

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[build-system]
2-
requires = ["wheel", "setuptools"]
32
build-backend = "setuptools.build_meta"
3+
requires = [
4+
"setuptools",
5+
"wheel",
6+
]
47

58
[tool.black]
69
line-length = 88

requirements-flake8.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ flake8-eradicate
1212
flake8-implicit-str-concat
1313
flake8-import-order
1414
flake8-pie
15+
flake8-raise
1516
flake8-rst-docstrings
1617
pep8-naming

src/sphobjinv/_vendored/fuzzywuzzy/utils.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
def asciionly(s):
12-
return s.encode().translate(None, bad_chars).decode() # B Skinn 2021-12-11
12+
return s.encode().translate(None, bad_chars).decode(errors='replace') # B Skinn 2021-12-11
1313

1414
# remove non-ASCII characters from strings
1515
def asciidammit(s):
@@ -32,8 +32,4 @@ def validate_string(s):
3232
def full_process(s):
3333
s = asciidammit(s)
3434
# B Skinn 2021-12-11
35-
return s.encode().translate(trans_table, bad_chars).decode().strip()
36-
37-
38-
39-
35+
return s.encode().translate(trans_table, bad_chars).decode(errors='replace').strip()

src/sphobjinv/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
2626
"""
2727

28-
__version__ = "2.2.1"
28+
__version__ = "2.2.2"
36.6 KB
Binary file not shown.

tests/test_api_good.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ def test_api_inventory_toosmallflatdict_importbutignore(self, res_dec):
448448
assert inv2.count == 55
449449

450450
def test_api_inventory_namesuggest(self, res_cmp, check):
451-
"""Confirm object name suggestion is nominally working."""
451+
"""Confirm object name suggestion is nominally working on a specific object."""
452452
rst = ":py:function:`attr.evolve`"
453453
idx = 6
454454

@@ -469,6 +469,13 @@ def test_api_inventory_namesuggest(self, res_cmp, check):
469469
check.is_instance(rec[0][1], Number)
470470
check.equal(rec[0][2], idx)
471471

472+
@pytest.mark.testall
473+
def test_api_inventory_suggest_operation(self, testall_inv_path):
474+
"""Confirm that a suggest operation works on all smoke-test inventories."""
475+
inv = soi.Inventory(testall_inv_path)
476+
477+
inv.suggest("class")
478+
472479
@pytest.mark.testall
473480
def test_api_inventory_datafile_gen_and_reimport(
474481
self,
@@ -555,6 +562,16 @@ def test_api_inventory_matches_sphinx_ifile(
555562
else:
556563
assert inv.count == sphinx_ifile_data_count(original_ifile_data), fname
557564

565+
elif "fonttools" in fname: # pragma: no cover
566+
# One object appears to have a misbehaving character that Sphinx
567+
# rejects on an attempted import in ~recent versions
568+
if sphinx_version < (3, 3, 0):
569+
assert inv.count == sphinx_ifile_data_count(original_ifile_data), fname
570+
else:
571+
assert inv.count == 1 + sphinx_ifile_data_count(
572+
original_ifile_data
573+
), fname
574+
558575
else:
559576
assert inv.count == sphinx_ifile_data_count(original_ifile_data), fname
560577

tests/test_fixture.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_info_fixture(misc_info):
3838

3939
def test_populate_scratch(misc_info, scratch_path, check):
4040
"""Ensure the scratch_path fixture populates the scratch dir correctly."""
41-
scr_base = misc_info.FNames.INIT
41+
scr_base = misc_info.FNames.INIT.value
4242

4343
for ext in [_.value for _ in misc_info.Extensions]:
4444
with check.check(msg=ext):

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ basepython=
7070
py38: python3.8
7171
py37: python3.7
7272
py36: python3.6
73-
py35: python3.5
7473

7574
[testenv:flake8]
7675
skip_install=True

0 commit comments

Comments
 (0)