Skip to content

Commit

Permalink
LTM updates for Cookiecutter (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
smk4664 authored Aug 27, 2024
1 parent b5f944e commit 60f0c5f
Show file tree
Hide file tree
Showing 26 changed files with 3,827 additions and 28 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on: # yamllint disable-line rule:truthy rule:comments
pull_request: ~

env:
PLUGIN_NAME: "nautobot-app-dev-example"
PLUGIN_NAME: "nautobot-dev-example"

jobs:
black:
Expand Down Expand Up @@ -177,14 +177,14 @@ jobs:
matrix:
python-version: ["3.8", "3.11"]
db-backend: ["postgresql"]
nautobot-version: ["stable"]
nautobot-version: ["1.6"]
include:
- python-version: "3.11"
db-backend: "postgresql"
nautobot-version: "1.6.0"
- python-version: "3.11"
db-backend: "mysql"
nautobot-version: "stable"
nautobot-version: "1.6"
runs-on: "ubuntu-22.04"
env:
INVOKE_NAUTOBOT_DEV_EXAMPLE_PYTHON_VER: "${{ matrix.python-version }}"
Expand Down
1 change: 0 additions & 1 deletion development/docker-compose.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ x-nautobot-base: &nautobot-base
- "creds.env"
tty: true

version: "3.8"
services:
nautobot:
depends_on:
Expand Down
1 change: 0 additions & 1 deletion development/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# any override will need to include these volumes to use them.
# see: https://github.com/docker/compose/issues/3729
---
version: "3.8"
services:
nautobot:
command: "nautobot-server runserver 0.0.0.0:8080"
Expand Down
3 changes: 0 additions & 3 deletions development/docker-compose.mysql.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
version: "3.8"

services:
nautobot:
environment:
Expand All @@ -19,7 +17,6 @@ services:
db:
image: "mysql:8"
command:
- "--default-authentication-plugin=mysql_native_password"
- "--max_connections=1000"
env_file:
- "development.env"
Expand Down
2 changes: 0 additions & 2 deletions development/docker-compose.postgres.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
version: "3.8"

services:
nautobot:
environment:
Expand Down
1 change: 0 additions & 1 deletion development/docker-compose.redis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
version: "3.8"
services:
redis:
image: "redis:6-alpine"
Expand Down
1 change: 1 addition & 0 deletions development/nautobot_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Nautobot development configuration file."""

import os
import sys

Expand Down
8 changes: 4 additions & 4 deletions docs/dev/dev_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Next, you need to start up your Docker containers.
```bash
➜ invoke start
Starting Nautobot in detached mode...
Running docker-compose command "up --detach"
Running docker compose command "up --detach"
Creating network "nautobot_dev_example_default" with the default driver
Creating volume "nautobot_dev_example_postgres_data" with default driver
Creating nautobot_dev_example_redis_1 ...
Expand Down Expand Up @@ -240,8 +240,8 @@ If you need to create additional superusers, run the follow commands.

```bash
➜ invoke createsuperuser
Running docker-compose command "ps --services --filter status=running"
Running docker-compose command "exec nautobot nautobot-server createsuperuser --username admin"
Running docker compose command "ps --services --filter status=running"
Running docker compose command "exec nautobot nautobot-server createsuperuser --username admin"
Error: That username is already taken.
Username: ntc
Email address: [email protected]
Expand All @@ -257,7 +257,7 @@ The last command to know for now is `invoke stop`.
```bash
➜ invoke stop
Stopping Nautobot...
Running docker-compose command "down"
Running docker compose command "down"
Stopping nautobot_dev_example_worker_1 ...
Stopping nautobot_dev_example_nautobot_1 ...
Stopping nautobot_dev_example_docs_1 ...
Expand Down
11 changes: 6 additions & 5 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mkdocs==1.5.2
mkdocs-material==9.1.15
mkdocs-version-annotations==1.0.0
mkdocstrings-python==1.5.2
mkdocstrings==0.22.0
mkdocs==1.6.0
mkdocs-material==9.5.32
markdown-version-annotations==1.0.1
griffe==1.1.1
mkdocstrings-python==1.10.8
mkdocstrings==0.25.2
5 changes: 3 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
dev_addr: "127.0.0.1:8001"
edit_uri: "edit/main/nautobot-app-dev-example/docs"
edit_uri: "edit/main/docs"
site_dir: "nautobot_dev_example/static/nautobot_dev_example/docs"
site_name: "Nautobot Dev Example App Documentation"
site_url: "https://docs.nautobot.com/projects/dev-example/en/latest/"
Expand Down Expand Up @@ -72,6 +72,8 @@ extra:
link: "https://twitter.com/networktocode"
name: "Network to Code Twitter"
markdown_extensions:
- "markdown_version_annotations":
admonition_tag: "???"
- "admonition"
- "toc":
permalink: true
Expand All @@ -85,7 +87,6 @@ markdown_extensions:
- "footnotes"
plugins:
- "search"
- "mkdocs-version-annotations"
- "mkdocstrings":
default_handler: "python"
handlers:
Expand Down
1 change: 1 addition & 0 deletions nautobot_dev_example/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Plugin declaration for nautobot_dev_example."""

# Metadata is inherited from Nautobot. If not including Nautobot in the environment, this should be added
from importlib import metadata

Expand Down
1 change: 1 addition & 0 deletions nautobot_dev_example/api/nested_serializers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""API nested serializers for nautobot_dev_example."""

from rest_framework import serializers

from nautobot.core.api import WritableNestedSerializer
Expand Down
1 change: 1 addition & 0 deletions nautobot_dev_example/api/serializers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""API serializers for nautobot_dev_example."""

from rest_framework import serializers

from nautobot.core.api.serializers import ValidatedModelSerializer
Expand Down
1 change: 1 addition & 0 deletions nautobot_dev_example/forms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Forms for nautobot_dev_example."""

from django import forms
from nautobot.utilities.forms import (
BootstrapMixin,
Expand Down
33 changes: 33 additions & 0 deletions nautobot_dev_example/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 3.2.20 on 2024-08-26 19:06

from django.db import migrations, models
import uuid


class Migration(migrations.Migration):

initial = True

dependencies = []

operations = [
migrations.CreateModel(
name="DevExample",
fields=[
(
"id",
models.UUIDField(
default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True
),
),
("created", models.DateField(auto_now_add=True, null=True)),
("last_updated", models.DateTimeField(auto_now=True, null=True)),
("name", models.CharField(max_length=100, unique=True)),
("slug", models.SlugField(max_length=100, unique=True)),
("description", models.CharField(blank=True, max_length=200)),
],
options={
"ordering": ["name"],
},
),
]
1 change: 1 addition & 0 deletions nautobot_dev_example/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# Then based on your reading you may decide to put the following decorator before the declaration of your class
# @extras_features("custom_fields", "custom_validators", "relationships", "graphql")


# If you want to choose a specific model to overload in your class declaration, please reference the following documentation:
# how to chose a database model: https://docs.nautobot.com/projects/core/en/stable/plugins/development/#database-models
class DevExample(BaseModel, ChangeLoggedModel):
Expand Down
1 change: 1 addition & 0 deletions nautobot_dev_example/tests/fixtures.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create fixtures for tests."""

from nautobot_dev_example.models import DevExample


Expand Down
1 change: 1 addition & 0 deletions nautobot_dev_example/tests/test_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Unit tests for nautobot_dev_example."""

from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
Expand Down
1 change: 1 addition & 0 deletions nautobot_dev_example/tests/test_api_views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Unit tests for nautobot_dev_example."""

from nautobot.utilities.testing import APIViewTestCases

from nautobot_dev_example import models
Expand Down
1 change: 1 addition & 0 deletions nautobot_dev_example/tests/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Basic tests that do not require Django."""

import unittest
import os
import toml
Expand Down
1 change: 1 addition & 0 deletions nautobot_dev_example/tests/test_filter_devexample.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test DevExample Filter."""

from django.test import TestCase
from nautobot_dev_example import filters
from nautobot_dev_example import models
Expand Down
1 change: 1 addition & 0 deletions nautobot_dev_example/tests/test_form_devexample.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test devexample forms."""

from django.test import TestCase

from nautobot_dev_example import forms
Expand Down
1 change: 1 addition & 0 deletions nautobot_dev_example/tests/test_views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Unit tests for views."""

from nautobot.utilities.testing import ViewTestCases

from nautobot_dev_example import models
Expand Down
1 change: 1 addition & 0 deletions nautobot_dev_example/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Django urlpatterns declaration for nautobot_dev_example plugin."""

from django.urls import path
from nautobot.extras.views import ObjectChangeLogView

Expand Down
Loading

0 comments on commit 60f0c5f

Please sign in to comment.