Skip to content

Commit

Permalink
fix: Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
snaselj committed Sep 13, 2023
1 parent 7441133 commit f7255a5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ ENV NAUTOBOT_ROOT ${NAUTOBOT_ROOT}
# and CI and local development may have a newer version of Poetry
# Since this is only used for development and we don't ship this container, pinning Poetry back is not expressly necessary
# We also don't need virtual environments in container
RUN curl -sSL https://install.python-poetry.org | python3 - && \
RUN which poetry || curl -sSL https://install.python-poetry.org | python3 - && \
poetry config virtualenvs.create false

# !!! USE CAUTION WHEN MODIFYING LINES ABOVE
# -------------------------------------------------------------------------------------
# App-specifc system build/test dependencies.
#
#
# Example: LDAP requires `libldap2-dev` to be apt-installed before the Python package.
# -------------------------------------------------------------------------------------
# --> Start safe to modify section
Expand Down
13 changes: 10 additions & 3 deletions nautobot-app/{{ cookiecutter.project_slug }}/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
limitations under the License.
"""

from distutils.util import strtobool
from invoke import Collection, task as invoke_task
import os

from dotenv import load_dotenv
from invoke.collection import Collection
from invoke.tasks import task as invoke_task


def _load_dotenv():
Expand All @@ -36,7 +36,14 @@ def is_truthy(arg):
"""
if isinstance(arg, bool):
return arg
return bool(strtobool(arg))

val = str(arg).lower()
if val in ("y", "yes", "t", "true", "on", "1"):
return True
elif val in ("n", "no", "f", "false", "off", "0"):
return False
else:
raise ValueError(f"Invalid truthy value: `{arg}`")


# Use pyinvoke configuration for default values, see http://docs.pyinvoke.org/en/stable/concepts/configuration.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TestDocsPackaging(unittest.TestCase):
"""Test Version in doc requirements is the same pyproject."""

def test_version(self):
"""Verify that pyproject.toml dev dependecies have the same versions as in the docs requirements.txt."""
"""Verify that pyproject.toml dev dependencies have the same versions as in the docs requirements.txt."""
parent_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
poetry_path = os.path.join(parent_path, "pyproject.toml")
poetry_details = toml.load(poetry_path)["tool"]["poetry"]["group"]["dev"]["dependencies"]
Expand Down

0 comments on commit f7255a5

Please sign in to comment.