From 10cc7fb7af8040da86042b5869aeb307226c9010 Mon Sep 17 00:00:00 2001 From: Adrien Barbaresi Date: Wed, 9 Oct 2024 14:28:47 +0200 Subject: [PATCH] setup: use explicit re-exports (#151) * setup: use explicit re-exports * fix tests --- .github/workflows/tests.yml | 2 +- simplemma/__init__.py | 23 +++++++++++++++++++ simplemma/strategies/__init__.py | 17 ++++++++++++++ simplemma/strategies/dictionaries/__init__.py | 2 ++ simplemma/strategies/fallback/__init__.py | 6 +++++ 5 files changed, 49 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9e4a720..0e57172 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13-dev'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] # '3.14-dev' env: [{ MINIMAL: "true" }, { MINIMAL: "false" }] include: # common versions on MacOS diff --git a/simplemma/__init__.py b/simplemma/__init__.py index 11a8713..0dfcb29 100644 --- a/simplemma/__init__.py +++ b/simplemma/__init__.py @@ -20,3 +20,26 @@ TokenSampler, ) from .tokenizer import RegexTokenizer, Tokenizer, simple_tokenizer + +__all__ = [ + "__title__", + "__author__", + "__email__", + "__license__", + "__version__", + "LanguageDetector", + "in_target_language", + "langdetect", + "Lemmatizer", + "is_known", + "lemma_iterator", + "lemmatize", + "text_lemmatizer", + "BaseTokenSampler", + "MostCommonTokenSampler", + "RelaxedMostCommonTokenSampler", + "TokenSampler", + "RegexTokenizer", + "Tokenizer", + "simple_tokenizer", +] diff --git a/simplemma/strategies/__init__.py b/simplemma/strategies/__init__.py index 89fcc51..e3ac4c7 100644 --- a/simplemma/strategies/__init__.py +++ b/simplemma/strategies/__init__.py @@ -16,3 +16,20 @@ from .lemmatization_strategy import LemmatizationStrategy from .prefix_decomposition import PrefixDecompositionStrategy from .rules import RulesStrategy + +__all__ = [ + "AffixDecompositionStrategy", + "DefaultStrategy", + "DefaultDictionaryFactory", + "DictionaryFactory", + "TrieDictionaryFactory", + "DictionaryLookupStrategy", + "LemmatizationFallbackStrategy", + "RaiseErrorFallbackStrategy", + "ToLowercaseFallbackStrategy", + "GreedyDictionaryLookupStrategy", + "HyphenRemovalStrategy", + "LemmatizationStrategy", + "PrefixDecompositionStrategy", + "RulesStrategy", +] diff --git a/simplemma/strategies/dictionaries/__init__.py b/simplemma/strategies/dictionaries/__init__.py index b791fd5..662491d 100644 --- a/simplemma/strategies/dictionaries/__init__.py +++ b/simplemma/strategies/dictionaries/__init__.py @@ -2,3 +2,5 @@ from .dictionary_factory import DefaultDictionaryFactory, DictionaryFactory from .trie_directory_factory import TrieDictionaryFactory + +__all__ = ["DefaultDictionaryFactory", "DictionaryFactory", "TrieDictionaryFactory"] diff --git a/simplemma/strategies/fallback/__init__.py b/simplemma/strategies/fallback/__init__.py index 100c005..0e5b2bb 100644 --- a/simplemma/strategies/fallback/__init__.py +++ b/simplemma/strategies/fallback/__init__.py @@ -3,3 +3,9 @@ from .lemmatization_fallback_strategy import LemmatizationFallbackStrategy from .raise_error import RaiseErrorFallbackStrategy from .to_lowercase import ToLowercaseFallbackStrategy + +__all__ = [ + "LemmatizationFallbackStrategy", + "RaiseErrorFallbackStrategy", + "ToLowercaseFallbackStrategy", +]