diff --git a/HISTORY.rst b/HISTORY.rst index 173a4c8..8d94fb7 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,6 +2,18 @@ History ======= +1.1.2 +----- + +- Fix cyclic import by @juanjoDiaz (#148) +- Fix language detector proportion_in_each_language results by @juanjoDiaz (#150) +- Init: use explicit re-exports (#151) +- Fix data written by dictionary pickler by @Dunedan (#156) +- Add demo rules for Latvian and Estonian (#154, #157) +- Remove deprecated langdetect submodule (#160) +- Test: remove dummy pickled data (#161) +- Language data: upgrade pickle to v5 (#162) + 1.1.1 ----- diff --git a/simplemma/__metadata__.py b/simplemma/__metadata__.py index a9012d4..42bb566 100644 --- a/simplemma/__metadata__.py +++ b/simplemma/__metadata__.py @@ -15,4 +15,4 @@ __author__ = "Adrien Barbaresi, Juanjo Diaz and contributors" __email__ = "barbaresi@bbaw.de" __license__ = "MIT" -__version__ = "1.1.1" +__version__ = "1.1.2" diff --git a/tests/test_dictionary_pickler.py b/tests/test_dictionary_pickler.py index c53b967..4bfa182 100644 --- a/tests/test_dictionary_pickler.py +++ b/tests/test_dictionary_pickler.py @@ -1,20 +1,21 @@ -import os import tempfile +from os import path, remove + from training import dictionary_pickler -TEST_DIR = os.path.abspath(os.path.dirname(__file__)) +TEST_DIR = path.abspath(path.dirname(__file__)) def test_logic() -> None: """Test if certain code parts correspond to the intended logic.""" # dict generation - testfile = os.path.join(TEST_DIR, "data/zz.txt") + testfile = path.join(TEST_DIR, "data/zz.txt") # simple generation, silent mode mydict = dictionary_pickler._read_dict(testfile, "zz", silent=True) assert len(mydict) == 3 mydict = dictionary_pickler._load_dict( - "zz", listpath=os.path.join(TEST_DIR, "data"), silent=True + "zz", listpath=path.join(TEST_DIR, "data"), silent=True ) assert len(mydict) == 3 # log warning @@ -35,11 +36,14 @@ def test_logic() -> None: assert dictionary_pickler._determine_path("lists", "de").endswith("de.txt") # dict pickling - listpath = os.path.join(TEST_DIR, "data") + listpath = path.join(TEST_DIR, "data") os_handle, temp_outputfile = tempfile.mkstemp(suffix=".pkl", text=True) dictionary_pickler._pickle_dict("zz", listpath, temp_outputfile) dictionary_pickler._pickle_dict("zz", listpath, in_place=True) # remove pickle file filepath = dictionary_pickler._determine_pickle_path("zz") - os.remove(filepath) + try: + remove(filepath) + except (AttributeError, FileNotFoundError): + print("Pickle file already deleted") diff --git a/tests/test_language_detector.py b/tests/test_language_detector.py index 6e40997..9f30e54 100644 --- a/tests/test_language_detector.py +++ b/tests/test_language_detector.py @@ -1,7 +1,5 @@ """Tests for Simplemma's language detection utilities.""" -import pytest - from simplemma import LanguageDetector, in_target_language, langdetect from simplemma.strategies import DefaultStrategy