Commit Graph
1990 Commits
Author SHA1 Message Date
Steve Kowalik 6452ddfeb4 Add Repository.rename_branch method (#2089)
The GitHub API exposes an endpoint to rename a branch, so we should
support calling it. Sadly, there is not enough information to add
that method to the Branch class, so expose it in the Repository object.

Fixes #1901
2021-10-24 15:21:31 +11:00
c8a945bb42 Add function to delete pending reviews on a pull request (#1897)
Add a delete method to PullRequestReview to allow dismissing them.

Fixes #1856 

Co-authored-by: bagashvilit <bagashvilit@allegheny.edu>
Co-authored-by: WonjoonC <chos@allegheny.edu>
2021-10-24 15:15:31 +11:00
Steve Kowalik f1faf941ec Cover all code paths in search_commits (#2087)
The search_commits method was only very lightly tested, meaning over
half of it was not covered. Write another test case, covering all code
paths.
2021-10-22 08:39:31 +11:00
Steve Kowalik 93b92cd2fc Correctly deal when PaginatedList's data is a dict (#2084)
When calculating totalCount for a PaginatedList, if a Link header is not
in the returned data, we use len() to calculate the number of items.
PullRequest.get_review_requests() actually returns a dictionary, which
neatly defeats this naive method. Peer inside the dictionary in this
case, and add a test case.

Fixes #2053
2021-10-20 18:49:12 +11:00
Krishna Sheth 3f767649c8 Add comment on issue example (#2081)
Add an example showing how to comment on an existing issue.
2021-10-20 18:48:51 +11:00
Nicolai Weitkemper 70cc819e46 Use rate-limit in documentation URLs (#2036)
link to GitHub docs fixed: Replace rate_limit with rate-limit
2021-10-20 15:31:51 +11:00
Steve Kowalik 0422110987 Move lint and docs to Python 3.8 (#2077)
With Python 3.6 rapidly approaching end of life, move the docs and lint
tox targets to Python 3.8, and also switch readthedocs to match.
2021-10-19 15:34:23 +11:00
秋葉 4f00cbf2c4 Add two_factor_authentication in AuthenticatedUser. (#1972)
Fixes #1971
2021-10-19 15:07:53 +11:00
Katelyn Gigante d417e4c408 Add ProjectCard.edit() to the type stub (#2080)
The typing information for ProjectCard did not have edit().
Add it.
2021-10-18 19:24:27 +11:00
Steve Kowalik b1c8eec58f Add method to delete Workflow runs (#2078)
One piece of missing functionality is the ability to delete Workflow
Runs, which the GitHub API supports. Add a delete() method to
WorkflowRun.

Fixes #2019
2021-10-15 15:40:09 +11:00
James Simpson 53fb49882f Implement organization.cancel_invitation() (#2072)
Implement a new function cancel_invitation for github.Organization objects, allowing for
cancellation of organization invitations.
2021-10-13 16:22:54 +11:00
秋葉 6570892a79 Feat: Add html_url property in Team Class. (#1983)
Fixes: #1942
2021-10-13 15:57:07 +11:00
Steve Kowalik aa694f8edc Add support for Python 3.10 (#2073)
Now that Python 3.10 has been released, we should test it in CI.
2021-10-13 15:34:01 +11:00
Marina Peresypkina bc5e5950aa Add github actions secrets to org (#2006)
Add functionality to create and delete Secrets for Organizations.
2021-10-13 15:33:18 +11:00
Steve Kowalik fcc1236870 Correct replay for Organization.create_project() test (#2075)
The just landed test case for Organization.create_project() used the
wrong Authorization headers, correct it.
2021-10-12 17:55:28 +11:00
karthik-kadajji d71c25a6d4 Add type hint for Organization.create_project() (#2032)
Organization.create_project() did not have a type hint, add one, and a test case.
2021-10-12 16:10:48 +11:00
mickeydarrenlau 99e00a2894 Fix install command example (#2043)
It should be pip install PyGithub[integrations] not pip install PyGithub['integrations']
2021-10-12 16:06:54 +11:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 42f2c95cf5 Update sphinx-rtd-theme requirement from <0.6 to <1.1 (#2059)
Updates the requirements on [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) to permit the latest version.
- [Release notes](https://github.com/readthedocs/sphinx_rtd_theme/releases)
- [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst)
- [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/0.1.8...1.0.0)

---
updated-dependencies:
- dependency-name: sphinx-rtd-theme
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-12 16:06:09 +11:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> aa90effb81 Bump codecov/codecov-action from 1 to 2.1.0 (#2058)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 1 to 2.1.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v1...v2.1.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-12 16:05:42 +11:00
Steve Kowalik b10dbe3989 Fix AuthenticatedUser ReplayData with parameters (#2074)
A recently merged change modified AuthenticatedUser.get_notifications()
in how it passes boolean parameters, but did not modify the replay data.
Do so now.
2021-10-11 16:39:19 +11:00
majorvin c6215ae4ff Removed duplicate code (#2060)
Remove a duplicate line in the CheckRun class.
2021-10-11 15:47:31 +11:00
Huw Jones 3d86261f39 IssueEvent: add missing type hints (#2046)
Add two missing properties to IssueEvents type hints

Fixes #2039
2021-10-11 15:46:42 +11:00
sshekdar-VMware 1da600a343 Fix: #1671 Convert Python Bool to API Parameter for Authenticated User Notifications (#2001)
The parameters 'all' and 'participating' for AuthenticatedUser.get_notifications() should
be lower case strings, not textual forms of a boolean.

Fixes: #1671
2021-10-11 15:44:03 +11:00
Olmo Kramer d2d59f9ae8 Fix type of NamedUser.name (#2050)
The `name` attribute of a `NamedUser` is `None` if the user did not set
a name in their GitHub profile, but this was not reflected in the type.
2021-10-11 15:33:18 +11:00
Zack Koppert 7f458ad24c Merge pull request #2011 from marksweb/fix/2009
Fixed links to github docs
2021-10-08 15:58:33 -07:00
Mark Walker ab36b89aa5 Fixed links to github docs. [#2009] 2021-07-31 02:34:34 +01:00
Steve Kowalik 83d6e0719c Remove language_version for black (#1968)
When black was added, we did not want to run it under Python 3.5, since
upstream did not support it. We no longer support Python 3.5 ourselves,
so we no longer need to restrict the version black uses.
2021-06-21 20:29:09 +10:00
Steve Kowalik 7a5421837c Add types libraries to lint deps (#1975)
It appears recently that typing information for jwt and requests has
been split out into seperate projects on pypi, namely types-jwt and
types-requests. Since we utilise calling functions in their namespace,
we need to install them otherwise mypy will fail.
2021-06-19 10:22:29 +10:00
Steve Kowalik 1265747e99 Do not transform requestHeaders when logging (#1965)
Requester.__log() sanitizes the headers of the request so that
authentication details are not logged, but this has the side effect of
meaning that future requests that use the same Requester object will
fail. Usually, this is perfectly fine, since almost every method will
only make one request -- where this falls down is when we make another
after a redirect. Make a copy of the requestHeaders, and sanitize those.

Fixes #1959
2021-06-02 15:00:00 +10:00
Sachi King ed7d0fe94f Add type to OrderedDict (#1954)
OrderedDict needs to be typed just like Dict needs to be typed.  The
OrderedDict "input" variable key and value are used to append to a
string without any processing, so it seems unlikely that something other
than a string would be valid.
2021-06-02 14:59:42 +10:00
Alex 'Avunia' Takiya b46647054a Add Commit.get_pulls() to pyi (#1958)
Commit.get_pulls() is missing from the typing information, add it.
2021-06-02 14:57:00 +10:00
Steve Kowalik d1644e3350 Adding headers in GithubException is a breaking change (#1931)
Since exporting headers in GithubException might require passing them in
a constructor for client code, shift it as a breaking change so users
watch out for it.
2021-04-26 21:34:05 +10:00
Steve Kowalik 8aebd94fda Fix commit message typo in changelog (#1930)
It appears we run codespell over all documentation, so common typos are
picked up by CI. In other news, I must remember to run lint before
creating a release.
2021-04-26 15:27:07 +10:00
Steve Kowalik 31538337fa Publish version 1.55 2021-04-26 14:43:40 +10:00
Sachi King 27ba7838e1 Do not import from unpackaged paths in typing (#1926)
The tests path is not part of the shipped project, thus this type cannot
be checked by users of this project.

The correct type in place of the type imported from tests appears to be
Optional[
    Union[HTTPRequestsConnectionClass, HTTPSRequestsConnectionClass]
]
2021-04-26 14:24:54 +10:00
Steve Kowalik 4faff23ce9 Implement hash for CompletableGithubObject (#1922)
Since CompletableGithubObject already uses its URL attribute to
implement equality, extend it to also use that attribute for hashing.

Fixes #1826
2021-04-26 14:24:00 +10:00
Sachi King e4168109dd Use property decorator to improve typing compatibility (#1925)
As a property these functions are expected to be accessed without the
private __get_ and __set_ functions, however while the functions are
typed, the property is not, and mypy shows an attribute error.

As this codebase no-longer requires support for python versions without
support for @property.setter(2.6?) this updates the functions to use
decorators and updates the type files to reflect the attribute
existence.
2021-04-26 14:23:34 +10:00
Dhruv Bhanushali 54b6a97b95 Fix :rtype: directive (#1927)
Fixes a missing colon after :rtype in the ProjectColumn docs.
2021-04-26 14:22:15 +10:00
Steve Kowalik babcbcd04f Update most URLs to docs.github.com (#1896)
Now that GitHub have moved their documentation from
developer.github.com, we should update our links. I have also tried to
update the call strings to their new format, but since it was done via
regex, some of them may not match exactly.
2021-03-26 20:43:48 +11:00
MeggyCal ad124ef481 key_id could be int on Github Enterprise (#1894)
* PublicKey.key_id can also be int, as well as str

Fixes #1878
2021-03-26 20:31:17 +11:00
MeggyCal 2c77cfad56 Adjust to Github API changes regarding emails (#1890)
Handle AuthenticatedUser.get_emails() correctly with the GitHub API changes.

Fixes #1852
2021-03-24 21:30:01 +11:00
Steve Kowalik 5aab6f5dc2 Tighten asserts for new Permission tests (#1893)
The recently merged code checking attributes on Permissions overeagerly
used assertEqual for everything, switch to the more appropriate methods.
2021-03-24 14:39:58 +11:00
karsten-wagner 76879613fa Adding attributes "maintain" and "triage" to class "Permissions" (#1810)
* Adding attributes "maintain" and "triage" to class "github.Permissions.Permissions"

* Fix for failed test due to extended attribute list

* Adding new simplistic test case for class Permissions

Fixes #1809
2021-03-24 14:27:14 +11:00
John T. Wodder II 7d6bac9e4d Add default arguments to Workflow method type annotations (#1857)
The type annotations for Workflow.create_dispatch() and Workflow.get_runs() do not
include the fact that some of the arguments have default values
2021-03-24 13:58:42 +11:00
Steve Kowalik 916da53bef Re-raise the exception when failing to parse JSON (#1892)
Since GitHub has the bad manners to return bare strings for some API
endpoints, one sharp edge has been that JSON decoding errors were masked
since we wrap the string in a dictionary. However, this makes it
difficult to debug malformed JSON in replay data, so re-raise the
exception if the first character is a { or [ (IE, it's an object or
list.)
2021-03-24 13:56:54 +11:00
karsten-wagner 0245b758ca Allow adding attributes at the end of the list (#1807)
* Allow adding attributes at the end of the list / fix for issue #1806

* Update as per review comments
2021-03-24 10:18:04 +11:00
Floyd Hightower c27fb91966 Updating links to Github documentation for deploy keys (#1850)
* Updating links to Github documentation for deploy keys

There are a couple of links to http://developer.github.com/v3/repos/keys/ and I believe these should be going to http://developer.github.com/v3/repos/#deploy-keys. I've updated the docstrings in this file appropriately.
2021-03-24 10:17:28 +11:00
Sam Morgan a68577b76a Update PyJWT Version to 2.0+ (#1891)
* Update PyJWT version
* Fix `GitRelease.testUploadAssetWithName` test
  MIME type wasn't as expected

Fixes #1832
2021-03-24 10:14:35 +11:00
Steve Kowalik 3003e06501 Use right variable in both get_check_runs() (#1889)
Both CheckSuite and Commit have a get_check_runs() method that allows
filtering by a string -- the original code did not check for it, and
never added it to the query string since it checked the wrong variable.
Check the right variable and re-record the replay data.

Fixes #1843
2021-03-24 10:02:02 +11:00
Lars Kellogg-Stedman 6bae9e5cae fix bad assertions in github.Project.edit (#1817)
The assertions in github.Project.edit looked like the result of a bad
copy-paste operation: they were all making assertions about the `name`
parameter. This commit fixes them so they are checking different parameters.
2021-03-24 09:55:26 +11:00