Skip to content

Comware remove extra enter #1214

Comware remove extra enter

Comware remove extra enter #1214

Workflow file for this run

---
name: Netmiko
on: [push,pull_request]
env:
environment: gh_actions
FORCE_COLOR: 1
jobs:
linters:
name: linters
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install uv and Python 3.12
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
python-version: "3.12"
enable-cache: true
- name: Install dependencies
run: uv sync --frozen
- name: Run ruff check
run: uv run --frozen ruff check .
- name: Run ruff format
run: uv run --frozen ruff format --check .
- name: Run mypy
run: |
uv run --frozen mypy --version
uv run --frozen mypy ./netmiko/
- name: Run bandit security scan
run: uv run --frozen bandit -r netmiko/ -c pyproject.toml
- name: Run pip-audit dependency scan
run: >
uv run --frozen pip-audit
--ignore-vuln CVE-2026-44405
--ignore-vuln CVE-2026-30922
# CVE-2026-44405: paramiko 4.0.0 allows SHA-1. This is intentional —
# paramiko 5.x removed SHA-1 support which breaks connectivity to legacy
# network devices. netmiko constrains paramiko<5.0 for the same reason.
# CVE-2026-30922: pyasn1 0.6.0 vulnerability. Cannot upgrade — genie
# (optional parsers group) pins pyasn1==0.6.0 exactly. Only affects
# the optional parsers install, not the default netmiko install.
pytest:
name: Std Test on Python ${{ matrix.python-version }} (${{ matrix.platform}})
defaults:
run:
shell: bash
strategy:
matrix:
python-version: ['3.10', '3.11', "3.12", "3.13", "3.14"]
platform: [ubuntu-24.04, windows-2022]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install uv and Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install dependencies
run: uv sync --frozen
- name: Run Tests (with coverage)
if: matrix.python-version == '3.13' && matrix.platform == 'ubuntu-24.04'
run: >
uv run --frozen pytest -v -s
tests/test_import_netmiko.py
tests/unit/test_base_connection.py
tests/unit/test_ssh_autodetect.py
tests/unit/test_connection.py
tests/unit/test_entry_points.py
tests/unit/test_session_log.py
--cov=netmiko
--cov-report=term-missing
- name: Run Tests
if: "!(matrix.python-version == '3.13' && matrix.platform == 'ubuntu-24.04')"
run: |
uv run --frozen pytest -v -s tests/test_import_netmiko.py
uv run --frozen pytest -v -s tests/unit/test_base_connection.py
uv run --frozen pytest -v -s tests/unit/test_ssh_autodetect.py
uv run --frozen pytest -v -s tests/unit/test_connection.py
uv run --frozen pytest -v -s tests/unit/test_entry_points.py
uv run --frozen pytest -v -s tests/unit/test_session_log.py
pytest-macos15:
name: Std Test on Python ${{ matrix.python-version }} (${{ matrix.platform}})
defaults:
run:
shell: bash
strategy:
matrix:
python-version: [ '3.12', '3.13', '3.14' ]
platform: [macos-15]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install uv and Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install dependencies
run: uv sync --frozen
- name: Run Tests
run: |
uv run --frozen pytest -v -s tests/test_import_netmiko.py
uv run --frozen pytest -v -s tests/unit/test_base_connection.py
uv run --frozen pytest -v -s tests/unit/test_ssh_autodetect.py
uv run --frozen pytest -v -s tests/unit/test_connection.py
uv run --frozen pytest -v -s tests/unit/test_entry_points.py
uv run --frozen pytest -v -s tests/unit/test_session_log.py
pytest-macos14:
name: Std Test on Python ${{ matrix.python-version }} (${{ matrix.platform}})
defaults:
run:
shell: bash
strategy:
matrix:
python-version: [ "3.12", "3.13", "3.14" ]
platform: [macos-14]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install uv and Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install dependencies
run: uv sync --frozen
- name: Run Tests
run: |
uv run --frozen pytest -v -s tests/test_import_netmiko.py
uv run --frozen pytest -v -s tests/unit/test_base_connection.py
uv run --frozen pytest -v -s tests/unit/test_ssh_autodetect.py
uv run --frozen pytest -v -s tests/unit/test_connection.py
uv run --frozen pytest -v -s tests/unit/test_entry_points.py
uv run --frozen pytest -v -s tests/unit/test_session_log.py
pytest_parsers:
name: Parsers Test on Python ${{ matrix.python-version }} (${{ matrix.platform}})
defaults:
run:
shell: bash
# Only use latest Python version that will work with pyats/genie due to their
# ongoing issues supporting newer Python versions.
strategy:
matrix:
python-version: [ '3.11']
platform: [ubuntu-24.04]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install uv and Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install dependencies
run: uv sync --frozen --group parsers
- name: Run Tests
run: |
uv run --frozen pytest -v -s tests/test_import_netmiko.py
uv run --frozen pytest -v -s tests/unit/test_utilities.py