1
0
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:
A_D 2022-01-26 17:46:30 +02:00
parent f160acfe57
commit 7bcf3a6f4d
No known key found for this signature in database
GPG Key ID: 4BE9EB7DF45076C4

View File

@ -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