Skip to content

Commit

Permalink
Merge pull request #178 from goodmami/fix-177
Browse files Browse the repository at this point in the history
Fix #177: KeyError on ILI-based relations queries
  • Loading branch information
goodmami authored Nov 14, 2022
2 parents e02d668 + 3da584b commit 7abad0e
Show file tree
Hide file tree
Showing 9 changed files with 190 additions and 124 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
Expand All @@ -24,12 +24,12 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -40,9 +40,9 @@ jobs:
check-buildable:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
precheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
Expand All @@ -22,9 +22,9 @@ jobs:
runs-on: ubuntu-latest
needs: [precheck]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
## [Unreleased]


## [v0.9.3]

**Release date: 2022-11-13**

### Fixed

* `wn.Synset.relations()` no longer raises a `KeyError` when no
relation types are given and relations are found via ILI ([#177])


## [v0.9.2]

**Release date: 2022-10-02**
Expand Down Expand Up @@ -598,3 +608,4 @@ abandoned, but this is an entirely new codebase.
[#157]: https://github.com/goodmami/wn/issues/157
[#168]: https://github.com/goodmami/wn/issues/168
[#169]: https://github.com/goodmami/wn/issues/169
[#177]: https://github.com/goodmami/wn/issues/177
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dynamic = ['version']
name = "wn"
description = "Wordnet interface library"
readme = "README.md"
requires-python = ">=3.6"
requires-python = ">=3.7"
license = {file = "LICENSE"}
keywords = ["wordnet", "interlingual", "linguistics", "language", "library"]
authors = [
Expand All @@ -22,11 +22,11 @@ classifiers = [
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Text Processing :: Linguistic",
Expand Down
6 changes: 6 additions & 0 deletions tests/relations_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,9 @@ def test_synset_relations_issue_169():
assert list(en.synset("test-en-0001-n").relations('hyponym')) == ['hyponym']
es = wn.Wordnet('test-es', expand='test-en')
assert list(es.synset("test-es-0001-n").relations('hyponym')) == ['hyponym']


@pytest.mark.usefixtures('mini_db')
def test_synset_relations_issue_177():
# https://github.com/goodmami/wn/issues/177
assert 'hyponym' in wn.synset('test-es-0001-n').relations()
2 changes: 1 addition & 1 deletion wn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@
Wordnet
)

__version__ = '0.9.2'
__version__ = '0.9.3'
14 changes: 7 additions & 7 deletions wn/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ def add_project(
self,
id: str,
type: str = _WORDNET,
label: str = None,
language: str = None,
license: str = None,
error: str = None,
label: Optional[str] = None,
language: Optional[str] = None,
license: Optional[str] = None,
error: Optional[str] = None,
) -> None:
"""Add a new wordnet project to the index.
Expand Down Expand Up @@ -96,9 +96,9 @@ def add_project_version(
self,
id: str,
version: str,
url: str = None,
error: str = None,
license: str = None,
url: Optional[str] = None,
error: Optional[str] = None,
license: Optional[str] = None,
) -> None:
"""Add a new resource version for a project.
Expand Down
Loading

0 comments on commit 7abad0e

Please sign in to comment.