cloud-api/src/constants.py
luxferre 58e7ae6c5c
All checks were successful
ci / ruff (push) Successful in 3s
ci / ty (push) Successful in 15s
ci / tests (push) Successful in 17s
fix: ty compliant & issues from change to mapped columns
2026-06-22 11:23:24 +01:00

37 lines
800 B
Python

"""
Global constants
Classes:
- Environment(StrEnum): LOCAL, TESTING, STAGING, PRODUCTION
"""
from enum import StrEnum, auto
class Environment(StrEnum):
"""
Enumeration of environments.
Attributes:
LOCAL (str): Application is running locally
TESTING (str): Application is running in testing mode
STAGING (str): Application is running in staging mode (ie not testing)
PRODUCTION (str): Application is running in production mode
"""
LOCAL = auto()
TESTING = auto()
STAGING = auto()
PRODUCTION = auto()
@property
def is_debug(self):
return self in (self.LOCAL, self.STAGING, self.TESTING)
@property
def is_testing(self):
return self == self.TESTING
@property
def is_deployed(self) -> bool:
return self in (self.STAGING, self.PRODUCTION)