Commit Graph
1953 Commits
Author SHA1 Message Date
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
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 e0acd8f466 Test repr() for PublicKey (#1879)
The new PublicKey tests did not test the repr() method, increase
coverage by doing so.
2021-03-22 13:07:22 +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
karsten-wagnerandSteve Kowalik b2232c89fb Manually fixing paths for codecov.io to cover all project files (#1813)
* Manually fixing paths for codecov.io to cover all project files

* Update codecov.yml

Fixes #1812

Co-authored-by: Steve Kowalik <steven@wedontsleep.org>
2021-03-08 14:14:03 +11:00
Sorin Sbarnea 64f532aecc Add missing links to project metadata (#1789)
Fixes: #1788
2021-03-08 14:12:51 +11:00
Steve Kowalik 55d98373d8 No longer show username and password examples (#1866)
With GitHub moving away from allowing authentication to the API using an
username and password, update our documentation to remove it and rely on
tokens. Perhaps we should link to how to create an API token, but that
can be addressed later.

Fixes #1851
2021-03-08 13:13:22 +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
Jimmy Zelinskie 6900f187b5 Merge pull request #1818 from apahim/define_pool_size
Make requests pool_size configurable
2021-02-06 21:48:20 -05: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 34d097ce47 Publish version 1.54.1 2020-12-24 15:11:01 +11:00
Edouard Benauw 31a1c00780 Pin pyjwt version (#1797)
* Pin pyjwt version

Pyjwt version is not fixed, which can cause syntax error for user since the release of breaking changes from pyjwt (https://pypi.org/project/PyJWT/#history)

* Update setup.py

Fixes #1796
2020-12-24 15:09:32 +11:00
Steve Kowalik f299699ccd Ignore pyupgrade commit for git blame (#1785)
Since the pyupgrade commit makes a large amount of changes, ignore the
commit by default with git blame.
2020-12-15 14:13:05 +11: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
Steve Kowalik 63e4fae997 Drop support for Python 3.5 (#1770)
In preperation for starting to use 3.6+ only features, stop testing
Python 3.5 in our CI, and bump our minimum required version.
2020-12-02 14:47:45 +11:00
Sébastien Besson a806b5233f Revert "Pin requests to <2.25 as well (#1757)" (#1763)
* Revert "Pin requests to <2.25 as well (#1757)"
* Ensure httpretty is more recent than 1.0.3

This reverts commit d159425f36.
2020-12-01 10:17:18 +11:00
Pascal Hofmann 9ee3afb171 Merge pull request #1767 from pascal-hofmann/fix-repository-stubs
Fix stubs file for Repository
2020-11-30 12:27:48 +01:00
Pascal Hofmann fab682a5cc Fix stubs file for Repository 2020-11-30 08:53:59 +01:00
Steve Kowalik 951fcdf23f Publish version 1.54 2020-11-30 16:43:49 +11: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
Steve Kowalik d159425f36 Pin requests to <2.25 as well (#1757)
requests 2.26 and its requirements break httpretty (see
gabrielfalcao/HTTPretty#409), so pin for the time being. Thanks to
Sébastien Besson and Dhruv Manilawala for the debugging assistance.
2020-11-19 21:48:10 +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
Steve Kowalik e690adf3ff List new project in introduction (#1739)
Fixes #1677
2020-11-04 14:45:57 +11:00
Steve Kowalik 09f49c7849 Add py39 env to tox (#1740)
An earlier commit added Python 3.9 support to CI, but neglected to
change tox.ini to support an environment, do so here.
2020-11-04 14:45:09 +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
Steve Kowalik 1bb18ab52e Add support for Python 3.9 (#1735)
With Python 3.9 released, we should support it. A later commit will
remove support for Python 3.5.
2020-11-03 16:39:06 +11:00