You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The mypy type checks for jupyter_server are currently *nix only. E.g. it will fail when trying to access socket.AF_UNIX when on windows. Using assert sys.platform != 'win32' as recommended for platform specific code doesn't seem to work?
For the Windows specific code, we have type: ignore comments on them. Since we use a strict config, this will fail with error: Unused "type: ignore" comment on Windows. Note that it is not currently possible to ignore "unused ignore" errors: Cannot silence "unused 'type: ignore'" in version specific code python/mypy#8823
If you use the core.autocrlf=true setting, some linters (e.g. mdformat) will aggressively "fix" line endings, although git will subsequently fix it back when you do git add.
Proposed Solution
For 1. and 2.:
Add type: ignore comments on all OS-specific bits, and use flag warn_unused_ignores = False.
Run mypy on Windows CI as well to avoid future breakages.
For 3., hopefully the PR gets accepted and released. If not, we can maybe add a separate instruction to the docs.
For 4., we can maybe add another run of end-of-line-fixer to the end of the pre-commit config? That way any mess that e.g. the mdformat extension makes will be rectified again. Not really critical, but nice-to-have.
The text was updated successfully, but these errors were encountered:
Problem
socket.AF_UNIX
when on windows. Usingassert sys.platform != 'win32'
as recommended for platform specific code doesn't seem to work?type: ignore
comments on them. Since we use a strict config, this will fail witherror: Unused "type: ignore" comment
on Windows. Note that it is not currently possible to ignore "unused ignore" errors: Cannot silence "unused 'type: ignore'" in version specific code python/mypy#8823The out-of-the-box pre-commit integrations with git do not work on Windows: Add sys.executable escapes on Windows pre-commit/pre-commit#2613 (this can be fixed manually by each user by editing the git hooks file)core.autocrlf=true
setting, some linters (e.g. mdformat) will aggressively "fix" line endings, although git will subsequently fix it back when you dogit add
.Proposed Solution
For 1. and 2.:
type: ignore
comments on all OS-specific bits, and use flagwarn_unused_ignores = False
.For 3., hopefully the PR gets accepted and released. If not, we can maybe add a separate instruction to the docs.For 4., we can maybe add another run of end-of-line-fixer to the end of the pre-commit config? That way any mess that e.g. the mdformat extension makes will be rectified again. Not really critical, but nice-to-have.
The text was updated successfully, but these errors were encountered: