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

Suggest to loosen the dependency on textblob #26

Open
Agnes-U opened this issue Jul 17, 2022 · 0 comments
Open

Suggest to loosen the dependency on textblob #26

Agnes-U opened this issue Jul 17, 2022 · 0 comments

Comments

@Agnes-U
Copy link

Agnes-U commented Jul 17, 2022

Hi, your project ace-attorney-reddit-bot requires "textblob==0.15.3" in its dependency. After analyzing the source code, we found that the following versions of textblob can also be suitable without affecting your project, i.e., textblob 0.11.1, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.15.0, 0.15.1, 0.15.2. Therefore, we suggest to loosen the dependency on textblob from "textblob==0.15.3" to "textblob>=0.11.1,<=0.15.3" to avoid any possible conflict for importing more packages or for downstream projects that may use ace-attorney-reddit-bot.

May I pull a request to further loosen the dependency on textblob?

By the way, could you please tell us whether such dependency analysis may be potentially helpful for maintaining dependencies easier during your development?



We also give our detailed analysis as follows for your reference:

Your project ace-attorney-reddit-bot directly uses 3 APIs from package textblob.

textblob.blob.BaseBlob.translate, textblob.blob.BaseBlob.detect_language, textblob.blob.TextBlob.__init__

Beginning from the 3 APIs above, 3 functions are then indirectly called, including 3 textblob's internal APIs and 0 outsider APIs. The specific call graph is listed as follows (neglecting some repeated function occurrences).

[/micah5/ace-attorney-reddit-bot]
+--textblob.blob.BaseBlob.translate
+--textblob.blob.BaseBlob.detect_language
+--textblob.blob.TextBlob.__init__
|      +--textblob.blob.BaseBlob.__init__
|      |      +--textblob.utils.lowerstrip
|      |      |      +--textblob.utils.strip_punc
|      |      +--textblob.blob._initialize_models
|      |      |      +--textblob.blob._validated_param

We scan textblob's versions and observe that during its evolution between any version from [0.11.1, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.15.0, 0.15.1, 0.15.2] and 0.15.3, the changing functions (diffs being listed below) have none intersection with any function or API we mentioned above (either directly or indirectly called by this project).

diff: 0.15.3(original) 0.11.1
['textblob.ordereddict.OrderedDict.__ne__', 'textblob.blob.WordList.__str__', 'textblob.classifiers.BaseClassifier.extract_features', 'textblob.classifiers.BaseClassifier', 'textblob.en.sentiments.PatternAnalyzer.analyze', 'textblob.en.taggers.NLTKTagger.tag', 'textblob.ordereddict.OrderedDict.__iter__', 'textblob.blob.WordList.__setitem__', 'textblob.blob.BaseBlob.pos_tags', 'textblob.blob.BaseBlob.sentiment_assessments', 'textblob.blob.WordList.stem', 'textblob.translate.Translator.detect', 'textblob.translate.Translator.translate', 'textblob._text._read', 'textblob.blob.BaseBlob.ngrams', 'textblob.classifiers.NLTKClassifier.update', 'textblob.blob.WordList', 'textblob.blob.WordList.append', 'textblob.ordereddict.OrderedDict.__eq__', 'textblob.ordereddict.OrderedDict.__reduce__', 'textblob.blob.WordList.__iter__', 'textblob.base.BaseTagger', 'textblob.en.taggers.NLTKTagger', 'textblob.blob.WordList.__getitem__', 'textblob.blob.WordList.__getslice__', 'textblob.en.taggers.PatternTagger', 'textblob.blob.BaseBlob', 'textblob.en.taggers.PatternTagger.tag', 'textblob.blob.BaseBlob.correct', 'textblob.ordereddict.OrderedDict.__init__', 'textblob.ordereddict.OrderedDict.copy', 'textblob._text.Sentiment.__call__', 'textblob.classifiers.basic_extractor', 'textblob.base.BaseTagger.tag', 'textblob.en.sentiments.PatternAnalyzer', 'textblob.blob.WordList.__init__', 'textblob.blob.Word', 'textblob.blob.WordList.extend', 'textblob.blob.Word.stem', 'textblob.ordereddict.OrderedDict', 'textblob.blob.WordList.__repr__', 'textblob.classifiers.NLTKClassifier.accuracy', 'textblob.tokenizers.SentenceTokenizer', 'textblob.translate._calculate_tk', 'textblob.blob.Word.lemmatize', 'textblob.blob.Word.lemma', 'textblob.ordereddict.OrderedDict.__repr__', 'textblob.classifiers.BaseClassifier.__init__', 'textblob._text.Sentiment', 'textblob.classifiers.NLTKClassifier', 'textblob.ordereddict.OrderedDict.__setitem__', 'textblob.blob.WordList.count', 'textblob.ordereddict.OrderedDict.clear', 'textblob.translate._unescape', 'textblob.translate.Translator', 'textblob.ordereddict.OrderedDict.__delitem__', 'textblob.ordereddict.OrderedDict.keys', 'textblob.ordereddict.OrderedDict.popitem', 'textblob.ordereddict.OrderedDict.__reversed__', 'textblob.ordereddict.OrderedDict.fromkeys']

