Skip to content

Commit

Permalink
Merge pull request #229 from bskinn/release-2.2.2
Browse files Browse the repository at this point in the history
Merge v2.2.2 to stable
  • Loading branch information
bskinn authored Mar 22, 2022
2 parents 98f0f88 + 0ad9860 commit 1b2d5e3
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ repos:
rev: '22.1.0'
hooks:
- id: black
- repo: https://github.com/tox-dev/pyproject-fmt
rev: '0.3.2'
hooks:
- id: pyproject-fmt
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,34 @@ and this project strives to adhere to
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).


### [2.2.2] - 2022-03-22

#### Fixed

* UnicodeDecodeErrors are ignored within the vendored `fuzzywuzzy` package
during `suggest` operations, using the `errors=replace` mode within
bytes.decode().

* This misbehavior emerged after vendoring `fuzzywuzzy`, suggesting that
it was a bug fixed later on in that project's development, after the
point from which it was vendored.

* This change may alter `suggest` behavior for those inventory objects with
pathological characters. But, given their rarity, user experience is not
expected to be noticeably affected.

#### Internal

* The `pyproject-fmt` formatted was added as a pre-commit hook.

* The `flake8-raise` plugin was added to the linting suite.

#### Testing

* A smoke test for error-free `suggest` execution was added for all of the
inventory files in `tests/resource`.


### [2.2.1] - 2022-02-05

#### Internal
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[build-system]
requires = ["wheel", "setuptools"]
build-backend = "setuptools.build_meta"
requires = [
"setuptools",
"wheel",
]

[tool.black]
line-length = 88
Expand Down
1 change: 1 addition & 0 deletions requirements-flake8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ flake8-eradicate
flake8-implicit-str-concat
flake8-import-order
flake8-pie
flake8-raise
flake8-rst-docstrings
pep8-naming
8 changes: 2 additions & 6 deletions src/sphobjinv/_vendored/fuzzywuzzy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


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

# remove non-ASCII characters from strings
def asciidammit(s):
Expand All @@ -32,8 +32,4 @@ def validate_string(s):
def full_process(s):
s = asciidammit(s)
# B Skinn 2021-12-11
return s.encode().translate(trans_table, bad_chars).decode().strip()




return s.encode().translate(trans_table, bad_chars).decode(errors='replace').strip()
2 changes: 1 addition & 1 deletion src/sphobjinv/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
"""

__version__ = "2.2.1"
__version__ = "2.2.2"
Binary file added tests/resource/objects_fonttools.inv
Binary file not shown.
19 changes: 18 additions & 1 deletion tests/test_api_good.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def test_api_inventory_toosmallflatdict_importbutignore(self, res_dec):
assert inv2.count == 55

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

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

@pytest.mark.testall
def test_api_inventory_suggest_operation(self, testall_inv_path):
"""Confirm that a suggest operation works on all smoke-test inventories."""
inv = soi.Inventory(testall_inv_path)

inv.suggest("class")

@pytest.mark.testall
def test_api_inventory_datafile_gen_and_reimport(
self,
Expand Down Expand Up @@ -555,6 +562,16 @@ def test_api_inventory_matches_sphinx_ifile(
else:
assert inv.count == sphinx_ifile_data_count(original_ifile_data), fname

elif "fonttools" in fname: # pragma: no cover
# One object appears to have a misbehaving character that Sphinx
# rejects on an attempted import in ~recent versions
if sphinx_version < (3, 3, 0):
assert inv.count == sphinx_ifile_data_count(original_ifile_data), fname
else:
assert inv.count == 1 + sphinx_ifile_data_count(
original_ifile_data
), fname

else:
assert inv.count == sphinx_ifile_data_count(original_ifile_data), fname

Expand Down
2 changes: 1 addition & 1 deletion tests/test_fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_info_fixture(misc_info):

def test_populate_scratch(misc_info, scratch_path, check):
"""Ensure the scratch_path fixture populates the scratch dir correctly."""
scr_base = misc_info.FNames.INIT
scr_base = misc_info.FNames.INIT.value

for ext in [_.value for _ in misc_info.Extensions]:
with check.check(msg=ext):
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ basepython=
py38: python3.8
py37: python3.7
py36: python3.6
py35: python3.5

[testenv:flake8]
skip_install=True
Expand Down

0 comments on commit 1b2d5e3

Please sign in to comment.