Skip to content

Commit 05be45c

Browse files
authored
3.6 support (#180)
3.6 support
1 parent 175f8c3 commit 05be45c

31 files changed

+494
-464
lines changed

.devcontainer/Dockerfile-plugin_dev

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
1-
ARG NETBOX_VARIANT=v3.5
1+
ARG NETBOX_VARIANT=v3.6
22

33
FROM netboxcommunity/netbox:${NETBOX_VARIANT}
44

5-
ARG NETBOX_INITIALIZERS_VARIANT=3.5.*
5+
ARG NETBOX_INITIALIZERS_VARIANT=3.6.*
66

77
ARG DEBIAN_FRONTEND=noninteractive
88

99
# Install APT packages
1010
# hadolint ignore=DL3008
1111
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
12-
&& apt-get -y install --no-install-recommends curl git make openssh-client python3.10-dev sudo wget zsh \
12+
&& apt-get -y install --no-install-recommends curl git make openssh-client python3.11-dev sudo wget zsh \
1313
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
1414

1515
# Install development & ide dependencies
1616
COPY requirements-dev.txt /tmp/pip-tmp/
1717
RUN /opt/netbox/venv/bin/python3 -m pip install --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements-dev.txt \
1818
&& rm -rf /tmp/*
1919

20-
ARG USERNAME=vscode
20+
ARG USERNAME=ubuntu
2121
ARG USER_UID=1000
2222
ARG USER_GID=$USER_UID
2323

24-
RUN useradd -l -md /home/vscode -s /usr/bin/zsh -u $USER_UID $USERNAME \
25-
&& usermod -aG sudo $USERNAME \
24+
RUN usermod -aG sudo $USERNAME \
2625
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \
2726
&& mkdir /opt/netbox/netbox/netbox-acls \
2827
&& chown $USERNAME:$USERNAME /opt/netbox /etc/netbox /opt/unit -R

.devcontainer/configuration/configuration.py

Lines changed: 194 additions & 169 deletions
Large diffs are not rendered by default.

.devcontainer/devcontainer.json

Lines changed: 96 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -2,121 +2,107 @@
22
// https://github.com/microsoft/vscode-dev-containers/tree/v0.238.0/containers/python-3-postgres
33
// Update the VARIANT arg in docker-compose.yml to pick a Python version
44
{
5-
"name": "NetBox Plugin Development",
6-
"dockerComposeFile": [
7-
"docker-compose.yml",
8-
"docker-compose.override.yml"
9-
],
10-
"service": "netbox",
11-
//"workspaceMount": "source=${localWorkspaceFolder},target=/opt/netbox/netbox/netbox-acls,type=bind,consistency=cached",
12-
"workspaceFolder": "/opt/netbox/netbox/netbox-acls",
5+
"name": "NetBox Plugin Development",
6+
"dockerComposeFile": ["docker-compose.yml", "docker-compose.override.yml"],
7+
"service": "netbox",
8+
//"workspaceMount": "source=${localWorkspaceFolder},target=/opt/netbox/netbox/netbox-acls,type=bind,consistency=cached",
9+
"workspaceFolder": "/opt/netbox/netbox/netbox-acls",
1310

14-
"overrideCommand":false,
11+
"overrideCommand": false,
1512

16-
// Configure tool-specific properties.
17-
"customizations": {
18-
// Configure properties specific to VS Code.
19-
"vscode": {
20-
// Set *default* container specific settings.json values on container create.
21-
"settings": {
22-
"editor.experimental.stickyScroll.enabled": true,
23-
//"[python]": {
24-
// "editor.codeActionsOnSave": {
25-
// "source.organizeImports": true
26-
// }
27-
//},
28-
"isort.args": [
29-
"--profile=black"
30-
],
31-
"isort.path": "/opt/netbox/venv/bin/isort",
32-
"python.analysis.typeCheckingMode": "strict",
33-
python.Jedi
34-
"python.analysis.extraPaths": [
35-
"/opt/netbox/netbox"
36-
],
37-
"python.autoComplete.extraPaths": [
38-
"/opt/netbox/netbox"
39-
],
40-
"python.defaultInterpreterPath": "/opt/netbox/venv/bin/python3",
41-
"python.formatting.autopep8Path": "/opt/netbox/venv/bin/autopep8",
42-
"python.formatting.blackPath": "/opt/netbox/venv/bin/black",
43-
"python.formatting.provider": "black",
44-
"python.formatting.yapfPath": "/opt/netbox/venv/bin/yapf",
45-
"python.linting.banditPath": "/opt/netbox/venv/bin/bandit",
46-
"python.linting.enabled": true,
47-
"python.linting.flake8Path": "/opt/netbox/venv/bin/flake8",
48-
"python.linting.flake8Args": [
49-
"--max-line-length=160",
50-
"--ignore=E203"
51-
],
52-
"python.linting.mypyPath": "//opt/netbox/venv/bin/mypy",
53-
"python.linting.pycodestylePath": "/opt/netbox/venv/bin/pycodestyle",
54-
"python.linting.pydocstylePath": "/opt/netbox/venv/bin/pydocstyle",
55-
"python.linting.pylintArgs": [
56-
"--load-plugins",
57-
"pylint_django",
58-
"--errors-only",
59-
"--load-plugins=pylint_django",
60-
"--django-settings-module=/opt/netbox/netbox/netbox/netbox.settings",
61-
"--enable=W0602,W0611,W0612,W0613,W0614"
62-
],
63-
"python.linting.pylintEnabled": true,
64-
"python.linting.pylintPath": "/opt/netbox/venv/bin/pylint",
65-
"python.linting.lintOnSave": true,
66-
"python.pythonPath": "/opt/netbox/venv/bin/python3",
67-
"python.terminal.activateEnvironment": true,
68-
"python.venvPath": "/opt/netbox/",
69-
"files.exclude": {
70-
"**/node_modules": true,
71-
"build": true,
72-
"dist": true,
73-
"*egg*": true
74-
}
75-
},
13+
// Configure tool-specific properties.
14+
"customizations": {
15+
// Configure properties specific to VS Code.
16+
"vscode": {
17+
// Set *default* container specific settings.json values on container create.
18+
"settings": {
19+
"editor.experimental.stickyScroll.enabled": true,
20+
//"[python]": {
21+
// "editor.codeActionsOnSave": {
22+
// "source.organizeImports": true
23+
// }
24+
//},
25+
"isort.args": ["--profile=black"],
26+
"isort.path": ["/opt/netbox/venv/bin/isort"],
27+
"python.analysis.typeCheckingMode": "strict",
28+
"python.analysis.extraPaths": ["/opt/netbox/netbox"],
29+
"python.autoComplete.extraPaths": ["/opt/netbox/netbox"],
30+
"python.defaultInterpreterPath": "/opt/netbox/venv/bin/python3",
31+
"python.formatting.autopep8Path": "/opt/netbox/venv/bin/autopep8",
32+
"python.formatting.blackPath": "/opt/netbox/venv/bin/black",
33+
"python.formatting.provider": "black",
34+
"python.formatting.yapfPath": "/opt/netbox/venv/bin/yapf",
35+
"python.linting.banditPath": "/opt/netbox/venv/bin/bandit",
36+
"python.linting.enabled": true,
37+
"python.linting.flake8Path": "/opt/netbox/venv/bin/flake8",
38+
"python.linting.flake8Args": ["--max-line-length=160", "--ignore=E203"],
39+
"python.linting.mypyPath": "//opt/netbox/venv/bin/mypy",
40+
"python.linting.pycodestylePath": "/opt/netbox/venv/bin/pycodestyle",
41+
"python.linting.pydocstylePath": "/opt/netbox/venv/bin/pydocstyle",
42+
"python.linting.pylintArgs": [
43+
"--load-plugins",
44+
"pylint_django",
45+
"--errors-only",
46+
"--load-plugins=pylint_django",
47+
"--django-settings-module=/opt/netbox/netbox/netbox/netbox.settings",
48+
"--enable=W0602,W0611,W0612,W0613,W0614"
49+
],
50+
"python.linting.pylintEnabled": true,
51+
"python.linting.pylintPath": "/opt/netbox/venv/bin/pylint",
52+
"python.linting.lintOnSave": true,
53+
"python.pythonPath": "/opt/netbox/venv/bin/python3",
54+
"python.terminal.activateEnvironment": true,
55+
"python.venvPath": "/opt/netbox/",
56+
"files.exclude": {
57+
"**/node_modules": true,
58+
"build": true,
59+
"dist": true,
60+
"*egg*": true
61+
}
62+
},
7663

77-
// Add the IDs of extensions you want installed when the container is created.
78-
"extensions": [
79-
"DavidAnson.vscode-markdownlint",
80-
"GitHub.codespaces",
81-
"GitHub.copilot-labs",
82-
"GitHub.vscode-pull-request-github",
83-
"Gruntfuggly.todo-tree",
84-
"Tyriar.sort-lines",
85-
"aaron-bond.better-comments",
86-
"batisteo.vscode-django",
87-
"charliermarsh.ruff",
88-
"codezombiech.gitignore",
89-
"esbenp.prettier-vscode",
90-
"exiasr.hadolint",
91-
"formulahendry.auto-rename-tag",
92-
"mintlify.document",
93-
"ms-python.isort",
94-
"ms-python.pylint",
95-
"ms-python.python",
96-
"ms-python.vscode-pylance",
97-
"ms-vscode.makefile-tools",
98-
"mutantdino.resourcemonitor",
99-
"oderwat.indent-rainbow",
100-
"paulomenezes.duplicated-code",
101-
"redhat.vscode-yaml",
102-
"searKing.preview-vscode",
103-
"sourcery.sourcery",
104-
"wholroyd.jinja",
105-
"yzhang.markdown-all-in-one"
106-
]
107-
}
108-
},
64+
// Add the IDs of extensions you want installed when the container is created.
65+
"extensions": [
66+
"DavidAnson.vscode-markdownlint",
67+
"GitHub.codespaces",
68+
"GitHub.copilot-labs",
69+
"GitHub.vscode-pull-request-github",
70+
"Gruntfuggly.todo-tree",
71+
"Tyriar.sort-lines",
72+
"aaron-bond.better-comments",
73+
"batisteo.vscode-django",
74+
"charliermarsh.ruff",
75+
"codezombiech.gitignore",
76+
"esbenp.prettier-vscode",
77+
"exiasr.hadolint",
78+
"formulahendry.auto-rename-tag",
79+
"mintlify.document",
80+
"ms-python.isort",
81+
"ms-python.pylint",
82+
"ms-python.python",
83+
"ms-python.vscode-pylance",
84+
"ms-vscode.makefile-tools",
85+
"mutantdino.resourcemonitor",
86+
"oderwat.indent-rainbow",
87+
"paulomenezes.duplicated-code",
88+
"redhat.vscode-yaml",
89+
"searKing.preview-vscode",
90+
"sourcery.sourcery",
91+
"wholroyd.jinja",
92+
"yzhang.markdown-all-in-one"
93+
]
94+
}
95+
},
10996

