Commit Graph
1143 Commits
Author SHA1 Message Date
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
Steve Kowalik 901af8c862 Remove client_id/client_secret authentication (#1888)
Authenticating via client_id and client_secret is dangerous, since they
appended to the query string, and can be easily seen from the URL.

client_id/client_secret have been deprecated since May 2020, and ignored
by GitHub since late 2020, so it's high time they were removed.
2021-03-23 14:48:47 +11:00
Steve Kowalik ddd437a7cd Export headers in GithubException (#1887)
Since the headers that led to an exception are also useful, firstly pass
them into the constructor, and then export them in a property. Test one
specific use case to make sure of coverage.

Fixes #1814
2021-03-23 13:47:05 +11:00
Steve Kowalik 696793dea7 Add support for deleting repository secrets (#1868)
When a previous commit added support for creating secrets on repository
objects, support was not added to also remove them. Since the GitHub API
does support that, add a method to do so.
2021-03-17 16:02:57 +11:00
Steve Kowalik aa24030471 Switch repository secrets to using f-strings (#1867)
New code written before we switched to f-strings need to get updated to
using them, so do so.
2021-03-08 15:11:38 +11:00
Chris KeatingandLiuyang Wan c90c050ef1 Adding github actions secrets (#1681)
* Fixed pre-commit issues

* Fixed mypy linting error

* Fix flake8 error

* Update PublicKey.py

* Update PublicKey.py

* Update setup.py

* Update setup.py

* Update requirements.txt

Co-authored-by: Liuyang Wan <tsfdye@gmail.com>

Co-authored-by: Liuyang Wan <tsfdye@gmail.com>
2021-03-07 05:40:52 +08:00
Yuya Nakamura 7db1b0c924 fix get_user_issues (#1842)
AuthenticatedUser.get_user_issues() calls the wrong API endpoint.

Fixes #1841
2021-03-05 15:27:34 +11:00
Steve Kowalik 290b62726f Switch all string addition to using f-strings (#1774)
Now that we no longer support Python 3.5, stop using string addition
everywhere it makes sense, and move to the best feature 3.6+ gives us,
f-strings!
2021-03-03 14:50:57 +11:00
Amador Pahim a77d4f48cb Enabling connetion pool_size definition
requests has a default connections pool of 10. Creating multiple threads
will consume from that same pool, since the underlying implementation of
the requests pool is a singletown.

Let's make the pool_size configurable, so clients can set the proper
number for their use case when running multiple threads.

Signed-off-by: Amador Pahim <apahim@redhat.com>
2021-01-08 11:55:36 +00:00
Amador Pahim aaec0a0f0f Always define the session adapter
This represents no change of behaviour, but it enables us to set more
options to the adapter.

Signed-off-by: Amador Pahim <apahim@redhat.com>
2021-01-08 11:55:36 +00:00
Steve Kowalik e113e37de1 Add pyupgrade to pre-commit configuration (#1783)
To help us switch to f-strings and other 3.6+ changes, add pyupgrade to
our pre-commit configuration to keep the codebase clean.
2020-12-15 14:07:33 +11:00
Pascal Hofmann 2432cffd3b Merge pull request #1733 from dubois/main
Fix #1731: Incorrect annotation
2020-12-03 13:32:53 +01:00
Paul Du Bois 82c349ce3e Fix #1731: Incorrect annotation 2020-12-02 18:12:41 -08:00
Pascal Hofmann fab682a5cc Fix stubs file for Repository 2020-11-30 08:53:59 +01:00
Dhruv ManilawalaandRaju Subramanian 6d501b286e Add support for Check Suites (#1764)
* Add initial support for Check Suites
* Add API call detail in CheckSuite.rerequest
* Update Accept header with general instead of preview
* Add 'get check runs' endpoint for CheckSuite with stubs
* Add create check suite endpoint with stub
* Update CheckSuite tests with creat check suite endpoint
* Add update check suites preferences endpoint
* Add repository preferences object and stub file
* Add update check suite preferences tests

Needed for #1621

Co-authored-by: Raju Subramanian <coder@mahesh.net>
2020-11-30 16:03:07 +11:00
Pascal Hofmann 197e065372 Add missing preview features of Deployment and Deployment Statuses API (#1674)
* Add missing preview features of Deployment and Deployment Statuses API
  - Enable support for deployment status states in_progress and queued
  - Add arguments production_environment and transient_environment to Repository.create_deployment()
  - Add attributes production_environment and transient_environment to Deployment
  - Use correct type in assertion for Deployment.payload
  - Fix incorrect assertion for description in Deployment.create_status()
  - Add arguments environment, environment_url, auto_inactive to Deployment.create_status()
  - Add attribute environment_url to DeploymentStatus
2020-11-30 15:47:54 +11:00
Steve KowalikandRaju Subramanian fcdd9eae2f Correct typing for Commit.get_comments() (#1765)
Commit.get_comments() returns a PaginatedList of CommitComment
instances, not commits.

Co-Authored-By: Raju Subramanian <coder@mahesh.net>
2020-11-26 16:32:17 +11:00
Dhruv Manilawala c77c06760e Add Support for Check Runs (#1727)
* Add CheckRun object and stub file
* Add list of check runs endpoint for Commit
* Add get check run endpoint for Repository
* Add CheckRun test file and replay data files
* Add CheckRunAnnotation object and stub file
* Add create CheckRun API endpoint to Repository
* Update and add new tests for CheckRun endpoint:
2020-11-19 14:29:04 +11:00
Steve Kowalik 19e46bbf90 Remove older MainClass.get_installation() (#1738)
There are two get_installation() methods in MainClass, with different
arguments. get_installation(owner, repo) is documented and tested, and
get_installation(id) is neither. Remove it to avoid confusion.
2020-11-11 18:14:55 +11:00
Omar Brikaa 4cfc9912c0 Added a method for getting a user by their id (#1691)
* Added a method for getting a user by their id

* Added get_user_by_id to MainClass stubs

Fixes #1615
2020-11-10 14:52:58 +11:00
Huw Jones 546f6495b7 Fix #1742 - incorrect typehint for Installation.id (#1743)
* Fix #1742
2020-11-06 15:44:14 +11:00
Yannick Jadoul 78a29a7ce0 Add WorkflowRun.workflow_id (#1737)
Add the missing attribute WorkflowRun.workflow_id
2020-11-04 14:12:17 +11:00
Victor Zeng 24251f4b0f Added support for the Self-Hosted actions runners API (#1684)
* Added data model for Self-Hosted Actions Runner

* Added function for getting self-hosted runners
2020-10-28 15:53:33 +11:00
latacora-daniel b42fb244f2 Added get_installations() to Organizations (#1695)
* Added get_installations() to Organizations

Fixes #1694
2020-10-28 14:00:47 +11:00
Andy Grunwald 1c55be5174 Fix #1507: Add new Teams: Add or update team repository endpoint (#1509)
* Add new Team.update_team_repository()

* Mark Team.set_repo_permission() as deprecated

 Fixes #1507
2020-10-28 13:43:35 +11:00
Victor Zeng c23564ddbd Added support for Repository.get_workflow_runs parameters (#1682)
* Added support for `Repository.get_workflow_runs` parameters

* Added anchor tag to docstring link

* Tests
2020-10-28 13:37:59 +11:00
Florent Clarret ee4c7a7e9e feat(pullrequest): add the rebaseable attribute (#1690) 2020-10-26 16:44:31 +11:00
Huan-Cheng Chang f7d203c083 Add support for deleting reactions (#1708)
* Delete comment reactions

* Add test case

* update ignore-word-list

* Delete issue reactions

* Delete issue comment reactions

* Delete pull request comment reactions

* check status
2020-10-26 16:40:46 +11:00
Steve Kowalik 08b72b48af Correct type hint for InputGitTreeElement.sha
InputGitTreeElement.sha was previously updated to accept None to allow
files to be deleted, but the type hint was not updated.

Fixes #1707
2020-10-02 15:13:13 +10:00
Steve Kowalik 07e29fe014 Format with new black (#1679)
Black is very opinionated, but sometimes those opinions change. Run the
new black version across the codebase, and lock down the version used by
pre-commit so we don't get surprised like this again.
2020-09-02 14:59:09 +10:00
Neil Williams 6bc9ecc8c8 Add get_timeline() to Issue's type stubs (#1663)
Add get_timeline() to Issue's type stubs
2020-08-28 14:20:12 +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
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
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
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