Skip to content

Commit 7acf7a7

Browse files
authored
Merge pull request #36 from napalm-automation-community/develop
Release 5.1.0
2 parents c2a8fe8 + 87824f5 commit 7acf7a7

File tree

6 files changed

+13
-18
lines changed

6 files changed

+13
-18
lines changed

.github/workflows/commit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
max-parallel: 4
1010
matrix:
11-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
11+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1212
steps:
1313
- name: Checkout repository
1414
uses: actions/checkout@v4

napalm_mos/__init__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@
1313
# the License.
1414

1515
"""napalm-mos package."""
16-
import pkg_resources
16+
from importlib.metadata import version
1717
from napalm_mos.mos import MOSDriver
1818

19-
try:
20-
__version__ = pkg_resources.get_distribution("napalm-mos").version
21-
except pkg_resources.DistributionNotFound:
22-
__version__ = "Not installed"
19+
__version__ = version("napalm-mos")
2320

2421
__all__ = ["MOSDriver"]

napalm_mos/mos.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import inspect
3535

3636
from datetime import timedelta, datetime
37-
from distutils.version import LooseVersion
37+
from packaging.version import Version
3838
from ipaddress import IPv4Network
3939

4040
from pyeapi.client import Node as EapiNode
@@ -92,7 +92,7 @@ def __init__(self, hostname, username, password, timeout=60, optional_args=None)
9292
self._current_config = None
9393
self._replace_config = False
9494
self._ssh = None
95-
self._version = LooseVersion("0")
95+
self._version = Version("0")
9696

9797
self.platform = "mos"
9898

@@ -126,7 +126,7 @@ def _run_translated_commands(self, commands, **kwargs):
126126
In 0.22.0+ some commands had their syntax change. This function translates those command
127127
syntaxs to their post 0.22.0 version
128128
"""
129-
if self._version >= LooseVersion("0.22.0"):
129+
if self._version >= Version("0.22.0"):
130130
# Map of translate command syntax to 0.23.0+ syntax
131131
translations = {
132132
"show snmp chassis-id": "show snmp v2-mib chassis-id",
@@ -155,11 +155,11 @@ def open(self):
155155
sw_version = self.device.run_commands(["show version"])[0].get(
156156
"softwareImageVersion", "0.0.0"
157157
)
158-
if LooseVersion(sw_version) < LooseVersion("0.17.9"):
158+
if Version(sw_version) < Version("0.17.9"):
159159
raise NotImplementedError(
160160
"MOS Software Version 0.17.9 or better required"
161161
)
162-
self._version = LooseVersion(sw_version)
162+
self._version = Version(sw_version)
163163
except ConnectionError as ce:
164164
raise ConnectionException(ce.message)
165165

@@ -264,7 +264,7 @@ def _load_config(self, filename=None, config=None, replace=False):
264264
self._candidate.append("end")
265265
if any(
266266
"source mac" in line for line in self._candidate
267-
) and self._version < LooseVersion("0.19.2"):
267+
) and self._version < Version("0.19.2"):
268268
# Waiting for fixed release
269269
raise CommandErrorException(
270270
"Cannot set source mac in MOS versions prior to 0.19.2"

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
napalm>=5.0.0
1+
napalm>=5.1.0
2+
packaging>=25.0

setup.cfg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,5 @@ json_report = report.json
1212
jsonapi = true
1313

1414
[coverage:run]
15-
include =
16-
napalm_mos/*
1715

1816
[easy_install]
19-

setup.py

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

1010
setup(
1111
name="napalm-mos",
12-
version="5.0.0",
12+
version="5.1.0",
1313
packages=find_packages(),
1414
author="Benny Holmgren, Brandon Ewing",
1515
author_email="benny@holmgren.id.au, brandon.ewing@warningg.com",
@@ -23,5 +23,5 @@
2323
url="https://github.com/napalm-automation-community/napalm-mos",
2424
include_package_data=True,
2525
install_requires=reqs,
26-
python_requires=">=3.8",
26+
python_requires=">=3.9",
2727
)

0 commit comments

Comments
 (0)