[WIP] Make plugin compatible with tox v4

This commit is contained in:
Obeida Shamoun
2023-01-10 03:34:35 +01:00
parent c55ba474c7
commit a94933e7ef
8 changed files with 101 additions and 236 deletions

View File

@@ -4,26 +4,26 @@ Calling ``tox.reporter.something()`` and having to format a string with the pref
gets really old fast, but more importantly it also makes the flow of the main code
more difficult to follow because of the added complexity.
"""
import tox
import logging
from tox_poetry_installer import constants
def error(message: str):
"""Wrapper around :func:`tox.reporter.error`"""
tox.reporter.error(f"{constants.REPORTER_PREFIX} {message}")
"""Wrapper around :func:`logging.error` that prefixes the reporter prefix onto the message"""
logging.error(f"{constants.REPORTER_PREFIX} {message}")
def warning(message: str):
"""Wrapper around :func:`tox.reporter.warning`"""
tox.reporter.warning(f"{constants.REPORTER_PREFIX} {message}")
"""Wrapper around :func:`logging.warning`"""
logging.warning(f"{constants.REPORTER_PREFIX} {message}")
def info(message: str):
"""Wrapper around :func:`tox.reporter.verbosity1`"""
tox.reporter.verbosity1(f"{constants.REPORTER_PREFIX} {message}")
"""Wrapper around :func:`logging.info`"""
logging.info(f"{constants.REPORTER_PREFIX} {message}")
def debug(message: str):
"""Wrapper around :func:`tox.reporter.verbosity2`"""
tox.reporter.verbosity2(f"{constants.REPORTER_PREFIX} {message}")
"""Wrapper around :func:`logging.debug`"""
logging.debug(f"{constants.REPORTER_PREFIX} {message}")