-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Run stubtest on Windows for waitress #9181
Conversation
This comment has been minimized.
This comment has been minimized.
write: Callable[..., bytes] = ... | ||
def close(self) -> None: ... | ||
def fileno(self) -> BytesIO: ... | ||
if sys.platform == "linux" or sys.platform == "darwin": |
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.
if sys.platform == "linux" or sys.platform == "darwin": | |
if sys.platform != "win32": |
Consistent with the other check you added.
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.
When the original code does if os.name == "posix"
in waitress.trigger
, the stub did if sys.platform == "linux" or sys.platform == "darwin"
(there's another platform check like this in waitress.trigger
).
I added if sys.platform != "win32"
in waitress.server
to be consistent with other if hasattr(socket, "AF_UNIX")
checks.
But I can change them all to be either if you'd like.
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 think the runtime checks are pretty much equivalent, and in stubs we have tended to assume all non-Windows OSes are Unix.
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.
Sounds good, I'll make all 3 != "win32
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Yet another stub that benefits from #8923 . Fixing stubtest failure on Windows and offering better coverage.
I did not add
darwin
toplatforms
because it would be redundant withlinux
. But I still added astubtest_allowlist_darwin.txt
for those who would like to run it locally on macos. (This is the edge case mentioned in #9173 )