What I'm trying to do seems really simple but I can't find a way to do it. I'm trying to use the module Pipreqs in a script, but I have to use subprocess.call() because Pipreqs doesn't have a way to use it in a script. Pipreqs uses logging to log info and I don't want that. Pipreqs also doesn't have a quiet mode. I tried to use logger.setLevel(logging.WARNING) but since I'm calling it through subprocess.call() it still prints info. I've also tried importing Pipreqs and setting the logging level to warning and that also doesn't work. Is there any way to disable this output? My code right now is the following:
import subprocess
import logging
import pipreqs
logger = logging.getLogger("pipreqs")
logger.setLevel(logging.WARNING)
subprocess.call(["pipreqs", "--force","/path/to/dir"])