110-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
111-
// This can be used to network with other containers or the host.
112-
// "forwardPorts": [5000, 5432],
97+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
98+
// This can be used to network with other containers or the host.
99+
// "forwardPorts": [5000, 5432],
113100

114-
// Use 'postCreateCommand' to run commands after the container is created.
115-
// "postCreateCommand": "pip install --user -r requirements-dev.txt",
101+
// Use 'postCreateCommand' to run commands after the container is created.
102+
// "postCreateCommand": "pip install --user -r requirements-dev.txt",
116103

117-
//"postAttachCommand": "source /opt/netbox/venv/bin/activate",
118-
119-
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
120-
"remoteUser": "vscode"
104+
//"postAttachCommand": "source /opt/netbox/venv/bin/activate",
121105

106+
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
107+
"remoteUser": "ubuntu"
122108
}

.devcontainer/docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ services:
1616
interval: 15s
1717
test: "curl -f http://localhost:8080/api/ || exit 1"
1818
volumes:
19-
- ./configuration:/etc/netbox/config:z,ro
20-
#- ./reports:/etc/netbox/reports:z,ro
21-
#- ./scripts:/etc/netbox/scripts:z,ro
22-
#- netbox-media-files:/opt/netbox/netbox/media:z
19+
- ./configuration:/etc/netbox/config:ro
20+
#- netbox-media-files:/opt/netbox/netbox/media:rw
21+
#- netbox-reports-files:/opt/netbox/netbox/reports:rw
22+
#- netbox-scripts-files:/opt/netbox/netbox/scripts:rw
2323
#netbox-worker:
2424
# <<: *netbox
2525
# depends_on:

