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 boltons #18

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

Suggest to loosen the dependency on boltons #18

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

Comments

@Agnes-U
Copy link

Agnes-U commented Jul 24, 2022

Hi, your project pitch requires "boltons==18.0.0" in its dependency. After analyzing the source code, we found that the following versions of boltons can also be suitable without affecting your project, i.e., boltons 17.2.0, 18.0.1. Therefore, we suggest to loosen the dependency on boltons from "boltons==18.0.0" to "boltons>=17.2.0,<=18.0.1" to avoid any possible conflict for importing more packages or for downstream projects that may use pitch.

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

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 pitch directly uses 6 APIs from package boltons.

boltons.typeutils.make_sentinel, boltons.urlutils.URL.__init__, boltons.urlutils.URL.navigate, boltons.urlutils.URL.to_text, boltons.iterutils.is_collection, boltons.typeutils.get_all_subclasses

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

[/georgepsarakis/pitch]
+--boltons.typeutils.make_sentinel
+--boltons.urlutils.URL.__init__
|      +--boltons.urlutils.parse_url
|      |      +--boltons.urlutils.URLParseError.__init__
|      |      +--boltons.urlutils.parse_host
|      |      |      +--boltons.urlutils.inet_pton
|      |      |      |      +--boltons.urlutils._sockaddr.__init__
|      |      |      |      +--ctypes.c_int
|      |      |      |      +--ctypes.sizeof
|      |      |      |      +--socket.error
|      |      |      |      +--ctypes.byref
|      |      |      |      +--ctypes.FormatError
|      |      |      |      +--ctypes.string_at
|      |      |      +--socket.inet_pton
|      |      |      +--boltons.urlutils.URLParseError.__init__
|      +--boltons.urlutils.URLParseError.__init__
|      +--boltons.urlutils.unquote
|      |      +--boltons.urlutils.unquote_to_bytes
|      |      |      +--string.encode
|      |      |      +--string.split
+--boltons.urlutils.URL.navigate
|      +--boltons.urlutils.URL.__init__
|      +--boltons.urlutils.URL.from_parts
+--boltons.urlutils.URL.to_text
|      +--boltons.urlutils.quote_path_part
|      |      +--unicodedata.normalize
|      |      +--boltons.urlutils.to_unicode
|      +--boltons.urlutils.URL.get_authority
|      |      +--boltons.urlutils.quote_userinfo_part
|      |      |      +--unicodedata.normalize
|      |      |      +--boltons.urlutils.to_unicode
|      +--boltons.urlutils.quote_fragment_part
|      |      +--unicodedata.normalize
|      |      +--boltons.urlutils.to_unicode
+--boltons.iterutils.is_collection
|      +--boltons.iterutils.is_iterable
+--boltons.typeutils.get_all_subclasses
|      +--collections.deque

We scan boltons's versions and observe that during its evolution between any version from [17.2.0, 18.0.1] and 18.0.0, 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: 18.0.0(original) 17.2.0
['boltons.dictutils.OneToOne.pop', 'boltons.cacheutils.MinIDMap.drop', 'boltons.tableutils.Table._add_horizontal_html_lines', 'boltons.dictutils.subdict', 'boltons.cacheutils.MinIDMap.__contains__', 'boltons.dictutils.OneToOne.__init__', 'boltons.cacheutils.MinIDMap._clean', 'boltons.cacheutils.MinIDMap', 'boltons.queueutils.BasePriorityQueue.add', 'boltons.tableutils.Table', 'boltons.dictutils.OneToOne', 'boltons.cacheutils.MinIDMap.__iter__', 'boltons.cacheutils.MinIDMap.iteritems', 'boltons.cacheutils.MinIDMap.__init__', 'boltons.dictutils.OneToOne.copy', 'boltons.cacheutils.MinIDMap.get', 'boltons.cacheutils.MinIDMap.__len__', 'boltons.queueutils.BasePriorityQueue']

diff: 18.0.0(original) 18.0.1
['boltons.strutils.multi_replace', 'boltons.tbutils._DeferredLine', 'boltons.strutils.MultiReplace.sub', 'boltons.tableutils.Table', 'boltons.tbutils._DeferredLine.__init__', 'boltons.strutils.MultiReplace', 'boltons.dictutils.OneToOne', 'boltons.fileutils.atomic_rename', 'boltons.strutils.MultiReplace.__init__', 'boltons.strutils.MultiReplace._get_value', 'boltons.tableutils.Table.to_text', 'boltons.tbutils._DeferredLine.__str__']

As for other packages, the APIs of collections, unicodedata, socket, string and ctypes are called by boltons 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 boltons from "boltons==18.0.0" to "boltons>=17.2.0,<=18.0.1". This will improve the applicability of pitch 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