15 Commits
Author SHA1 Message Date
Petr Klíma c3dea8ec10 Update to napalm 4
Merge pull request #87 from napalm-automation-community/develop
2024-03-27 09:25:36 +01:00
Petr Klíma 6e6b38b224 Merge branch 'master' into develop 2024-03-27 09:21:17 +01:00
Petr Klima 3a63056fa8 Check syntax for Py3.12 2024-03-27 09:14:14 +01:00
Petr Klima 08d9a45e77 Shorten name of publish workflow 2024-03-27 09:09:40 +01:00
Petr Klima fc9e83c4bb Updata docs 2024-03-27 09:07:39 +01:00
Petr Klima 9025b0f434 CI renaname job 2024-03-26 17:20:36 +01:00
Petr Klima d6dd81ea81 CI rename legacy jobs 2024-03-26 17:19:12 +01:00
Petr Klima 7a8fbac693 CI FastTest for all other branches. 2024-03-26 17:18:31 +01:00
Petr Klima a4f0473fd2 CI ThoroughTest for branches develop and master 2024-03-26 17:17:47 +01:00
Petr Klima 62f6ab4cc3 Do not test on PyPy, local test with local Py version only 2024-03-26 17:07:14 +01:00
Petr Klima 7009fc9121 Remove Py13 - too early 2024-03-26 16:50:48 +01:00
Petr Klima cfd1169760 Full tox testing on "develop" and "master" branch. 2024-03-26 16:35:18 +01:00
Petr Klima f3d13a5e31 Napalm 4 compatibility, newer dependencies 2024-03-26 16:29:04 +01:00
Petr Klíma 5a9bff81b9 Update PublishToPIP.yml for manual run 2024-03-26 15:42:47 +01:00
Petr Klíma e939d9e73d Update pkg version in setup.py 2024-03-26 15:34:19 +01:00
10 changed files with 108 additions and 71 deletions

No files matched your search

+40
View File
@@ -0,0 +1,40 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Fast Test
on:
push:
branches-ignore:
- develop
- master
pull_request:
branches-ignore:
- develop
- master
jobs:
tox_test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.11" ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
- name: Test with tox
run: |
tox
+2 -1
View File
@@ -1,11 +1,12 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Publish Python Package to PyPi.org
name: Publish To PyPi.org
on:
release:
types: [created]
workflow_dispatch:
jobs:
deploy:
-37
View File
@@ -1,37 +0,0 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Test before push
on:
push:
branches:
- develop
pull_request:
branches:
- develop
- master
# check every 14 days
schedule:
- cron: '0 6 5,20 * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
- name: Test with tox
run: |
tox
+42
View File
@@ -0,0 +1,42 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Thorough Test
on:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
- master
# check every 14 days
schedule:
- cron: '0 6 5,20 * *'
jobs:
tox_test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
- name: Test with tox
run: |
tox
+1 -1
View File
@@ -11,7 +11,7 @@ PyPi: [![Upload](https://github.com/napalm-automation-community/napalm-s350/work
## Requirements
Python 3.8+, napalm 3
Python 3.8+, napalm 4
## Installation
+5 -12
View File
@@ -45,6 +45,8 @@ s350_base_interfaces = {
"te": "TengigabitEthernet",
}
from typing import List
class S350Driver(NetworkDriver):
"""Napalm driver for S350."""
@@ -121,16 +123,6 @@ class S350Driver(NetworkDriver):
"""Close the connection to the device."""
self.device.disconnect()
def cli(self, commands):
output = {}
try:
for cmd in commands:
output[cmd] = self.device.send_command(cmd)
return output
except (socket.error, EOFError) as e:
raise ConnectionClosedException(str(e))
def _send_command(self, command):
"""Wrapper for self.device.send.command().
@@ -291,7 +283,8 @@ class S350Driver(NetworkDriver):
fqdn = "{0}.{1}".format(hostname, domainname)
# interface_list
interfaces = []
interfaces: List[str] = []
show_int_st = show_int_st.strip()
# remove the header information
show_int_st = re.sub(
@@ -312,7 +305,7 @@ class S350Driver(NetworkDriver):
"model": str(model),
"os_version": str(os_version),
"serial_number": str(serial_number),
"uptime": uptime,
"uptime": float(uptime),
"vendor": "Cisco",
}
+7 -5
View File
@@ -1,14 +1,16 @@
napalm>=3.0.0, <4.0.0
netmiko>=3.1.0, <4.0.0
black
napalm<=4.0.0
netmiko<=4.0.0
black<=24.3.0 # CVE-2024-21503
coveralls
ddt
flake8-import-order
pytest==6.2.5
# pytest==6.2.5
pytest
pytest-cov
pytest-json
pytest-pythonpath
pylama
pyflakes==2.4.0 #prevent problems
# pyflakes==2.4.0 #prevent problems
pyflakes
mock
tox
+3 -3
View File
@@ -1,3 +1,3 @@
napalm>=3.0.0, <4.0.0
netmiko>=3.1.0, <4.0.0
netaddr
napalm<=4.0.0
netmiko<=4.0.0
netaddr<=1.2.1
+6 -3
View File
@@ -12,7 +12,7 @@ with open("README.md", "r") as fs:
setup(
name="napalm-s350",
version="0.3.1",
version="0.4.0",
packages=find_packages(exclude=("test*",)),
author="Jasper Lievisse Adriaanse, Petr Klíma, Daniel Bacher",
author_email="j@jasper.la, qaxi@seznam.cz, mail@phill93.de",
@@ -25,9 +25,12 @@ setup(
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
],
+2 -9
View File
@@ -1,6 +1,5 @@
[tox]
#envlist = py3{6,7,8},black,pylama,sphinx
envlist = py3{8,9,10,11,12},pylama,black
envlist = py,pylama,black
skip_missing_interpreters = true
[testenv]
@@ -14,15 +13,9 @@ commands =
[testenv:black]
commands =
black --check --target-version py36 --line-length 100 --color --diff .
black --check --target-version py312 --line-length 100 --color --diff .
[testenv:pylama]
commands =
pylama .
[testenv:sphinx]
commands =
make doctest
whitelist_externals =
make