Skip to content

Commit

Permalink
Merge branch 'fix-napalm-automation#1569' into release-fork
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidVentura committed Feb 18, 2022
2 parents ba34c2d + eb625e9 commit 4272622
Show file tree
Hide file tree
Showing 53 changed files with 2,339 additions and 1,216 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
name: build
on: [push, pull_request]
jobs:
Expand Down Expand Up @@ -33,10 +33,14 @@ jobs:
run: |
pylama .
- name: Run type checker
run: |
mypy -p napalm --config-file mypy.ini
- name: Run Tests
run: |
py.test --cov=napalm --cov-report term-missing -vs --pylama
build_docs:
needs: std_tests
runs-on: ubuntu-latest
Expand Down
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
("index", "napalm.tex", u"NAPALM Documentation", u"David Barroso", "manual")
("index", "napalm.tex", "NAPALM Documentation", "David Barroso", "manual")
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -241,7 +241,7 @@

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [("index", "napalm", u"NAPALM Documentation", [u"David Barroso"], 1)]
man_pages = [("index", "napalm", "NAPALM Documentation", ["David Barroso"], 1)]

# If true, show URL addresses after external links.
# man_show_urls = False
Expand All @@ -256,8 +256,8 @@
(
"index",
"napalm",
u"NAPALM Documentation",
u"David Barroso",
"NAPALM Documentation",
"David Barroso",
"napalm",
"One line description of project.",
"Miscellaneous",
Expand Down
23 changes: 22 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ allow_redefinition = True
[mypy-napalm.base.*]
disallow_untyped_defs = True

[mypy-napalm.nxos.*]
disallow_untyped_defs = True

[mypy-napalm.eos.*]
ignore_errors = True

[mypy-napalm.ios.*]
ignore_errors = True

[mypy-napalm.iosxr_netconf.*]
ignore_errors = True

[mypy-napalm.nxapi_plumbing.*]
disallow_untyped_defs = True

[mypy-napalm.base.clitools.*]
ignore_errors = True

[mypy-napalm.base.test.*]
ignore_errors = True

Expand All @@ -23,11 +41,14 @@ ignore_missing_imports = True
[mypy-lxml.*]
ignore_missing_imports = True

[mypy-ciscoconfparse]
[mypy-netutils.*]
ignore_missing_imports = True

[mypy-textfsm]
ignore_missing_imports = True

[mypy-ttp]
ignore_missing_imports = True

[mypy-pytest]
ignore_missing_imports = True
4 changes: 3 additions & 1 deletion napalm/base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import importlib

# NAPALM base
from typing import Type

from napalm.base.base import NetworkDriver
from napalm.base.exceptions import ModuleImportError
from napalm.base.mock import MockDriver
Expand All @@ -29,7 +31,7 @@
]


def get_network_driver(name, prepend=True):
def get_network_driver(name: str, prepend: bool = True) -> Type[NetworkDriver]:
"""
Searches for a class derived form the base NAPALM class NetworkDriver in a specific library.
The library name must repect the following pattern: napalm_[DEVICE_OS].
Expand Down
Loading

0 comments on commit 4272622

Please sign in to comment.