Skip to content

Conversation

@Thom1729
Copy link
Member

Fix #171.

@FichteFoll
Copy link
Member

Do you want to make a hotfix release for this?

Comment on lines +3 to 6
if sys.version_info >= (3, 8, 0):
from typing import * # noqa: F401, F403
except ImportError:
else:
from .typing_stubs import * # type: ignore # noqa: F401, F403
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be something like this instead so that the Sublime Text typing depedency is used when installed?

if sys.version_info >= (3, 8, 0):
    from typing import *  # noqa: F401, F403
else:
    try:
        from typing import *  # noqa: F401, F403
    except ImportError:
        from .typing_stubs import *  # type: ignore # noqa: F401, F403

Although I'm not sure what would be the point really. It would not change the runtime behavior and is not needed for pyright either.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not needed, and we've had issues with a similar approach with enum.

@rchl
Copy link
Member

rchl commented May 23, 2021

If you would want to ignore the reportWildcardImportFromLibrary warning you can add a configuration file in the root:

diff --git a/pyrightconfig.json b/pyrightconfig.json
new file mode 100644
index 0000000..d8bd1c1
--- /dev/null
+++ b/pyrightconfig.json
@@ -0,0 +1,4 @@
+{
+    "pythonVersion": "3.8",
+    "reportWildcardImportFromLibrary": "none"
+}

The pythonVersion is not relevant to the warning but would be good to have it explicit so that it guards against using "too new" features.

@rchl
Copy link
Member

rchl commented Jun 28, 2021

Can we get this out?

@FichteFoll
Copy link
Member

@Thom1729 can you?

@Thom1729 Thom1729 merged commit 6c78be3 into master Jul 5, 2021
@Thom1729 Thom1729 deleted the pyright-fix branch July 5, 2021 01:50
@FichteFoll
Copy link
Member

Do we not need a (hotfix) relase for it?

@Thom1729
Copy link
Member Author

If we can merge #166, we can release 1.6 and there's probably no need for a hotfix. If not, I can release a hotfix tonight or tomorrow.

@FichteFoll
Copy link
Member

SGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type annotations don't work correctly with pyright

3 participants