8000 Merge remote-tracking branch 'origin/1.0-alpha' into ipython-docs · qiwsir/github3.py@27641cc · GitHub
[go: up one dir, main page]

Skip to content

Commit 27641cc

Browse files
committed
Merge remote-tracking branch 'origin/1.0-alpha' into ipython-docs
2 parents 7262a8b + 4074928 commit 27641cc

13 files changed

+167
-35
lines changed

LATEST_VERSION_NOTES.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ Old name New name
2525
``github3.iter_events`` ``github3.all_events``
2626
``github3.iter_followers`` ``github3.followers_of``
2727
``github3.iter_following`` ``github3.followed_by``
28-
``github3.iter_repo_issues`` ``github3.repository_issues``
28+
``github3.iter_repo_issues`` ``github3.issues_on``
2929
``github3.iter_orgs`` ``github3.organizations_with``
3030
``github3.iter_user_repos`` ``github3.repositories_by``
3131
``github3.iter_starred`` ``github3.starred_by``
3232
``github3.iter_subscriptions`` ``github3.subscriptions_for``
33+
``Deployment#iter_statuses`` ``Deployment#statuses``
3334
``Gist#iter_comments`` ``Gist#comments``
3435
``Gist#iter_commits`` ``Gist#commits``
3536
``Gist#iter_files`` ``Gist#files``
@@ -46,7 +47,7 @@ Old name New name
4647
``GitHub#iter_org_issues`` ``GitHub#organization_issues``
4748
``GitHub#iter_issues`` ``GitHub#issues``
4849
``GitHub#iter_user_issues`` ``GitHub#user_issues``
49-
``GitHub#iter_repo_issues`` ``GitHub#repository_issues``
50+
``GitHub#iter_repo_issues`` ``GitHub#issues_on``
5051
``GitHub#iter_keys`` ``GitHub#keys``
5152
``GitHub#iter_orgs`` ``GitHub#{organizations,organizations_with}``
5253
``GitHub#iter_repos`` ``GitHub#reposistories``
@@ -55,6 +56,7 @@ Old name New name
5556
``Issue#iter_comments`` ``Issue#comments``
5657
``Issue#iter_events`` ``Issue#events``
5758
``Issue#iter_labels`` ``Issue#labels``
59+
``Milestone#iter_labels`` ``Milestone#labels``
5860
``Organization#iter_members`` ``Organization#members``
5961
``Organization#iter_public_members`` ``Organization#public_members``
6062
``Organization#iter_repos`` ``Organization#repositories``

github3/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from github3.api import (
2121
authorize, login, enterprise_login, emojis, gist, gitignore_template,
2222
create_gist, issue, markdown, octocat, organization, pull_request,
23-
followers_of, followed_by, public_gists, gists_by, repository_issues,
23+
followers_of, followed_by, public_gists, gists_by, issues_on,
2424
gitignore_templates, all_repositories, all_users, all_events,
2525
organizations_with, repositories_by, starred_by, subscriptions_for,
2626
rate_limit, repository, search_code, search_repositories, search_users,
@@ -34,8 +34,8 @@
3434
'login', 'enterprise_login', 'emojis', 'gist', 'gitignore_template',
3535
'create_gist', 'issue', 'markdown', 'octocat', 'organization',
3636
'pull_request', 'followers_of', 'followed_by', 'public_gists', 'gists_by',
37-
'repository_issues', 'gitignore_templates', 'all_repositories',
38-
'all_users', 'all_events', 'organizations_with', 'repositories_by',
39-
'starred_by', 'subscriptions_for', 'rate_limit', 'repository',
40-
'search_code', 'search_repositories', 'search_users', 'user', 'zen',
37+
'issues_on', 'gitignore_templates', 'all_repositories', 'all_users',
38+
'all_events', 'organizations_with', 'repositories_by', 'starred_by',
39+
'subscriptions_for', 'rate_limit', 'repository', 'search_code',
40+
'search_repositories', 'search_users', 'user', 'zen',
4141
)

github3/api.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,9 @@ def gists_by(username, number=-1, etag=None):
233233
return iter([])
234234

235235

