debrief / pepys-import

Support library for Pepys maritime data analysis environment
https://pepys-import.readthedocs.io/
Apache License 2.0
5 stars 5 forks source link

Suggest to loosen the dependency on halo #1135

Open Agnes-U opened 1 year ago

Agnes-U commented 1 year ago

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

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

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 pepys-import(commit id: da8d0baea0cc03a9c0316d686406fce917157d78) directly uses 3 APIs from package halo.

halo.halo.Halo.start, halo.halo.Halo.succeed, halo.halo.Halo.__init__

From which, 28 functions are then indirectly called, including 17 halo's internal APIs and 11 outsider APIs, as follows (neglecting some repeated function occurrences).

[/debrief/pepys-import]
+--halo.halo.Halo.start
|      +--halo.halo.Halo._check_stream
|      +--halo.halo.Halo._hide_cursor
|      |      +--halo.halo.Halo._check_stream
|      |      +--halo.cursor.hide
|      |      |      +--halo.cursor._CursorInfo.__init__
|      |      |      +--ctypes.windll.kernel32.GetStdHandle
|      |      |      +--ctypes.windll.kernel32.GetConsoleCursorInfo
|      |      |      +--ctypes.windll.kernel32.SetConsoleCursorInfo
|      |      |      +--ctypes.byref
|      +--threading.Event
|      +--threading.Thread
|      +--halo.halo.Halo._render_frame
|      |      +--halo.halo.Halo.clear
|      |      |      +--halo.halo.Halo._write
|      |      |      |      +--halo.halo.Halo._check_stream
|      |      +--halo.halo.Halo.frame
|      |      |      +--halo._utils.colored_frame
|      |      |      |      +--termcolor.colored
|      |      |      +--halo.halo.Halo.text_frame
|      |      |      |      +--halo._utils.colored_frame
|      |      +--halo.halo.Halo._write
|      |      +--halo._utils.encode_utf_8_text
|      |      |      +--codecs.encode
+--halo.halo.Halo.succeed
|      +--halo.halo.Halo.stop_and_persist
|      |      +--halo._utils.decode_utf_8_text
|      |      |      +--codecs.decode
|      |      +--halo._utils.colored_frame
|      |      +--halo.halo.Halo.stop
|      |      |      +--halo.halo.Halo.clear
|      |      |      +--halo.halo.Halo._show_cursor
|      |      |      |      +--halo.halo.Halo._check_stream
|      |      |      |      +--halo.cursor.show
|      |      |      |      |      +--halo.cursor._CursorInfo.__init__
|      |      |      |      |      +--ctypes.windll.kernel32.GetStdHandle
|      |      |      |      |      +--ctypes.windll.kernel32.GetConsoleCursorInfo
|      |      |      |      |      +--ctypes.windll.kernel32.SetConsoleCursorInfo
|      |      |      |      |      +--ctypes.byref
|      |      +--halo.halo.Halo._write
|      |      +--halo._utils.encode_utf_8_text
+--halo.halo.Halo.__init__
|      +--halo._utils.get_environment
|      |      +--IPython.get_ipython
|      +--halo.halo.Halo.stop
|      +--IPython.get_ipython
|      +--atexit.register

We scan halo's versions among [0.0.30] and 0.0.31, 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.0.31(original) 0.0.30
[](no clear difference between the source codes of two versions)

As for other packages, the APIs of @outside_package_name are called by halo 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 halo from "halo==0.0.31" to "halo>=0.0.30,<=0.0.31". This will improve the applicability of pepys-import and reduce the possibility of any further dependency conflict with other projects/packages.