I'm developing a python project, using PyCharm on Windows, and running it on a Raspberry Pi.
I'm a heavy user of PyCharm inspections and also use Pylint as part of my integration tests.
In addition, I have 2 different requirements.txt
: dev and prod.
There is a linux only library I'm using (picamera), and it can't be install in my development environment. PyCharm will alert me that the package isn't installed, and that it isn't in the requierment.txt file, and Pylint will alert on import-error.
Now I need this in my code:
from sys import platform
if platform == "linux":
# noinspection PyUnresolvedReferences,PyPackageRequirements
# pylint: disable=import-error
from picamera import PiCamera
And I find it ugly. I saw here (Suppress warning for both pycharm and pylint) that there is no way to merge those comments, but it made me think that maybe there is a better best practice for that scenario? It feels like it shouldn't be that rare...