Skip to content

Commit 6ac15f2

Browse files
authored
Merge pull request #29 from mariokakoulli/netbox-upgrade-4.2
Netbox upgrade 4.2
2 parents ca7462a + 874c9a3 commit 6ac15f2

File tree

8 files changed

+84
-118
lines changed

8 files changed

+84
-118
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Before you submit a pull request, check that it meets these guidelines:
9494
2. If the pull request adds functionality, the docs should be updated. Put
9595
your new functionality into a function with a docstring, and add the
9696
feature to the list in README.md.
97-
3. The pull request should work for Python 3.6, 3.7, 3.8 and 3.9. Check
97+
3. The pull request should work for Python 3.10, 3.11, and 3.12. Check
9898
https://github.com/jasonyates/netbox_circuitmaintenance/actions
9999
and make sure that the tests pass for all supported Python versions.
100100

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The plugin does not directly provide an automated approach to ingesting provider
1818
This plugin is only supported on NetBox 3.4 or higher, for exact compatibility information, see the table below.
1919
| NetBox Version | Plugin Version |
2020
|--|--|
21+
| 4.2+ | 0.5.0 |
2122
| 4.0+ | 0.4.2 |
2223
| 3.5 | 0.3.0 |
2324
| 3.4 | 0.2.2 |
@@ -45,7 +46,7 @@ To ensure the Netbox Documents plugin is automatically re-installed during futur
4546

4647
### Enable the Plugin
4748

48-
In the Netbox `configuration.py` configuration file add or update the PLUGINS parameter, adding `netbox_documents`:
49+
In the Netbox `configuration.py` configuration file add or update the PLUGINS parameter, adding `netbox_circuitmaintenance`:
4950

5051