.devcontainer/env/netbox.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ REDIS_DATABASE=0
1515
REDIS_HOST=redis
1616
REDIS_INSECURE_SKIP_TLS_VERIFY=false
1717
REDIS_PASSWORD=H733Kdjndks81
18-
SECRET_KEY=r8OwDznj!!dciP9ghmRfdu1Ysxm0AiPeDCQhKE+N_rClfWNjaa
18+
SECRET_KEY='r(m)9nLGnz$(_q3N4z1k(EFsMCjjjzx08x9VhNVcfd%6RF#r!6DE@+V5Zk2X'
1919
SUPERUSER_API_TOKEN=0123456789abcdef0123456789abcdef01234567
2020
SUPERUSER_EMAIL=[email protected]
2121
SUPERUSER_NAME=admin

.devcontainer/requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ autoflake
22
autopep8
33
bandit
44
black
5+
coverage
56
flake8
67
isort
78
mypy

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ body:
2323
attributes:
2424
label: NetBox access-list plugin version
2525
description: What version of the NetBox access-list plugin are you currently running?
26-
placeholder: v1.3.0
26+
placeholder: v1.4.0
2727
validations:
2828
required: true
2929
- type: input
3030
attributes:
3131
label: NetBox version
3232
description: What version of NetBox are you currently running?
33-
placeholder: v3.5.4
33+
placeholder: v3.6.3
3434
validations:
3535
required: true
3636
- type: textarea

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ body:
1515
attributes:
1616
label: NetBox version
1717
description: What version of NetBox are you currently running?
18-
placeholder: v3.5.4
18+
placeholder: v3.6.3
1919
validations:
2020
required: true
2121
- type: dropdown

