Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix pkg_resources deprecation warning #150

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ editdistpy>=0.1.3
coverage==6.1.2
numpy>=1.19.5
pytest-cov==3.0.0
importlib-resources>=6.3.2
17 changes: 8 additions & 9 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
from pathlib import Path

import pkg_resources
import importlib_resources
import pytest

from symspellpy import SymSpell
Expand All @@ -13,17 +13,15 @@
#######################################################################
@pytest.fixture
def bigram_path():
return pkg_resources.resource_filename(
"symspellpy", "frequency_bigramdictionary_en_243_342.txt"
)

ref = importlib_resources.files("symspellpy") / "frequency_bigramdictionary_en_243_342.txt"
with importlib_resources.as_file(ref) as path:
yield path

@pytest.fixture
def dictionary_path():
return pkg_resources.resource_filename(
"symspellpy", "frequency_dictionary_en_82_765.txt"
)

ref = importlib_resources.files("symspellpy") / "frequency_dictionary_en_82_765.txt"
with importlib_resources.as_file(ref) as path:
yield path

@pytest.fixture
def pickle_path():
Expand Down Expand Up @@ -90,3 +88,4 @@ def symspell_short(request):
if request.param is None:
return SymSpell(1, 3)
return SymSpell(1, 3, count_threshold=request.param)

Loading