236-
def repository_issues(owner, repository, milestone=None, state=None,
237-
assignee=None, mentioned=None, labels=None, sort=None,
238-
direction=None, since=None, number=-1, etag=None):
236+
def issues_on(owner, repository, milestone=None, state=None, assignee=None,
237+
mentioned=None, labels=None, sort=None, direction=None,
238+
since=None, number=-1, etag=None):
239239
"""Iterate over issues on owner/repository.
240240
241241
.. versionchanged:: 0.9.0
@@ -268,9 +268,9 @@ def repository_issues(owner, repository, milestone=None, state=None,
268268
269269
"""
270270
if owner and repository:
271-
return gh.repository_issues(owner, repository, milestone, state,
272-
assignee, mentioned, labels, sort,
273-
direction, since, number, etag)
271+
return gh.issues_on(owner, repository, milestone, state, assignee,
272+
mentioned, labels, sort, direction, since, number,
273+
etag)
274274
return iter([])
275275

276276

github3/github.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -707,10 +707,9 @@ def user_issues(self, filter='', state='', labels='', sort='',
707707
params.update(per_page=per_page)
708708
return self._iter(int(number), url, Issue, params, etag)
709709

710-
def repository_issues(self, owner, repository, milestone=None,
711-
state=None, assignee=None, mentioned=None,
712-
labels=None, sort=None, direction=None, since=None,
713-
number=-1, etag=None):
710+
def issues_on(self, owner, repository, milestone=None, state=None,
711+
assignee=None, mentioned=None, labels=None, sort=None,
712+
direction=None, since=None, number=-1, etag=None):
714713
"""List issues on owner/repository. Only owner and repository are
715714
required.
716715

github3/issues/milestone.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@ def delete(self):
5757
"""
5858
return self._boolean(self._delete(self._api), 204, 404)
5959

60-
def iter_labels(self, number=-1, etag=None):
61-
"""Iterate over the labels for every issue associated with this
62-
milestone.
60+
def labels(self, number=-1, etag=None):
61+
r"""Iterate over the labels of every associated issue.
6362
6463
.. versionchanged:: 0.9
6564

github3/repos/deployment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def create_status(self, state, target_url='', description=''):
7373

7474
return DeploymentStatus(json, self) if json else None
7575

76-
def iter_statuses(self, number=-1, etag=None):
76+
def statuses(self, number=-1, etag=None):
7777
"""Iterate over the deployment statuses for this deployment.
7878
7979
:param int number: (optional), the number of statuses to return.

tests/integration/test_issues_milestone.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55

66
class TestMilestone(IntegrationHelper):
7-
def test_iter_labels(self):
7+
def test_labels(self):
88
"""Test the ability to iterate over milestone labels."""
9-
cassette_name = self.cassette_name('iter_labels')
9+
cassette_name = self.cassette_name('labels')
1010
with self.recorder.use_cassette(cassette_name):
1111
issue = self.gh.issue('sigmavirus24', 'github3.py', 206)
1212
milestone = issue.milestone
1313
assert milestone is not None
14-
for label in milestone.iter_labels():
14+
for label in milestone.labels():
1515
assert isinstance(label, github3.issues.label.Label)

tests/integration/test_repos_deployment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_create_status(self):
2727

2828
assert isinstance(status, github3.repos.deployment.DeploymentStatus)
2929

30-
def test_iter_statuses(self):
30+
def test_statuses(self):
3131
"""Show that a user can retrieve deployment statuses."""
3232
cassette_name = self.cassette_name('statuses')
3333
with self.recorder.use_cassette(cassette_name):
@@ -36,7 +36,7 @@ def test_iter_statuses(self):
3636
deployment = find(lambda d: d.id == 801,
3737
repository.deployments())
3838
assert deployment is not None
39-
statuses = list(deployment.iter_statuses(5))
39+
statuses = list(deployment.statuses(5))
4040

4141
for status in statuses:
4242
assert isinstance(status,

tests/unit/test_api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,12 @@ def test_repository(self):
145145
self.gh.repository.assert_called_once_with('sigmavirus24',
146146
'github3.py')
147147

148-
def test_repository_issues(self):
149-
"""Show that github3.repository_issues proxies to GitHub."""
148+
def test_issues_on(self):
149+
"""Show that github3.issues_on proxies to GitHub."""
150150
args = ('owner', 'repository', None, None, None, None, None, None,
151151
None, None, -1, None)
152-
github3.repository_issues(*args)
153-
self.gh.repository_issues.assert_called_with(*args)
152+
github3.issues_on(*args)
153+
self.gh.issues_on.assert_called_with(*args)
154154

155155
def test_repositories_by(self):
156156
"""Show that github3.repositories_by proxies to GitHub."""

0 commit comments

Comments
 (0)
0