-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add type annotations #118
Merged
sigmavirus24
merged 31 commits into
python-hyper:main
from
Sachaa-Thanasius:feature/just-annotations
Jul 6, 2024
Merged
Add type annotations #118
Changes from 12 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
2dc1f0c
Add a few annotations.
Sachaa-Thanasius ae63851
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] c28dc0a
Add annotations to api.py.
Sachaa-Thanasius 602934c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] be28283
Preliminary, but added minimalistic typing check to tox and CI, as we…
Sachaa-Thanasius 719da58
Merge branch 'feature/just-annotations' of github.com:Sachaa-Thanasiu…
Sachaa-Thanasius 9df0355
Add parameter annotations to builder.py.
Sachaa-Thanasius 6c3d109
Add type annotations to `compat.to_str()` and `compat.to_bytes()`.
Sachaa-Thanasius a7622de
Finish annotating `query_items` parameters in builder.py.
Sachaa-Thanasius 8cff806
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 57f5621
Account for current flake8 errors with noqa.
Sachaa-Thanasius f305405
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] c7ab1db
Annotate `misc.get_path()` while breaking an import cycle.
Sachaa-Thanasius c3b49f2
Add a comment explaining the reason `_QueryType` in builder.py is mod…
Sachaa-Thanasius dd96a34
Fix compat.py and api.py parameter annotations to accept bytearray as…
Sachaa-Thanasius d99f274
Started annotating IRIReference and URIReference.
Sachaa-Thanasius f4d150f
Fix: Removing the bytearray hints. Sticking to bytes and str is simpl…
Sachaa-Thanasius 0179352
Partially annotated parseresult.py and _mixin.py.
Sachaa-Thanasius 3969c1d
Finish annotating return types in builder.py.
Sachaa-Thanasius 9e812f3
Made minor adjustments to a few annotations.
Sachaa-Thanasius 9862d65
Fix port not being marked as `int` in several places.
Sachaa-Thanasius 3c22353
More annotations that I forgot to break up into multiple commits.
Sachaa-Thanasius ee23708
Fix variable annotation for `uri` in `URIMixin`.copy_with.
Sachaa-Thanasius fadc962
Fix annotation for `misc.UseExisting` to be `Final` to avoid reassign…
Sachaa-Thanasius c923049
Change how port is determined/validated in `validators.subauthority_c…
Sachaa-Thanasius 7fc9af0
Replace reorder-python-imports and flake8-import-order with isort, al…
Sachaa-Thanasius bf1a44d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 283f910
Add exclude lines to .coveragerc to account for a) `if t.TYPE_CHECKIN…
Sachaa-Thanasius 6a4daf3
Merge branch 'feature/just-annotations' of github.com:Sachaa-Thanasiu…
Sachaa-Thanasius 1443cd1
Add `#pragma: no cover` to final line missing coverage, as well as a …
Sachaa-Thanasius be1a4e8
Adjust typing check to use wrapper/shim script for now.
Sachaa-Thanasius File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[tool.pyright] | ||
include = ["src/rfc3986"] | ||
ignore = ["tests"] | ||
pythonVersion = "3.8" | ||
typeCheckingMode = "strict" | ||
|
||
reportPrivateUsage = "none" | ||
reportImportCycles = "warning" | ||
reportPropertyTypeMismatch = "warning" | ||
reportUnnecessaryTypeIgnoreComment = "warning" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still bitter there's no way to tell GHA that "Hey, I have this list elsewhere of things I want to run against, can you just pick the 'earliest'/'oldest'/'smallest' so that when I update the list I don't have to update every goddamn reference to remove the oldest?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a novice at best when it comes to GHA and just went off of what the rest of the workflow looked like, so I have no idea if the technology exists, lol. It is a bit annoying, but I figured if a better way is found and it does get refactored, this would temporarily showcase what the output would look like in CI for
pyright --verifytypes
and either help or hurt the case for switching to and/or including mypy :D.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I'm just griping aloud, not hoping you would magically fix GitHub's product. 😂