Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/407.changed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Changed the minimum supported Nautobot version to 3.2.0 for apps baked from the `nautobot-app-commercial` cookie, updating both the baked `pyproject.toml` constraint and the CI test matrix.
2 changes: 1 addition & 1 deletion nautobot-app-commercial/cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"_extensions": [
"local_extensions.camel_case_to_kebab",
"local_extensions.camel_case_to_words",
"local_extensions.NautobotVersions"
"local_extensions.CommercialNautobotVersions"
]
}
15 changes: 14 additions & 1 deletion nautobot-app/local_extensions.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
"""Local extensions for Nautobot Cookies."""

import re

from cookiecutter.utils import simple_filter
from jinja2 import Environment
from jinja2.ext import Extension
from cookiecutter.utils import simple_filter


@simple_filter
def camel_case_to_kebab(name: str) -> str:
Expand All @@ -15,6 +17,7 @@ def camel_case_to_kebab(name: str) -> str:
words = re.findall(r"[A-Z]?[a-z]+|[A-Z]{2,}(?=[A-Z][a-z]|\d|\W|$)|\d+|[A-Z]{2,}|[A-Z]$", name)
return "-".join(words).lower()


@simple_filter
def camel_case_to_words(name: str) -> str:
"""Converts a camel case name to words.
Expand All @@ -25,6 +28,7 @@ def camel_case_to_words(name: str) -> str:
words = re.findall(r"[A-Z]?[a-z]+|[A-Z]{2,}(?=[A-Z][a-z]|\d|\W|$)|\d+|[A-Z]{2,}|[A-Z]$", name)
return " ".join(words)


class NautobotVersions(Extension): # pylint: disable=abstract-method
"""Jinja2 extension to set a minimum/maximum Nautobot version."""

Expand All @@ -33,3 +37,12 @@ def __init__(self, environment: Environment):

environment.globals.update(min_nautobot_version="3.1.0")
environment.globals.update(upper_bound_nautobot_version="4.0.0")


class CommercialNautobotVersions(NautobotVersions): # pylint: disable=abstract-method
"""Jinja2 extension to set a minimum/maximum Nautobot version for commercial apps."""

def __init__(self, environment: Environment):
super().__init__(environment)

environment.globals.update(min_nautobot_version="3.2.0")
Loading