Commit Graph
1890 Commits
Author SHA1 Message Date
Steve Kowalik 743f5a58b0 Publish version 1.53 2020-08-18 18:15:44 +10:00
Steve Kowalik 2646a98c31 Test Organization.get_hook() (#1660)
Add a testcase for Organization.get_hook()
2020-08-18 18:14:20 +10:00
Tal Machani 749e8d359a Add method get_team_membership for user to Team (#1658)
* - Add method get_team_membership for user

* add typing get_team_membership for member

Fixes #1657
2020-08-18 17:45:01 +10:00
Steve Kowalik 429fcc7307 Add typing files for OAuth classes (#1656)
The additional classes added for OAuth predated the inclusion of typing
files, add them for the new classes.
2020-08-18 14:46:34 +10:00
Chris de Graaf f891bd6136 Fix Repository.create_repository_dispatch type signature (#1643)
* Fix Repository.create_repository_dispatch type signature

* Change from object to Any
2020-08-10 10:17:51 +10:00
Steve Kowalik 69b37b4ab6 PaginatedList's totalCount is 0 if no last page (#1641)
When calculating totalCount for PaginatedList, if the links data does
not contain a last page, we can't know how many elements are contained
in the list. Set it to 0 in that case.

Fixes #1614
2020-08-09 19:05:04 +10:00
Mahesh Raju 260558c101 Add initial support for Github Apps. (#1631)
* Add initial support for Github Apps.

Needed for #1621
2020-08-09 19:04:41 +10:00
Steve Kowalik 165d995da2 Correct **kwargs typing for search_* (#1636)
It turns out typing for **kwargs is always Dict[str, Type], so only the
type is required.

Fixes #1633
2020-08-06 21:56:09 +10:00
Ethan Roy 15b5ae0c75 Add delete_branch_on_merge arg to Repository.edit type stub (#1639)
Add missing delete_branch_on_merge argument to Repository.edit() stub
2020-08-05 12:41:47 +10:00
Ethan Roy 8912be6411 Fix type stub for MainClass.get_user (#1637)
-   Add `login` arg default value to stub to match source
2020-08-05 12:40:31 +10:00
Ethan Roy de386dfb15 Add type stub for Repository.create_fork (#1638)
Add type stub for Repository.create_fork()
2020-08-05 12:39:06 +10:00
Steve Kowalik 5ad091d018 Correct Repository.create_pull typing harder (#1635)
It turns out if an argument is optional for an overloaded method, the
type hints require the default argument specified to successfully match
against the correct signature. Furthermore, the second kind of
create_pull() does not support the draft argument at all, so remove it.

Fixes #1634
2020-08-04 17:49:49 +10:00
Steve Kowalik 707246519e Publish version 1.52 2020-08-03 18:45:52 +10:00
Jesse Li a778639362 upload_asset with data in memory (#1601)
* Expose upload from memory functionality
* Upload from memory basic test
* Test for custom file like object
* Reorganized existing release tests
* Remove docstrings & comments from tests
* Modify logic
* Explain why encode ignores its argument

Fixes #1140
2020-08-03 18:42:06 +10:00
Chris de Graaf 06dae3877c Make Issue.closed_by nullable (#1629) 2020-08-03 18:40:59 +10:00
Mahesh Raju 16850ef1ed Add support for workflow dispatch event (#1625)
* Add support for workflow dispatch event

Fixes: #1624
2020-07-30 16:43:05 +10:00
Steve Kowalik 136a3e8008 Do not check reaction_type before sending (#1592)
There is a bunch of repeated code checking reactions which has the issue
that it can easily get out of date with what GitHub accepts. Drop the
check, and rely on GitHub returning an error.

Fixes #1554
2020-07-27 14:16:52 +10:00
Liuyang Wan 416f2d0f2e Various Github Action improvement (#1610) 2020-07-27 12:15:38 +08:00
Emir HodzicandLiuyang Wan 85e71361fb more flexible header splitting (#1616)
Co-authored-by: Liuyang Wan <tsfdye@gmail.com>
2020-07-21 23:18:58 +08:00
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
dependabot-preview[bot]anddependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> e272f11721 Create Dependabot config file (#1607)
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-07-16 21:57:22 +08: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
dependabot-preview[bot]anddependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> f9e4feebeb Update sphinx-rtd-theme requirement from <0.5 to <0.6 (#1563)
Updates the requirements on [sphinx-rtd-theme](https://github.com/rtfd/sphinx_rtd_theme) to permit the latest version.
- [Release notes](https://github.com/rtfd/sphinx_rtd_theme/releases)
- [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst)
- [Commits](https://github.com/rtfd/sphinx_rtd_theme/compare/0.1.8...0.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-24 17:44:41 +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
Christian Clauss 6f1640d23e Upgrade actions/setup-python to v2 (#1555)
https://github.com/actions/setup-python/releases
2020-06-10 13:02:23 +08:00
Steve Kowalik 925764add5 Clean up tests for GitReleaseAsset (#1546)
The test class for GitReleaseAsset did not match the filename, was also
the only class to include docstrings, and furthermore, repeated a lot of
fetches in the replay data.
2020-06-03 20:51:41 +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 69bfc32511 Check all arguments of NamedUser.get_repos() (#1532)
The two unit tests for NamedUser.get_repos() did not check all
arguments, and this was the only method in the file that wasn't
completly covered. Re-record the replay data while passing all arguments
to the method.
2020-05-25 11:33:54 +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 e79b9013fe Turn on coverage reporting for codecov (#1522)
Since we migrated from Travis to GitHub Actions, our coverage on codecov
has been reporting as 0%, since uploading the .coverage file is a
terrible idea. Turn on XML-based reporting, ignore the file and use that
when we upload to codecov.
2020-05-19 12:28:33 +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