diff --git a/src/judge0/__init__.py b/src/judge0/__init__.py index b2a4dcb4..b74df46e 100644 --- a/src/judge0/__init__.py +++ b/src/judge0/__init__.py @@ -65,6 +65,7 @@ JUDGE0_IMPLICIT_CE_CLIENT = None JUDGE0_IMPLICIT_EXTRA_CE_CLIENT = None +SUPPRESS_PREVIEW_WARNING = os.getenv("JUDGE0_SUPPRESS_PREVIEW_WARNING") logger = logging.getLogger(__name__) @@ -106,11 +107,12 @@ def _get_implicit_client(flavor: Flavor) -> Client: def _get_preview_client(flavor: Flavor) -> Union[Judge0CloudCE, Judge0CloudExtraCE]: - logger.warning( - "You are using a preview version of the client which is not recommended" - " for production.\n" - "For production, please specify your API key in the environment variable." - ) + if SUPPRESS_PREVIEW_WARNING is not None: + logger.warning( + "You are using a preview version of the client which is not recommended" + " for production.\n" + "For production, please specify your API key in the environment variable." + ) if flavor == Flavor.CE: return Judge0CloudCE()