diff: 0.15.3(original) 0.12.0
['textblob.blob.WordList.__str__', 'textblob.classifiers.BaseClassifier.extract_features', 'textblob.classifiers.BaseClassifier', 'textblob.en.sentiments.PatternAnalyzer.analyze', 'textblob.en.taggers.NLTKTagger.tag', 'textblob.blob.BaseBlob.pos_tags', 'textblob.blob.WordList.__setitem__', 'textblob.blob.BaseBlob.sentiment_assessments', 'textblob._text._read', 'textblob.classifiers.NLTKClassifier.update', 'textblob.blob.WordList', 'textblob.blob.WordList.append', 'textblob.blob.WordList.__iter__', 'textblob.base.BaseTagger', 'textblob.en.taggers.NLTKTagger', 'textblob.blob.WordList.__getitem__', 'textblob.blob.WordList.__getslice__', 'textblob.en.taggers.PatternTagger', 'textblob.blob.BaseBlob', 'textblob.en.taggers.PatternTagger.tag', 'textblob.blob.BaseBlob.correct', 'textblob._text.Sentiment.__call__', 'textblob.classifiers.basic_extractor', 'textblob.base.BaseTagger.tag', 'textblob.en.sentiments.PatternAnalyzer', 'textblob.blob.WordList.__init__', 'textblob.blob.Word', 'textblob.blob.WordList.extend', 'textblob.blob.WordList.__repr__', 'textblob.classifiers.NLTKClassifier.accuracy', 'textblob.tokenizers.SentenceTokenizer', 'textblob.blob.Word.lemmatize', 'textblob.blob.Word.lemma', 'textblob.classifiers.BaseClassifier.__init__', 'textblob._text.Sentiment', 'textblob.classifiers.NLTKClassifier', 'textblob.blob.WordList.count', 'textblob.translate._unescape']

diff: 0.15.3(original) 0.13.0
['textblob.blob.WordList.__str__', 'textblob.classifiers.BaseClassifier', 'textblob.en.sentiments.PatternAnalyzer.analyze', 'textblob.en.taggers.NLTKTagger.tag', 'textblob.blob.BaseBlob.pos_tags', 'textblob.blob.WordList.__setitem__', 'textblob.blob.BaseBlob.sentiment_assessments', 'textblob._text._read', 'textblob.blob.WordList', 'textblob.blob.WordList.append', 'textblob.blob.WordList.__iter__', 'textblob.base.BaseTagger', 'textblob.en.taggers.NLTKTagger', 'textblob.blob.WordList.__getitem__', 'textblob.blob.WordList.__getslice__', 'textblob.en.taggers.PatternTagger', 'textblob.blob.BaseBlob', 'textblob.en.taggers.PatternTagger.tag', 'textblob.blob.BaseBlob.correct', 'textblob._text.Sentiment.__call__', 'textblob.classifiers.basic_extractor', 'textblob.base.BaseTagger.tag', 'textblob.en.sentiments.PatternAnalyzer', 'textblob.blob.WordList.__init__', 'textblob.blob.Word', 'textblob.blob.WordList.extend', 'textblob.blob.WordList.__repr__', 'textblob.classifiers.NLTKClassifier.accuracy', 'textblob.tokenizers.SentenceTokenizer', 'textblob.blob.Word.lemmatize', 'textblob.blob.Word.lemma', 'textblob.classifiers.BaseClassifier.__init__', 'textblob._text.Sentiment', 'textblob.classifiers.NLTKClassifier', 'textblob.blob.WordList.count', 'textblob.translate._unescape']