.github/dependabot.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
---
2+
# To get started with Dependabot version updates, you'll need to specify which
3+
# package ecosystems to update and where the package manifests are located.
4+
# Please see the documentation for all configuration options:
5+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
6+
27
version: 2
38
updates:
4-
- package-ecosystem: pip
9+
- package-ecosystem: "pip" # See documentation for possible values
10+
directory: "/" # Location of package manifests
11+
schedule:
12+
interval: "weekly"
13+
- package-ecosystem: "github-actions"
514
directory: "/"
615
schedule:
7-
interval: daily
8-
time: "04:00"
9-
open-pull-requests-limit: 10
16+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Checkout code
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020
with:
2121
# Full git history is needed to get a proper list of changed files within `super-linter`
2222
fetch-depth: 0
2323

2424
- name: Lint Code Base
25-
uses: github/super-linter/slim@v4
25+
uses: github/super-linter/slim@v5
2626
env:
2727
DEFAULT_BRANCH: dev
2828
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -40,8 +40,8 @@ jobs:
4040
steps:
4141
- id: git-checkout
4242
name: Checkout
43-
uses: actions/checkout@v3
43+
uses: actions/checkout@v4
4444

4545
- id: docker-test
4646
name: Test the image
47-
run: ./test.sh snapshot
47+
run: ./test.sh

0 commit comments

Comments
 (0)