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 PyGithub #230

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

Suggest to loosen the dependency on PyGithub #230

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

Comments

@Agnes-U
Copy link

Agnes-U commented Jul 24, 2022

Hi, your project 154Algoritm-5weeks requires "PyGithub==1.51" in its dependency. After analyzing the source code, we found that the following versions of PyGithub can also be suitable without affecting your project, i.e., PyGithub 1.46, 1.47, 1.50. Therefore, we suggest to loosen the dependency on PyGithub from "PyGithub==1.51" to "PyGithub>=1.46,<=1.51" to avoid any possible conflict for importing more packages or for downstream projects that may use 154Algoritm-5weeks.

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

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 154Algoritm-5weeks directly uses 2 APIs from package PyGithub.

github.MainClass.Github.__init__, github.MainClass.Github.get_user

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

[/MinJunKimKR/154Algoritm-5weeks]
+--github.MainClass.Github.__init__
|      +--github.Requester.Requester.__init__
|      |      +--github.Requester.Requester._initializeDebugFeature
|      |      +--base64.b64encode
|      |      +--urllib.parse.urlparse
+--github.MainClass.Github.get_user
|      +--github.AuthenticatedUser.AuthenticatedUser.__init__
|      +--github.Requester.Requester.requestJsonAndCheck
|      |      +--github.Requester.Requester.__check
|      |      |      +--github.Requester.Requester.__structuredFromJson
|      |      |      |      +--json.loads
|      |      |      +--github.Requester.Requester.__createException
|      |      |      |      +--re.match
|      |      +--github.Requester.Requester.requestJson
|      |      |      +--json.dumps
|      |      |      +--github.Requester.Requester.__requestEncode
|      |      |      |      +--github.Requester.Requester.__authenticate
|      |      |      |      +--github.Requester.Requester.__makeAbsoluteUrl
|      |      |      |      |      +--urllib.parse.urlparse
|      |      |      |      +--github.Requester.Requester.__addParametersToUrl
|      |      |      |      |      +--urllib.parse.urlencode
|      |      |      |      +--github.Requester.Requester.NEW_DEBUG_FRAME
|      |      |      |      +--github.Requester.Requester.__requestRaw
|      |      |      |      |      +--github.Requester.Requester.__createConnection
|      |      |      |      |      +--github.Requester.Requester.__log
|      |      |      |      |      |      +--logging.getLogger
|      |      |      |      |      +--time.sleep
|      |      |      |      |      +--github.Requester.Requester.__requestRaw
|      |      |      |      |      |      +--urllib.parse.urlparse
|      |      |      |      +--github.Requester.Requester.DEBUG_ON_RESPONSE
|      |      +--github.Requester.Requester.__customConnection
|      |      |      +--urllib.parse.urlparse
|      +--github.NamedUser.NamedUser.__init__

We scan PyGithub's versions and observe that during its evolution between any version from [1.46, 1.47, 1.50] and 1.51, 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: 1.51(original) 1.46
['PyGithub.ProjectCard.ProjectCard', 'PyGithub.PullRequest.PullRequest._initAttributes', 'PyGithub.Repository.Repository.get_git_matching_refs', 'PyGithub.Organization.Organization.has_organization_projects', 'PyGithub.Project.Project.delete', 'PyGithub.GithubException.GithubException', 'PyGithub.Repository.Repository.deployments_url', 'PyGithub.AuthenticatedUser.AuthenticatedUser.create_project', 'PyGithub.Project.Project.edit', 'PyGithub.Deployment.Deployment.repository_url', 'PyGithub.Organization.Organization._initAttributes', 'PyGithub.Rate.Rate', 'PyGithub.MainClass.Github.dump', 'PyGithub.Organization.Organization._useAttributes', 'PyGithub.Commit.Commit', 'PyGithub.GithubException.GithubException.__init__', 'PyGithub.Notification.Notification', 'PyGithub.Deployment.Deployment.created_at', 'PyGithub.Deployment.Deployment._initAttributes', 'PyGithub.Deployment.Deployment.description', 'PyGithub.ContentFile.ContentFile', 'PyGithub.StatsContributor.StatsContributor', 'PyGithub.Repository.Repository.get_deployments', 'PyGithub.ProjectCard.ProjectCard.edit', 'PyGithub.Deployment.Deployment.updated_at', 'PyGithub.PullRequest.PullRequest.update_branch', 'PyGithub.ContentFile.ContentFile.decoded_content', 'PyGithub.Organization.Organization.default_repository_permission', 'PyGithub.ProjectCard.ProjectCard.move', 'PyGithub.Repository.Repository.__create_pull', 'PyGithub.Deployment.Deployment.creator', 'PyGithub.Repository.Repository.releases_url', 'PyGithub.Repository.Repository.create_deployment', 'PyGithub.NamedUser.NamedUser.get_orgs', 'PyGithub.Project.Project', 'PyGithub.Deployment.Deployment.id', 'PyGithub.Notification.Notification.get_pull_request', 'PyGithub.PullRequest.PullRequest.add_to_assignees', 'PyGithub.Rate.Rate.__repr__', 'PyGithub.Organization.Organization.hooks_url', 'PyGithub.Notification.Notification.get_issue', 'PyGithub.PullRequest.PullRequest.maintainer_can_modify', 'PyGithub.PullRequest.PullRequest.draft', 'PyGithub.PullRequest.PullRequest.create_review_comment', 'PyGithub.Organization.Organization.issues_url', 'PyGithub.MainClass.Github.create_from_raw_data', 'PyGithub.Commit.Commit.get_pulls', 'PyGithub.MainClass.Github.get_events', 'PyGithub.Repository.Repository._initAttributes', 'PyGithub.Deployment.Deployment.environment', 'PyGithub.MainClass.Github.get_project_column', 'PyGithub.PaginatedList.PaginatedList', 'PyGithub.Organization.Organization.members_can_create_repositories', 'PyGithub.Deployment.Deployment.task', 'PyGithub.GithubObject.CompletableGithubObject.__init__', 'PyGithub.Deployment.Deployment.__repr__', 'PyGithub.GitRelease.GitRelease', 'PyGithub.Deployment.Deployment', 'PyGithub.GithubObject.CompletableGithubObject', 'PyGithub.Repository.Repository.get_deployment', 'PyGithub.Deployment.Deployment._useAttributes', 'PyGithub.Repository.Repository.get_git_refs', 'PyGithub.Repository.Repository', 'PyGithub.MainClass.GithubIntegration.create_jwt', 'PyGithub.Deployment.Deployment.statuses_url', 'PyGithub.AuthenticatedUser.AuthenticatedUser.get_organization_membership', 'PyGithub.Deployment.Deployment.sha', 'PyGithub.Deployment.Deployment.original_environment', 'PyGithub.Organization.Organization', 'PyGithub.Repository.Repository.create_pull', 'PyGithub.Repository.Repository._useAttributes', 'PyGithub.NamedUser.NamedUser', 'PyGithub.Team.Team', 'PyGithub.Deployment.Deployment.payload', 'PyGithub.PullRequest.PullRequest', 'PyGithub.PullRequest.PullRequest.edit', 'PyGithub.Team.Team.get_repo_permission', 'PyGithub.AuthenticatedUser.AuthenticatedUser', 'PyGithub.PullRequest.PullRequest.remove_from_assignees', 'PyGithub.MainClass.GithubIntegration', 'PyGithub.Organization.Organization.has_repository_projects', 'PyGithub.Deployment.Deployment.url', 'PyGithub.ProjectColumn.ProjectColumn', 'PyGithub.Repository.Repository.legacy_search_issues', 'PyGithub.PullRequest.PullRequest.create_review_comment_reply', 'PyGithub.Repository.Repository.create_repository_dispatch', 'PyGithub.PullRequest.PullRequest._useAttributes', 'PyGithub.NamedUser.NamedUser.get_projects', 'PyGithub.MainClass.Github', 'PyGithub.ProjectCard.ProjectCard.delete', 'PyGithub.Organization.Organization.create_project', 'PyGithub.Repository.Repository.__create_pull_1', 'PyGithub.Repository.Repository.has_pages']