5152
```python

netbox_circuitmaintenance/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
__author__ = """Jason Yates"""
44
__email__ = 'me@jasonyates.co.uk'
5-
__version__ = '0.4.2'
5+
__version__ = '0.5.0'
66

77

88
from netbox.plugins import PluginConfig

netbox_circuitmaintenance/api/serializers.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from netbox.api.serializers import NetBoxModelSerializer, WritableNestedSerializer
44
from ..models import CircuitMaintenance, CircuitMaintenanceImpact, CircuitMaintenanceNotifications
5-
from circuits.api.nested_serializers import NestedProviderSerializer, NestedCircuitSerializer
5+
from circuits.api.serializers import ProviderSerializer, CircuitSerializer
66

77

88

@@ -11,7 +11,7 @@ class NestedCircuitMaintenanceImpactSerializer(WritableNestedSerializer):
1111
view_name='plugins-api:netbox_circuitmaintenance-api:circuitmaintenanceimpact-detail'
1212
)
1313

14-
circuit = NestedCircuitSerializer()
14+
circuit = CircuitSerializer(nested=True)
1515

1616
class Meta:
1717
model = CircuitMaintenanceImpact
@@ -24,7 +24,7 @@ class NestedCircuitMaintenanceSerializer(WritableNestedSerializer):
2424
view_name='plugins-api:netbox_circuitmaintenance-api:circuitmaintenance-detail'
2525
)
2626

27-
provider = NestedProviderSerializer()
27+
provider = ProviderSerializer(nested=True)
2828

2929
class Meta:
3030
model = CircuitMaintenance
@@ -50,7 +50,7 @@ class CircuitMaintenanceSerializer(NetBoxModelSerializer):
5050
view_name='plugins-api:netbox_circuitmaintenance-api:circuitmaintenance-detail'
5151
)
5252

53-
provider = NestedProviderSerializer()
53+
provider = ProviderSerializer(nested=True)
5454
impact = NestedCircuitMaintenanceImpactSerializer(required=False, many=True)
5555
notification = NestedCircuitMaintenanceNotificationsSerializer(required=False, many=True)
5656

@@ -67,7 +67,7 @@ class CircuitMaintenanceImpactSerializer(NetBoxModelSerializer):
6767
view_name='plugins-api:netbox_circuitmaintenance-api:circuitmaintenanceimpact-detail'
6868
)
6969

70-
circuit = NestedCircuitSerializer()
70+
circuit = CircuitSerializer(nested=True)
7171
circuitmaintenance = NestedCircuitMaintenanceSerializer()
7272

7373
class Meta:

pyproject.toml

Lines changed: 75 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,99 @@
11
# pyproject.toml
22

33
[build-system]
4-
requires = ["setuptools>=61.0.0", "wheel"]
4+
requires = ["setuptools"]
55
build-backend = "setuptools.build_meta"
66

7+
[tool.setuptools.packages.find]
8+
include = ["netbox_circuitmaintenance", "netbox_circuitmaintenance.*"]
9+
710
[project]
811
name = "netbox-circuitmaintenance"
9-
version = "0.3.0"
12+
keywords = ['netbox_circuitmaintenance']
13+
version = "0.5.0"
1014
description = "Provides the ability to record circuit maintenance, maintenance impact and maintenance notifications in Netbox and link them to Providers and Circuits."
1115
readme = "README.md"
1216
authors = [{ name = "Jason Yates", email = "me@jasonyates.co.uk" }]
13-
license = { file = "LICENSE" }
17+
license-files = ["LICENSE"]
18+
19+
classifiers = [
20+
'Development Status :: 2 - Pre-Alpha',
21+
'Intended Audience :: Developers',
22+
'Natural Language :: English',
23+
'Programming Language :: Python :: 3',
24+
'Programming Language :: Python :: 3.10',
25+
'Programming Language :: Python :: 3.11',
26+
'Programming Language :: Python :: 3.12',
27+
]
28+
29+
requires-python = ">=3.10.0"
30+
31+
[project.optional-dependencies]
32+
dev = [
33+
"black==25.1.0",
34+
"bumpver",
35+
"isort==6.0.1",
36+
"pip-tools",
37+
"pytest",
38+
"flake8==7.2.0",
39+
"pyproject-flake8==7.0.0",
40+
"twine==6.1.0",
41+
"Sphinx==8.2.3",
42+
"watchdog==6.0.0",
43+
]
1444

1545
[project.urls]
1646
Homepage = "https://github.com/jasonyates/netbox-circuitmaintenance"
47+
Documentation = "https://jasonyates.github.io/netbox-circuitmaintenance"
48+
Source = "https://github.com/jasonyates/netbox-circuitmaintenance"
49+
Tracker = "https://github.com/jasonyates/netbox-circuitmaintenance/issues"
1750

18-
[project.optional-dependencies]
19-
dev = ["black", "bumpver", "isort", "pip-tools", "pytest"]
2051

2152
[tool.bumpver]
22-
current_version = "0.3.0"
53+
current_version = "0.5.0"
2354
version_pattern = "MAJOR.MINOR.PATCH"
2455
commit_message = "bump version {old_version} -> {new_version}"
2556
commit = true
2657
tag = true
2758
push = true
2859

2960
[tool.bumpver.file_patterns]
30-
"pyproject.toml" = [
31-
'current_version = "{version}"',
32-
]
33-
"setup.py" = [
34-
"{version}",
35-
"{pep440_version}",
36-
]
37-
"README.md" = [
38-
"{version}",
39-
"{pep440_version}",
40-
]
41-
"netbox_circuitmaintenance/__init__.py" = [
42-
"{version}",
43-
"{__version__}",
61+
"pyproject.toml" = ['current_version = "{version}"']
62+
"README.md" = ["{version}", "{pep440_version}"]
63+
"netbox_circuitmaintenance/__init__.py" = ["{version}", "{__version__}"]
64+
65+
[tool.flake8]
66+
max-line-length = 120
67+
max-complexity = 18
68+
extend-ignore = ["E203", "E266", "W503"]
69+
per-file-ignores = ["__init__.py:F401"]
70+
exclude = [
71+
".git",
72+
"__pycache__",
73+
"setup.py",
74+
"build",
75+
"dist",
76+
"docs",
77+
"releases",
78+
".venv",
79+
".tox",
80+
".mypy_cache",
81+
".pytest_cache",
82+
".vscode",
83+
".github",
4484
]
85+
# By default test codes will be linted.
86+
# tests
87+
88+
[tool.tox]
89+
legacy_tox_ini = """
90+
[tox:tox]
91+
isolated_build = true
92+
envlist = py310, py311, py312, format, lint, build
93+
94+
[gh-actions]
95+
python =
96+
3.12: py312
97+
3.11: py311
98+
3.10: py310, format, lint, build
99+
"""

requirements_dev.txt

Lines changed: 0 additions & 9 deletions
This file was deleted.

setup.cfg

Lines changed: 0 additions & 46 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)