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
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
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
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
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
Denis Blanchette
cc1b884c98
Remove "api_preview" parameter from type stubs and docstrings ( #1559 )
2020-06-18 18:30:33 +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
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
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
Nikolay Edigaryev
5cf9950b25
Ability to retrieve public events ( #1481 )
2020-04-26 10:03:54 +08:00
Alice GIRARD and Liuyang Wan
91433fe925
Type stubs for mypy ( #1231 )
...
* First attempt at stubs
* fix AuthenticatedUser.piy
* fix PullRequest.piy
* fix Authorization.piy
* fix Branch.piy
* fix Clones.piy
* fix Commit.piy
* fix CommitCombinedStatus.piy
* fix CommitComment.piy
* fix CommitStatus.piy
* fix ContentFile.piy
* fix Download.piy
* fix Event.piy
* fix File.piy
* fix Gist.piy
* fix GistComment.piy
* fix GistFile.piy
* fix GitAuthor.piy
* fix GitBlob.piy
* fix GitCommit.piy
* fix GitRef.piy
* fix GitRelease.piy
* renamed stubs into pyi files
* fix Notification
* fix Repository
* fix GitReleaseAsset
* fix GitTag
* fix GitTree
* fix GitTreeElement
* fix GithubException
* fix GithubObject
* fix GitignoreTemplate
* fix HookDescription
* fix HookResponse
* fix InputGitAuthor
* fix Installation
* fix InstallationAuthorization
* fix Invitation
* fix Issue
* fix IssueComment
* Fix random issues found while testing
* fix IssuePullRequest
* fix Label
* fix License
* fix Migration
* fix Milestone
* fix NamedUser
* fix NotificationSubject
* fix Organization
* fix PaginatedList
* fix Path
* fix Permissions
* fix Plan
* fix Project
* fix ProjectCard
* fix ProjectColumn
* fix PullRequestComment
* fix PullRequestMergeStatus
* fix PullRequestPart
* fix PullRequestReview
* fix Rate
* fix RateLimit
* fix Reaction
* fix Referrer
* fix RepositoryKey
* fix RequiredPullRequestReviews
* fix RequiredStatusChecks
* fix SourceImport
* fix Stargazer
* fix StatsCodeFrequency
* fix StatsCommitActivity
* fix StatsContributor
* fix Tag
* fix Team
* fix Topic
* fix UserKey
* fix MainClass
* fix Requester
* added stubs for View
* added stubs for Membership
* various syntax errors
* silence mypy noise
* keeping track of recent changes
* black + isort
Co-authored-by: Liuyang Wan <lwan@zendesk.com >
2020-03-22 19:33:23 +08:00