Skip to content

Commit

Permalink
Merge pull request #140 from nautobot/2.x_branch_prep
Browse files Browse the repository at this point in the history
Version 2.0 prep
  • Loading branch information
abates authored May 1, 2024
2 parents b659c64 + 173a84d commit d754f8c
Show file tree
Hide file tree
Showing 58 changed files with 349 additions and 1,763 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
fail-fast: true
matrix:
python-version: ["3.11"]
nautobot-version: ["2.1"]
nautobot-version: ["2.2"]
env:
INVOKE_NAUTOBOT_DESIGN_BUILDER_PYTHON_VER: "${{ matrix.python-version }}"
INVOKE_NAUTOBOT_DESIGN_BUILDER_NAUTOBOT_VER: "${{ matrix.nautobot-version }}"
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
fail-fast: true
matrix:
python-version: ["3.11"]
nautobot-version: ["2.1"]
nautobot-version: ["2.2"]
env:
INVOKE_NAUTOBOT_DESIGN_BUILDER_PYTHON_VER: "${{ matrix.python-version }}"
INVOKE_NAUTOBOT_DESIGN_BUILDER_NAUTOBOT_VER: "${{ matrix.nautobot-version }}"
Expand Down Expand Up @@ -177,11 +177,8 @@ jobs:
matrix:
python-version: ["3.8", "3.11"]
db-backend: ["postgresql"]
nautobot-version: ["1.6", "stable"]
nautobot-version: ["stable"]
include:
- python-version: "3.11"
db-backend: "postgresql"
nautobot-version: "1.6.0"
- python-version: "3.11"
db-backend: "mysql"
nautobot-version: "stable"
Expand Down
2 changes: 1 addition & 1 deletion development/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# !!! USE CAUTION WHEN MODIFYING LINES BELOW

# Accepts a desired Nautobot version as build argument, default to 1.6.0
ARG NAUTOBOT_VER="1.6.0"
ARG NAUTOBOT_VER="2.0.0"

# Accepts a desired Python version as build argument, default to 3.11
ARG PYTHON_VER="3.11"
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
4 changes: 0 additions & 4 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 @@ -25,8 +23,6 @@ services:
- "development_mysql.env"
db:
image: "mysql:8"
command:
- "--default-authentication-plugin=mysql_native_password"
env_file:
- "development.env"
- "creds.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: 0 additions & 1 deletion development/docker-compose.test-designs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
version: "3.8"
services:
nautobot:
volumes:
Expand Down
26 changes: 0 additions & 26 deletions development/nautobot_config.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
"""Nautobot development configuration file."""

from importlib import metadata
from importlib.util import find_spec
import os
import sys

from packaging.version import Version

from nautobot.core.settings import * # noqa: F403 # pylint: disable=wildcard-import,unused-wildcard-import
from nautobot.core.settings_funcs import is_truthy, parse_redis_connection

Expand Down Expand Up @@ -140,28 +136,6 @@
# Each key in the dictionary is the name of an installed App and its value is a dictionary of settings.

if is_truthy(os.getenv("DESIGN_BUILDER_ENABLE_BGP", "False")):
if find_spec("nautobot_bgp_models") is None:
nautobot_version = Version(Version(metadata.version("nautobot")).base_version)
import subprocess # nosec

package = "nautobot-bgp-models"
if nautobot_version < Version("2.0"):
# pip doesn't have the capability to automatically pick
# a version compatible with the current Nautobot, so we
# do that manually. This is only for development environments
# so that we can run unit tests on Nautobot 1.6 and 2.x
package = "nautobot-bgp-models==0.9.1"
command = [
sys.executable,
"-m",
"pip",
"install",
package,
]
# Since we aren't evaluating any input variables, *and* we
# are not using a shell, this command should be considered
# save, therefore the `nosec` annotation.
subprocess.check_call(command, shell=False) # nosec
PLUGINS.append("nautobot_bgp_models")

PLUGINS_CONFIG = {"design_builder": {"context_repository": os.getenv("DESIGN_BUILDER_CONTEXT_REPO_SLUG", None)}}
4 changes: 2 additions & 2 deletions invoke.example.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
nautobot_design_builder:
project_name: "nautobot-design-builder"
nautobot_ver: "1.6.0"
local: false
python_ver: "3.11"
nautobot_ver: "2.2"
local: false
compose_dir: "development"
compose_files:
- "docker-compose.base.yml"
Expand Down
4 changes: 2 additions & 2 deletions invoke.mysql.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
nautobot_design_builder:
project_name: "nautobot-design-builder"
nautobot_ver: "1.6.0"
local: false
python_ver: "3.11"
nautobot_ver: "2.2"
local: false
compose_dir: "development"
compose_files:
- "docker-compose.base.yml"
Expand Down
10 changes: 0 additions & 10 deletions invoke.nautobot_2.yml

This file was deleted.

21 changes: 0 additions & 21 deletions nautobot_design_builder/contrib/tests/test_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,8 @@
from django.test import TestCase

from nautobot_design_builder.tests.test_builder import builder_test_case
from nautobot_design_builder.util import nautobot_version


@builder_test_case(os.path.join(os.path.dirname(__file__), "testdata"))
class TestAgnosticExtensions(TestCase):
"""Test contrib extensions against any version of Nautobot."""


@builder_test_case(os.path.join(os.path.dirname(__file__), "testdata", "nautobot_v1"))
class TestV1Extensions(TestCase):
"""Test contrib extensions against Nautobot V1."""

def setUp(self):
if nautobot_version >= "2.0.0":
self.skipTest("These tests are only supported in Nautobot 1.x")
super().setUp()


@builder_test_case(os.path.join(os.path.dirname(__file__), "testdata", "nautobot_v2"))
class TestV2Extensions(TestCase):
"""Test contrib extensions against Nautobot V2."""

def setUp(self):
if nautobot_version < "2.0.0":
self.skipTest("These tests are only supported in Nautobot 2.x")
super().setUp()

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit d754f8c

Please sign in to comment.