{{ message }}
Repository navigation
Declare setuptools dependency for pymorphy2's pkg_resources import - #152
Merged
Merged
Conversation
…t working pymorphy2 discovers dictionaries via pkg_resources entry points, but it does not declare setuptools as a dependency. On installations without setuptools this raises 'ModuleNotFoundError: No module named pkg_resources' when natasha constructs a MorphVocab. Declare setuptools as a runtime dependency and add regression tests. Closes natasha#146.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
pymorphy2discovers its dictionaries viapkg_resourcesentry points (pymorphy2/analyzer.py: _iter_entry_points), butpymorphy2does not declaresetuptoolsas a dependency. On installations withoutsetuptoolsthis raises:when natasha constructs a
MorphVocab(which calls_lang_dict_paths).pkg_resourcesships withsetuptools.Fix
Declare
setuptoolsas a runtime dependency ininstall_requires, so the transitivepymorphy2→pkg_resourcesimport keeps working regardless of the environment.Tests
Added
tests/test_dependencies.py:test_pkg_resources_available— assertspkg_resourcesis importable.test_pymorphy2_entry_point_discovery— exercises the exact entry-point path that importspkg_resources.Closes #146.