mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-13 07:47:14 +03:00
note sys.platform requirements in contributing
This commit is contained in:
parent
f160acfe57
commit
7bcf3a6f4d
@ -228,6 +228,7 @@ handy if you want to step through the testing code to be sure of anything.
|
||||
Otherwise, see the [pytest documentation](https://docs.pytest.org/en/stable/contents.html).
|
||||
|
||||
---
|
||||
|
||||
## Debugging network sends
|
||||
|
||||
Rather than risk sending bad data to a remote service, even if only through
|
||||
@ -484,6 +485,20 @@ Please be verbose here, more info about weird choices is always prefered over ma
|
||||
|
||||
Additionally, if your hack is over around 5 lines, please include a `# HACK END` or similar comment to indicate the end of the hack.
|
||||
|
||||
# Use `sys.platform` for platform guards
|
||||
|
||||
`mypy` (and `pylance`) understand platform guards and will show unreachable code / resolve imports correctly
|
||||
for platform specific things. However, this only works if you directly reference `sys.platform`, importantly
|
||||
the following does not work:
|
||||
|
||||
```py
|
||||
from sys import platform
|
||||
if platform == 'darwin':
|
||||
...
|
||||
```
|
||||
|
||||
It **MUST** be `if sys.platform`.
|
||||
|
||||
---
|
||||
|
||||
## Build process
|
||||
|
Loading…
x
Reference in New Issue
Block a user