diff: 1.51(original) 1.47
['PyGithub.PullRequest.PullRequest.maintainer_can_modify', 'PyGithub.ProjectCard.ProjectCard', 'PyGithub.Repository.Repository._useAttributes', 'PyGithub.PullRequest.PullRequest._initAttributes', 'PyGithub.ContentFile.ContentFile', 'PyGithub.StatsContributor.StatsContributor', 'PyGithub.Organization.Organization.issues_url', 'PyGithub.MainClass.Github.create_from_raw_data', 'PyGithub.Organization.Organization.has_organization_projects', 'PyGithub.Repository.Repository.get_git_matching_refs', 'PyGithub.MainClass.Github.get_events', 'PyGithub.Repository.Repository._initAttributes', 'PyGithub.PullRequest.PullRequest', 'PyGithub.Repository.Repository.deployments_url', 'PyGithub.PullRequest.PullRequest.edit', 'PyGithub.ContentFile.ContentFile.decoded_content', 'PyGithub.AuthenticatedUser.AuthenticatedUser', 'PyGithub.Organization.Organization.default_repository_permission', 'PyGithub.ProjectCard.ProjectCard.move', 'PyGithub.MainClass.Github.get_project_column', 'PyGithub.PaginatedList.PaginatedList', 'PyGithub.Organization.Organization.members_can_create_repositories', 'PyGithub.Repository.Repository.__create_pull', 'PyGithub.MainClass.GithubIntegration', 'PyGithub.Organization.Organization.has_repository_projects', 'PyGithub.GitRelease.GitRelease', 'PyGithub.Repository.Repository.releases_url', 'PyGithub.Organization.Organization._initAttributes', 'PyGithub.ProjectColumn.ProjectColumn', 'PyGithub.Repository.Repository.legacy_search_issues', 'PyGithub.Repository.Repository.create_repository_dispatch', 'PyGithub.Notification.Notification.get_pull_request', 'PyGithub.PullRequest.PullRequest._useAttributes', 'PyGithub.MainClass.Github.dump', 'PyGithub.Organization.Organization._useAttributes', 'PyGithub.MainClass.Github', 'PyGithub.Repository.Repository.has_pages', 'PyGithub.Repository.Repository', 'PyGithub.MainClass.GithubIntegration.create_jwt', 'PyGithub.Notification.Notification', 'PyGithub.AuthenticatedUser.AuthenticatedUser.get_organization_membership', 'PyGithub.Organization.Organization', 'PyGithub.Organization.Organization.create_project', 'PyGithub.Organization.Organization.hooks_url', 'PyGithub.Notification.Notification.get_issue']

diff: 1.51(original) 1.50
['PyGithub.MainClass.Github.get_project_column', 'PyGithub.ProjectColumn.ProjectColumn', 'PyGithub.MainClass.Github']

As for other packages, the APIs of base64, urllib, json, re, time and logging are called by PyGithub 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 PyGithub from "PyGithub==1.51" to "PyGithub>=1.46,<=1.51". This will improve the applicability of 154Algoritm-5weeks 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