diff: 0.15.3(original) 0.13.1
['textblob.blob.WordList.__str__', 'textblob.classifiers.BaseClassifier', 'textblob.en.sentiments.PatternAnalyzer.analyze', 'textblob.en.taggers.NLTKTagger.tag', 'textblob.blob.BaseBlob.pos_tags', 'textblob.blob.WordList.__setitem__', 'textblob.blob.BaseBlob.sentiment_assessments', 'textblob._text._read', 'textblob.blob.WordList', 'textblob.blob.WordList.append', 'textblob.blob.WordList.__iter__', 'textblob.base.BaseTagger', 'textblob.en.taggers.NLTKTagger', 'textblob.blob.WordList.__getitem__', 'textblob.blob.WordList.__getslice__', 'textblob.en.taggers.PatternTagger', 'textblob.blob.BaseBlob', 'textblob.en.taggers.PatternTagger.tag', 'textblob.blob.BaseBlob.correct', 'textblob.blob.WordList.__init__', 'textblob.classifiers.basic_extractor', 'textblob.base.BaseTagger.tag', 'textblob.en.sentiments.PatternAnalyzer', 'textblob.blob.Word', 'textblob.blob.WordList.extend', 'textblob.blob.WordList.__repr__', 'textblob.tokenizers.SentenceTokenizer', 'textblob.blob.Word.lemmatize', 'textblob.blob.Word.lemma', 'textblob.classifiers.BaseClassifier.__init__', 'textblob.blob.WordList.count', 'textblob.translate._unescape']

diff: 0.15.3(original) 0.14.0
['textblob.blob.WordList.__str__', 'textblob.classifiers.BaseClassifier', 'textblob.en.sentiments.PatternAnalyzer.analyze', 'textblob.blob.BaseBlob.pos_tags', 'textblob.blob.WordList.__setitem__', 'textblob.blob.BaseBlob.sentiment_assessments', 'textblob._text._read', 'textblob.blob.WordList', 'textblob.blob.WordList.append', 'textblob.blob.WordList.__iter__', 'textblob.blob.WordList.__getitem__', 'textblob.blob.WordList.__getslice__', 'textblob.blob.BaseBlob', 'textblob.blob.BaseBlob.correct', 'textblob.blob.WordList.__init__', 'textblob.classifiers.basic_extractor', 'textblob.en.sentiments.PatternAnalyzer', 'textblob.blob.Word', 'textblob.blob.WordList.extend', 'textblob.blob.WordList.__repr__', 'textblob.tokenizers.SentenceTokenizer', 'textblob.blob.Word.lemmatize', 'textblob.blob.Word.lemma', 'textblob.classifiers.BaseClassifier.__init__', 'textblob.blob.WordList.count', 'textblob.translate._unescape']

diff: 0.15.3(original) 0.15.0
['textblob.blob.WordList.__str__', 'textblob.blob.BaseBlob.pos_tags', 'textblob.blob.WordList.__setitem__', 'textblob._text._read', 'textblob.blob.WordList', 'textblob.blob.WordList.append', 'textblob.blob.WordList.__iter__', 'textblob.blob.WordList.__getitem__', 'textblob.blob.WordList.__getslice__', 'textblob.blob.BaseBlob', 'textblob.blob.BaseBlob.correct', 'textblob.blob.WordList.__init__', 'textblob.blob.Word', 'textblob.blob.WordList.extend', 'textblob.blob.WordList.__repr__', 'textblob.tokenizers.SentenceTokenizer', 'textblob.blob.Word.lemmatize', 'textblob.blob.Word.lemma', 'textblob.blob.WordList.count']

diff: 0.15.3(original) 0.15.1
['textblob.blob.BaseBlob', 'textblob.blob.BaseBlob.correct', 'textblob.blob.WordList.__str__', 'textblob.blob.WordList', 'textblob.blob.WordList.append', 'textblob.blob.WordList.__init__', 'textblob.blob.WordList.count', 'textblob.blob.BaseBlob.pos_tags', 'textblob.blob.WordList.__iter__', 'textblob.blob.WordList.__setitem__', 'textblob.blob.WordList.extend', 'textblob.blob.WordList.__repr__', 'textblob.tokenizers.SentenceTokenizer', 'textblob._text._read', 'textblob.blob.WordList.__getitem__', 'textblob.blob.WordList.__getslice__']

diff: 0.15.3(original) 0.15.2
['textblob.blob.BaseBlob', 'textblob.tokenizers.SentenceTokenizer', 'textblob.blob.BaseBlob.correct', 'textblob.blob.BaseBlob.pos_tags']

Therefore, we believe that it is quite safe to loose your dependency on textblob from "textblob==0.15.3" to "textblob>=0.11.1,<=0.15.3". This will improve the applicability of ace-attorney-reddit-bot and reduce the possibility of any further dependency conflict with other projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant