Skip to content

Commit

Permalink
raise warning if configsetmetadata created without setting prerelease…
Browse files Browse the repository at this point in the history
…s to True
  • Loading branch information
Adam-D-Lewis committed Dec 30, 2024
1 parent f92bd8c commit f7d802e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/_nebari/config_set.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import pathlib
from typing import Optional

Expand All @@ -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)
Expand All @@ -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):
Expand Down

0 comments on commit f7d802e

Please sign in to comment.