Skip to content

Commit

Permalink
Vendor telnetlib library internally to Netmiko (#3444)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktbyers committed Jun 26, 2024
1 parent cef1404 commit cfdfe8b
Show file tree
Hide file tree
Showing 15 changed files with 2,470 additions and 1,372 deletions.
104 changes: 68 additions & 36 deletions .github/workflows/main_testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,29 @@ env:
jobs:
linters:
name: linters
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v5
id: cp311
with:
python-version: '3.11'
architecture: x64

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install poetry
run: |
pipx install poetry
- name: Cache Poetry virtualenv
uses: actions/cache@v2
id: cached-poetry-dependencies
- name: Set up Python
uses: actions/setup-python@v5
with:
path: .venv
key: venv-${{ runner.os }}-cache-${{ steps.cp311.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
python-version: '3.11'
cache: 'poetry'

- name: Install Dependencies
run: poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Install dependencies
run: |
poetry install
- name: Run pylama
run: |
Expand All @@ -51,50 +46,87 @@ jobs:
poetry run mypy ./netmiko/
pytest:
name: Testing on Python ${{ matrix.python-version }} (${{ matrix.platform}})
name: Std Test on Python ${{ matrix.python-version }} (${{ matrix.platform}})
defaults:
run:
shell: bash
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11' ]
platform: [ubuntu-20.04]
python-version: [ '3.8', '3.9', '3.10', '3.11', "3.12", "3.13.0-beta.2" ]
platform: [ubuntu-24.04]

runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v5
id: py_ver
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- uses: actions/checkout@v4

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install poetry
run: |
pipx install poetry
- name: Cache Poetry virtualenv
uses: actions/cache@v2
id: cached-poetry-dependencies
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
path: .venv
key: venv-${{ runner.os }}-cache-${{ steps.py_ver.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
if: ${{ matrix.platform != 'windows-latest' }} # windows hangs if using a cached venv
python-version: ${{ matrix.python-version }}
cache: 'poetry'

- name: Install Dependencies
run: poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Install dependencies
run: |
poetry install
- name: Run Tests
run: |
poetry run pytest -v -s tests/test_import_netmiko.py
poetry run pytest -v -s tests/unit/test_base_connection.py
poetry run pytest -v -s tests/unit/test_utilities.py
poetry run pytest -v -s tests/unit/test_ssh_autodetect.py
poetry run pytest -v -s tests/unit/test_connection.py
poetry run pytest -v -s tests/unit/test_entry_points.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@v4

- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- uses: actions/checkout@v4

- name: Install poetry
run: |
pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'

- name: Install dependencies
run: |
poetry install --with parsers
- name: Run Tests
run: |
poetry run pytest -v -s tests/test_import_netmiko.py
poetry run pytest -v -s tests/unit/test_utilities.py
37 changes: 13 additions & 24 deletions license-dependencies.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
#### Netmiko dependencies
#### 2022-03-23
#### Netmiko itself

Name Version License
------------- ------- -------
netmiko 4.1.0 MIT License
Name License
------------- -------
netmiko MIT License
telnetlib PSF2

##### Direct dependencies
Name Version License
------------- ------- -------
paramiko 2.10.4 GNU Library or Lesser General Public License (LGPL)
scp 0.14.4 GNU Library or Lesser General Public License (LGPL)
ntc-templates 3.0.0 Apache Software License
pyserial 3.5 BSD License
PyYAML 6.0 MIT License

##### Child dependencies
Name Version License
------------- ------- -------
PyNaCl 1.5.0 Apache License 2.0
bcrypt 3.2.0 Apache Software License
textfsm 1.1.2 Apache Software License
cryptography 37.0.0 Apache Software License; BSD License
pycparser 2.21 BSD License
cffi 1.15.0 MIT License
future 0.18.2 MIT License
six 1.16.0 MIT License
Name License
------------- -------
paramiko GNU Library or Lesser General Public License (LGPL)
scp GNU Library or Lesser General Public License (LGPL)
PyYAML MIT License
textfsm Apache2
ntc-templates Apache2
pyserial BSD License
Loading

0 comments on commit cfdfe8b

Please sign in to comment.