Suggest to loosen the dependency on requests
Closed this issue · 0 comments
Hi, your project discord-webhook-poster requires "requests==2.21.0" in its dependency. After analyzing the source code, we found that some other versions of requests can also be suitable without affecting your project, i.e., requests 2.20.0, 2.20.1. Therefore, we suggest to loosen the dependency on requests from "requests==2.21.0" to "requests>=2.20.0,<=2.21.0" to avoid any possible conflict for importing more packages or for downstream projects that may use discord-webhook-poster.
May I pull a request to loosen the dependency on requests?
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 discord-webhook-poster(commit id: 77ee2db) directly uses 1 APIs from package requests.
requests.api.post
From which, 17 functions are then indirectly called, including 14 requests's internal APIs and 3 outsider APIs, as follows (neglecting some repeated function occurrences).
[/parnexcodes/discord-webhook-poster]
+--requests.api.post
| +--requests.api.request
| | +--requests.sessions.Session.__init__
| | | +--requests.utils.default_headers
| | | | +--requests.structures.CaseInsensitiveDict.__init__
| | | | +--requests.utils.default_user_agent
| | | +--requests.hooks.default_hooks
| | | +--requests.cookies.cookiejar_from_dict
| | | | +--requests.cookies.RequestsCookieJar.__init__
| | | | +--requests.cookies.RequestsCookieJar.set_cookie
| | | | +--requests.cookies.create_cookie
| | | +--requests.sessions.Session.mount
| | | +--requests.adapters.HTTPAdapter.__init__
| | | | +--urllib3.util.retry.Retry
| | | | +--urllib3.util.retry.Retry.from_int
| | | | +--requests.adapters.BaseAdapter.__init__
| | | | +--requests.adapters.HTTPAdapter.init_poolmanager
| | | | | +--urllib3.poolmanager.PoolManager
We scan requests's versions among [2.20.0, 2.20.1] and 2.21.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: 2.21.0(original) 2.20.0
['requests.models.Response.iter_lines', 'requests.models.Response', 'requests.sessions.SessionRedirectMixin', 'requests.sessions.SessionRedirectMixin.should_strip_auth', 'requests.utils.from_key_val_list']
diff: 2.21.0(original) 2.20.1
['requests.models.Response.iter_lines', 'requests.models.Response']
As for other packages, the APIs of @outside_package_name are called by requests 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 requests from "requests==2.21.0" to "requests>=2.20.0,<=2.21.0". This will improve the applicability of discord-webhook-poster and reduce the possibility of any further dependency conflict with other projects/packages.