Commit Graph
1096 Commits
Author SHA1 Message Date
Jannis Gebauer 2002d8b2cb Merge pull request #1021 from rigaspapas/implement-apps-oauth-endpoints
Implement OAuth for apps
2020-07-20 11:51:32 +02:00
Colby Gallup 048c8a1df2 Add support for deployment statuses (#1588)
* Added DeploymentStatus class
* Added stubs for DeploymentStatus class
* Fixed headers for DeploymentStatus.py
* Added get/list/create deployment status methods
* Added DeploymentStatus repr
* Added attribute check tests for DeploymentStatus
* Added "create deployment status" test
* Added test for Deployment.get_statuses()
* Added Deployment.get_status() method

Fixes #1586
2020-07-02 12:27:05 +10:00
Daniel Haas 079f75a726 Adds the 'twitter_username' attribute to NamedUser. (#1585)
* Adds the 'twitter_username' attribute to NamedUser.
2020-06-27 14:43:48 +10:00
Steve Kowalik 1879518e2b Create WorkflowRun.timing namedtuple from the dict (#1587)
To stop non-deterministic dictionary ordering ruining our day on Python
3.5, create the namedtuple using the keys of the dictionary.
2020-06-27 11:56:04 +10:00
Alex Torok c84fad818a Add missing properties to PullRequest.pyi (#1577)
Two missing attributes were added to PullRequest.pyi
2020-06-27 10:10:18 +10:00
Steve Kowalik 4fb1d23f4d Add support for Workflow Runs (#1583)
To build on the previous work supporting querying Workflows for GitHub
Actions, add a class and relevant methods to support querying runs of a
workflow.
2020-06-26 20:47:42 +10:00
Steve Kowalik 4ed7aaf8e5 More precise typing for Repository.create_pull (#1581)
The typing information for Repository.create_pull did no type checking
of the arguments at all. Using the overload functionality, specify both
styles of create_pull(). Drive-by a nearby function from using a generic
dict to Dict[str, str].
2020-06-25 18:47:01 +10:00
Steve Kowalik 3668f866e3 More precise typing for MainClass.get_user() (#1575)
Use typing.overload for MainClass.get_user() since it can return two
disparate types. Correct the docstring for it, as well as locking down
Sphinx to <3 due to built docs issue and drive-by link correction.

Fixes #1550
2020-06-24 16:21:18 +10:00
Mark Bromell f0f6ec83dd Small documentation correction in Repository.py (#1565)
Class `github.Clone.Clone` doesn't exist and should reference `github.Clones.Clones` instead.
2020-06-20 12:41:25 +10:00
Denis Blanchette cc1b884c98 Remove "api_preview" parameter from type stubs and docstrings (#1559) 2020-06-18 18:30:33 +10:00
Steve Kowalik 9fb8588b28 Repository.update_file() content also accepts bytes (#1543)
The typing information for the update_file() method's content parameter
states it will only accept str, whereas it will accept both str and
bytes.

Fixes #1542
2020-05-28 09:36:37 +10:00
Huw Jones b40b75f843 Fix Repository.get_issues stub (#1540)
Fixes #1539
2020-05-27 10:24:16 +10:00
Steve Kowalik f41c046f0e Correct Workflow typing (#1533)
When Workflow support was added, the method calls were not added to
the typing file for Repository, and somehow the class name for the
Workflow typing file was incorrect.
2020-05-23 16:04:06 +10:00
Steve Kowalik 7abf600480 Remove RateLimit.rate (#1529)
RateLimit.rate was first deprecated in v1.43.2, which was released 20
months ago. As that's a fairly generous deprecation period, remove it.
2020-05-21 09:59:35 +10:00
Steve Kowalik 19fc43abf6 PullRequestReview is not a completable object (#1528)
While chasing coverage failures, I discovered PullRequestReview's do not
send back a URL at all, which means firstly, the url property is not
required because it will always be None, and secondly, the object can
never be completed. I'm not certain why this change broke the test, but
it looked brittle, refactor it to be clearer.
2020-05-21 09:59:05 +10:00
Steve Kowalik 52ec366be4 Test more attributes (#1526)
To increase coverage, sprinkle in some asserts for attributes that were
not checked -- this uncovered a bug in Issue that two attributes were
not properly initialized to NotSet.
2020-05-21 09:58:50 +10:00
Steve Kowalik 1dd1cf9cb1 Remove pointless setters in GitReleaseAsset (#1527)
This is the only class that includes property setters for two of the
attributes, which are untested, and even if they were used, would have
no impact since there is no method to submit the changes back to GitHub.
Drop them.
2020-05-20 20:22:32 +10:00
Steve Kowalik d4b61311a1 Drop some unimplemented methods in GitRef (#1525)
There are two unimplemented methods in GitRef, which are mostly covered
by Commit.get_statuses(), remove them.
2020-05-20 18:31:25 +10:00
Steve Kowalik 61b610926a Remove unneeded duplicate string checks in Branch (#1524)
There were multiple calls checking if an element of a list was a string
or a string -- I suspect this pre-dates use of six in the code base, but
let's clean it up.
2020-05-20 12:37:52 +10:00
Steve Kowalik 291c46303d Drastically increase coverage by checking repr() (#1521)
A lot of our missing coverage is caused by not checking repr(), which is
trivial enough to test against -- do so, and also clean up existing repr
tests to look the same by calling repr(). Where it was trivial, add a
few assertions about missing attributes.
2020-05-19 11:54:07 +10:00
Dominic Davis-Foster ce400bc770 Fixed formatting of docstrings for Repository.create_git_tag_and_release() and StatsPunchCard. (#1520) 2020-05-18 18:04:40 +10:00
Steve Kowalik 53d58d2b07 Remove Repository.topics (#1505)
The topics attribute has been replaced by Repository.get_topics(). To
reduce user confusion, delete the attribute.

Fixes #1504
2020-05-15 10:49:15 +10:00
Steve Kowalik 7b20b13d0b Small improvements to typing (#1517)
Work through some of the errors when running mypy with --strict.
2020-05-15 10:47:22 +10:00
Steve Kowalik 8727003fc8 Correct Repository.get_workflows() (#1518)
The API endpoint Repository.get_workflows() calls returns data in a list
item, not directly, leading to some head scratching when calling it
against GitHub. Re-record the replay data.
2020-05-14 16:45:01 +10:00
Max Wittig f7cc534d50 docs(repository): correct releases link (#1514) 2020-05-11 08:15:06 +08:00
Michael Hirsch, Ph.D b5737d4103 correct Repository.stargazers_count return type to int (#1513)
It appears this was a type annotation typo, as the type of the stargazers_count property has been int for a long time.
2020-05-11 09:57:32 +10:00
Steve Kowalik 2475fa669a Raise a FutureWarning on use of client_{id,secret} (#1506)
client_id and client_secret are sent to GitHub encoded on the query
string, which GitHub has firmly deprecated, so much so as to email
people who are doing so. To discourage its use, raise a FutureWarning if
they are specified.

Fixes #1500
2020-05-05 21:23:22 +10:00
Sophie Alpert c7b5eff062 Improve type signature for create_from_raw_data (#1503)
Previously you could call it only on Repository or NamedUser. Now you can call it with any GithubObject subclass -- and the type is carried through to the return value.
2020-05-05 15:51:00 +10:00
Florent Clarret a32a896599 feat(column): move, edit and delete project columns (#1497)
Add support to move, edit and delete project columns.
2020-05-05 15:50:28 +10:00
Steve Kowalik a1ed7c0e2d Add support for Workflows (#1496)
To start supporting GitHub Actions, add the first part of that,
Workflow, which encapsulates a workflow over the API, along with
two methods on Repository to query them.
2020-05-05 15:49:45 +10:00
Chris de Graaf ba9d59c209 Add create_repository_dispatch to typing files (#1502) 2020-05-04 09:47:05 +08:00
Florent Clarret 63855409b9 feature: get the project column by id (#1466)
Add a method to fetch a project column by id.

Fixes #1057
2020-05-01 12:01:09 +10:00
Emily 6eba4506d4 Improve type stubs (#1489)
* Add type stubs for GithubException subclasses

* Install type stubs per PEP 561

See https://mypy.readthedocs.io/en/stable/installed_packages.html#making-pep-561-compatible-packages.

* Make PaginatedList a generic type

* Add type stubs for __init__.py

* Add type stub for NamedUser.get_projects

* Add GithubObject superclasses to type stubs

Fixes #1490
2020-05-01 12:00:00 +10:00
Rigas Papathanasopoulos 4b43711017 Add OAuth support for GitHub applications
Create the ApplicationOAuth class which is responsible for
handling a GitHub application's OAuth authorization process.
2020-04-28 22:10:48 +03:00
Rigas Papathanasopoulos 4a6468aa4a Create AccessToken entity
This class is used to represent access tokens created from a successful
OAuth authorization process.
2020-04-28 21:59:54 +03:00
Rigas Papathanasopoulos 61808da15e Extend installation attributes 2020-04-28 21:59:54 +03:00
Liuyang Wan 546d601b50 Fix all type issues flagged by mypy (#1484) 2020-04-26 12:40:05 +08:00
Steve Kowalik 84bb69abff Drop use of shadow-cat for draft PRs (#1469) 2020-04-26 10:05:20 +08:00
Florent Clarret e0997b438e Add and handle the maintainer_can_modify attribute in PullRequest (#1465) 2020-04-26 10:04:12 +08:00
Nikolay Edigaryev 5cf9950b25 Ability to retrieve public events (#1481) 2020-04-26 10:03:54 +08:00
Florent Clarret d3bc6a5cd2 List matching references (#1471) 2020-04-26 10:03:36 +08:00
Steve Kowalik 38b34db56e AuthenticatedUser.get_organization_membership() should be str (#1473) 2020-04-26 10:02:34 +08:00
Chris de Graaf edcbdfdaf9 Add create_repository_dispatch (#1449) 2020-04-26 09:59:34 +08:00
ton-katsu 3ab97d6145 Add some attributes. (#1468)
* Add some attributes to Repository and Organization

* Format.

* small fix

* Add some test.
2020-04-21 11:49:32 +10:00
Steve Kowalik 7046259832 Drop documentation for len() of PaginatedList (#1470)
PaginatedList does not support len(), so stop mentioning it in the
docstring.

Fixes #1462
2020-04-18 14:55:07 +10:00
chloe jungah kim bafc4efc76 fix param name of projectcard's move function (#1451)
* fix param name of projectcard's move function

* fix test failure
2020-04-16 21:38:19 +10:00
Steve Kowalik 83bef0f7b2 Correct typos found with codespell (#1467)
Correct misspellings and typos located using the codespell tool. Add
codespell to pre-commit to avoid further regressions.

Fixes #1459
2020-04-16 13:25:01 +10:00
Steve Kowalik 0ebdbb2675 Export IncompletableObject in the github namespace (#1450)
When IncompletableObject was added, it was only added to
GithubException, and not imported directly into the github namespace
like other exceptions. Correct that, and clean up the resultant now
unrequired import.
2020-04-15 10:52:13 +10:00
Steve Kowalik 393bd21bd1 Add missing mypy stubs (#1443)
Deployment, TimelineEvent{,Source} were missing mypy stubs, since they
were added after the mypy branch was started. Add them, and clean up two
spurious __future__ imports that are no longer required. Add mypy's
cache directory to .gitignore
2020-03-28 21:45:04 +11:00
Liuyang Wan af6cab5520 Reuse pre-commit checks in CI (#1442)
* Use pre-commit checks in CI

* Fix all issues flagged by mypy

* Update travis.yml to reflect testenv changes

* Update docs to use tox lint
2020-03-23 08:45:54 +08:00