github3.py

Why aren't conversation comments in a pull request being returned from PullRequest.iter_comments()?

白昼怎懂夜的黑 提交于 2020-01-25 20:40:13
问题 I am using github3 python API and I have this piece of code: # Create new PR or get existing one prs = [pr for pr in repo.iter_pulls(state="open", base="master", head="rev_testrev2")] if len(prs) > 0: pr = prs[0] else: pr = repo.create_pull("My pull request", "master", "rev_testrev2", "This is a test pull request") comments = [c for c in pr.iter_comments()] print str(comments) In the PR, in github web page, I have several comments in the "conversation" tab and just 1 in "Files Changed" tab.

TypeError: 'GitHubIterator' object does not support indexing [duplicate]

 ̄綄美尐妖づ 提交于 2020-01-07 02:51:47
问题 This question already has an answer here : Python: Object does not support indexing (1 answer) Closed 3 years ago . Using github3.py, I want to retrieve the last comment in the list of comments associated with a pull request and then search it for a string. I've tried the code below, but I get the error TypeError: 'GitHubIterator' object does not support indexing (without indexing, I can retrieve the list of comments). for comments in list(GitAuth.repo.issue(prs.number).comments()[-1]): if

Is there a way to get Tag objects instead of Reference ones when listing tags from a repository?

这一生的挚爱 提交于 2019-12-12 04:17:28
问题 I'm able to successfully list tags from a repository using github3 using: repo.iter_refs(subspace='tags') That results in a generator of github3.git.Reference objects. Is there a way for me use a similar mechanism to get github3.git.Tag objects, instead? Right now I'm forced to convert each Reference object into my own version of Tag . 回答1: So the only way to get a github3.git.Tag object back is if you're trying to retrieve a specific annotated tag (which is a tag created in a very specific

How can I find all public repos in github that a user contributes to?

风流意气都作罢 提交于 2019-12-09 13:13:24
问题 I'm using the github3 python library and am trying to find all public repos that users from our organization have contributed to (to reward the support of open source!). I've got the list of users for the organization, but now what? Can I use the public events iterator to find repos? #!/usr/bin/env python import argparse import github3 def get_organization(github, name): for organization in github.iter_orgs(): if organization.login == name: return organization def main(args): github = github3

How can I find all public repos in github that a user contributes to?

試著忘記壹切 提交于 2019-12-03 15:09:20
I'm using the github3 python library and am trying to find all public repos that users from our organization have contributed to (to reward the support of open source!). I've got the list of users for the organization, but now what? Can I use the public events iterator to find repos? #!/usr/bin/env python import argparse import github3 def get_organization(github, name): for organization in github.iter_orgs(): if organization.login == name: return organization def main(args): github = github3.login(args.github_username, password=args.github_password) organization = get_organization(github,