-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Recognize platform.system() as well as sys.platform #8166
Comments
On one hand this is pretty niche, but on other hand should be not hard to implement. |
Hi @ilevkivskyi I am interested in working on this issue, please guide me on where I can start. |
Look at |
Which option would you recommend? - Write a new function similar to 'consider_sys_platform()' for handling platform.system() or modify 'consider_sys_platform()' to accomodate platform.system() |
@ilevkivskyi , I was reading the function |
Yes. |
@ilevkivskyi I was going through the code, and I think I should:
Please let me know if this approach is right or not. |
No, you need to change the "parsing" logic to recognize the Btw, no need to ask me about this. There are other team members who can review your PR. |
@ALL please take a look at the PR and let me know what I am doing wrong, would really like your input. |
This: * Deals with changes in how mypy handles metaclasses * Prefers sys.platform == "win32" due to python/mypy#8166 and mypy not having WindowsError defined by default any more * Installs various typestubs * Rewrites tox.ini to avoid duplicating everything, and allowing new versions of Python to be easily tested (as tox -e py310-mypy will now work without further changes).
This: * Deals with changes in how mypy handles metaclasses * Prefers sys.platform == "win32" due to python/mypy#8166 and mypy not having WindowsError defined by default any more * Installs various typestubs * Rewrites tox.ini to avoid duplicating everything, and allowing new versions of Python to be easily tested (as tox -e py310-mypy will now work without further changes).
Changes to adapt: * Deals with changes in how mypy handles metaclasses * Prefers sys.platform == "win32" due to python/mypy#8166 and mypy not having WindowsError defined by default any more * Installs various typestubs * Rewrites tox.ini to avoid duplicating everything, and allowing new versions of Python to be easily tested (as tox -e py310-mypy will now work without further changes). * Make mypy warn when it thinks code is unreachable. Co-authored-by: Sam Sneddon <[email protected]> Co-authored-by: Philip Jägenstedt <[email protected]>
… a=testonly Automatic update from web-platform-tests Bump mypy from 0.812 to 0.931 in /tools (#33082) Changes to adapt: * Deals with changes in how mypy handles metaclasses * Prefers sys.platform == "win32" due to python/mypy#8166 and mypy not having WindowsError defined by default any more * Installs various typestubs * Rewrites tox.ini to avoid duplicating everything, and allowing new versions of Python to be easily tested (as tox -e py310-mypy will now work without further changes). * Make mypy warn when it thinks code is unreachable. Co-authored-by: Sam Sneddon <[email protected]> Co-authored-by: Philip Jägenstedt <[email protected]> -- wpt-commits: 51ad530bef4a8396c5706f508e46f256c21b2a57 wpt-pr: 33082
… a=testonly Automatic update from web-platform-tests Bump mypy from 0.812 to 0.931 in /tools (#33082) Changes to adapt: * Deals with changes in how mypy handles metaclasses * Prefers sys.platform == "win32" due to python/mypy#8166 and mypy not having WindowsError defined by default any more * Installs various typestubs * Rewrites tox.ini to avoid duplicating everything, and allowing new versions of Python to be easily tested (as tox -e py310-mypy will now work without further changes). * Make mypy warn when it thinks code is unreachable. Co-authored-by: Sam Sneddon <[email protected]> Co-authored-by: Philip Jägenstedt <[email protected]> -- wpt-commits: 51ad530bef4a8396c5706f508e46f256c21b2a57 wpt-pr: 33082
#10686 has most of the implementation, but tests are failing and the PR is a bit stale. Any help with finishing up the PR would be appreciated! |
I'd also like to note that the |
#9025 (respecting `sys.platform() assertions for specific code branches) would be a complementary approach that generalises to any mechanism for determining which platform code is running on. |
Note: if you are reporting a wrong signature of a function or a class in
the standard library, then the typeshed tracker is better suited
for this report: https://github.com/python/typeshed/issues
Please provide more information to help us understand the issue:
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
Basically it would be nice to get to use
platform.system()
instead of having to usesys.platform
to make mypy happy with code that is conditional on the platform.The text was updated successfully, but these errors were encountered: