preetham / verifytweet

Verify Tweet from Image
GNU Affero General Public License v3.0
20 stars 1 forks source link

Suggest to loosen the dependency on twint #38

Closed Agnes-U closed 1 year ago

Agnes-U commented 1 year ago

Hi, your project verifytweet requires "twint==2.1.13" in its dependency. After analyzing the source code, we found that some other versions of twint can also be suitable without affecting your project, i.e., twint 2.1.14, 2.1.15. Therefore, we suggest to loosen the dependency on twint from "twint==2.1.13" to "twint>=2.1.13,<=2.1.15" to avoid any possible conflict for importing more packages or for downstream projects that may use verifytweet.

May I pull a request to loosen the dependency on twint?

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



For your reference, here are details in our analysis.

Your project verifytweet(commit id: 7469c7930958a45cc59a645d25359d4b70886c08) directly uses 3 APIs from package twint.

twint.tweet.tweet.__init__, twint.run.Search, twint.config.Config.__init__

From which, 16 functions are then indirectly called, including 8 twint's internal APIs and 8 outsider APIs, as follows (neglecting some repeated function occurrences).

[/preetham/verifytweet]
+--twint.tweet.tweet.__init__
+--twint.run.Search
|      +--logging.debug
|      +--twint.run.run
|      |      +--logging.debug
|      |      +--asyncio.new_event_loop
|      |      +--asyncio.set_event_loop
|      |      +--twint.run.Twint.__init__
|      |      |      +--logging.debug
|      |      |      +--twint.run.Twint.get_resume
|      |      |      |      +--os.path.exists
|      |      |      +--twint.storage.db.Conn
|      |      |      |      +--twint.storage.db.init
|      |      |      |      |      +--sqlite3.connect
|      |      |      |      +--sys.exit
|      |      |      +--twint.datelock.Set
|      |      |      |      +--logging.debug
|      |      |      |      +--twint.datelock.Datelock.__init__
|      |      |      |      +--datetime.datetime.strptime
|      |      |      |      +--datetime.datetime.today
|      |      |      |      +--twint.datelock.convertToDateTime
|      |      |      +--twint.verbose.Elastic
|      |      |      +--twint.output._clean_follow_list
|      |      |      |      +--logging.debug
+--twint.config.Config.__init__

We scan twint's versions among [2.1.14, 2.1.15] and 2.1.13, 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: 2.1.13(original) 2.1.14
['twint.format.User']

diff: 2.1.13(original) 2.1.15
['twint.tweet.getRetweet', 'twint.tweet.Tweet', 'twint.format.User']

As for other packages, the APIs of @outside_package_name are called by twint in the call graph and the dependencies on these packages also stay the same in our suggested versions, thus avoiding any outside conflict.

Therefore, we believe that it is quite safe to loose your dependency on twint from "twint==2.1.13" to "twint>=2.1.13,<=2.1.15". This will improve the applicability of verifytweet and reduce the possibility of any further dependency conflict with other projects/packages.

preetham commented 1 year ago

Please do a PR to loosen the dependency.

Agnes-U commented 1 year ago

39