From f7d802ee62b6e582786aa2072a3608c25dc80603 Mon Sep 17 00:00:00 2001 From: Adam Lewis <23342526+Adam-D-Lewis@users.noreply.github.com> Date: Mon, 30 Dec 2024 10:39:28 -0600 Subject: [PATCH] raise warning if configsetmetadata created without setting prereleases to True --- src/_nebari/config_set.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/_nebari/config_set.py b/src/_nebari/config_set.py index c9017d2f37..6bf7375869 100644 --- a/src/_nebari/config_set.py +++ b/src/_nebari/config_set.py @@ -1,3 +1,4 @@ +import logging import pathlib from typing import Optional @@ -7,6 +8,8 @@ from _nebari._version import __version__ from _nebari.utils import yaml +logger = logging.getLogger(__name__) + class ConfigSetMetadata(BaseModel): model_config: ConfigDict = ConfigDict(extra="allow", arbitrary_types_allowed=True) @@ -19,7 +22,10 @@ class ConfigSetMetadata(BaseModel): def validate_version_requirement(cls, version_req): if isinstance(version_req, str): version_req = SpecifierSet(version_req, prereleases=True) - + if version_req.prereleases is not True: + logger.warning( + "ConfigSetMetadata created with nebari_version SpecifierSet not allowing pre-releases." + ) return version_req def check_version(self, version):