-
-
Notifications
You must be signed in to change notification settings - Fork 357
Give Pyright what it wants (alias
attributes everywhere)
#3114
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
Merged
Merged
Changes from 18 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
deb08a3
Pyright wants aliases everywhere
A5rocks 1e65f68
Changelog
A5rocks 59abcf8
Make backslash replacement more correct
A5rocks cbb08fb
Debug which class doesn't exist
A5rocks 9c97bad
Debug a bit better
A5rocks 35609d4
Fix weirdness around PosixPath needing to be resolved
A5rocks 4bc3e58
Appease type checker
A5rocks 37b9c38
Don't even consider tests in the alias test
A5rocks 3cda304
Turn paths into strings before indexing
A5rocks 9eca851
Explain the test better
A5rocks ba67f7e
Fixes for pre-commit
A5rocks 88cf458
Reformat according to black
A5rocks 819797a
One last pre-commit fix
A5rocks f21cbb0
Simplify alias test by monkeypatching attrs.
TeamSpen210 30befc9
Skip pyright init attributes test if plugin has not run
TeamSpen210 a23712c
Catch any other renaming too
A5rocks 74e67f1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 593701b
Handle autoattribs
A5rocks ff487e2
Disambiguate
A5rocks a6ea148
Synchronise name
TeamSpen210 637cc5f
Update import mode because it worked locally
A5rocks d8c0983
Check suspicions
A5rocks f32b8fb
Double check
A5rocks 7ccead5
Don't rely on installing `_trio_check_attrs_aliases.py` as a module
A5rocks 9b4c585
importlib import mode means we can use conftest again!
A5rocks 0c1ca17
Just do something hacky instead
A5rocks f0294da
Debug and remove `-Wall` for later PR
A5rocks cb5913d
Hopefully fix some things
A5rocks 942b371
Give into perl
A5rocks ce806e9
Add perl to alpine (should work now)
A5rocks 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 hidden or 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 @@ | ||
Ensure that Pyright recognizes our underscore prefixed attributes for attrs classes. |
This file contains hidden or 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 hidden or 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,22 @@ | ||
"""Conftest is executed by Pytest before test modules. | ||
|
||
We use this to monkeypatch attrs.field(), so that we can detect if aliases are used for test_exports. | ||
""" | ||
|
||
from typing import Any | ||
|
||
import attrs | ||
|
||
orig_field = attrs.field | ||
|
||
|
||
def field(**kwargs: Any) -> Any: | ||
original_args = kwargs.copy() | ||
metadata = kwargs.setdefault("metadata", {}) | ||
metadata["original_args"] = original_args | ||
return orig_field(**kwargs) | ||
|
||
|
||
# Mark it as being ours, so the test knows it can actually run. | ||
field.trio_modded = True # type: ignore | ||
attrs.field = field |
This file contains hidden or 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 hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.