Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type hinting #1476

Merged
merged 46 commits into from
Feb 12, 2022
Merged
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
be14dc1
Add models and annotate NetworkDriver class with types
Kircheneer Mar 22, 2021
49791a9
Make tests pass by ignoring the annotations part of the arg spec
Kircheneer Mar 22, 2021
ba7b56f
Unpack optional in NXOSDevice.load_merge_candidate()
Kircheneer Mar 22, 2021
4df5ff2
Add lots of type hints, asserts and some abstract methods. Enable typ…
Kircheneer Mar 22, 2021
f4604a2
Solve type errors
Kircheneer Mar 27, 2021
aca0ebb
Add type checker to github actions
Kircheneer Mar 27, 2021
12f9da7
Specify mypy config file in github action
Kircheneer Mar 27, 2021
d8eaed7
Fix unused imports
Kircheneer Mar 27, 2021
8b8986b
Black formatting
Kircheneer Mar 27, 2021
80f9a98
Fix further pipeline problems
Kircheneer Mar 27, 2021
18907d3
Fix further pipeline errors
Kircheneer Mar 27, 2021
4ee35ba
Put type in quotes
Kircheneer Mar 27, 2021
97e0cae
Convert all typing_extensions try/except imports to pure typing_exten…
Kircheneer Mar 27, 2021
e373e03
Import TypedDict from typing_extensions in nxos.py
Kircheneer Mar 27, 2021
72c3e92
Ignore typing errors from napalm.iosxr_netconf
Kircheneer Apr 30, 2021
5ced7a3
Fix Callable import in mock.py
Kircheneer May 1, 2021
d52a2cb
Add models and annotate NetworkDriver class with types
Kircheneer Mar 22, 2021
066da2d
Make tests pass by ignoring the annotations part of the arg spec
Kircheneer Mar 22, 2021
67aef96
Add lots of type hints, asserts and some abstract methods. Enable typ…
Kircheneer Mar 22, 2021
39b6348
Solve type errors
Kircheneer Mar 27, 2021
c528848
Add type checker to github actions
Kircheneer Mar 27, 2021
d6ed6e2
Fix unused imports
Kircheneer Mar 27, 2021
ce4962c
Black formatting
Kircheneer Mar 27, 2021
3f4c6ad
Fix further pipeline problems
Kircheneer Mar 27, 2021
91dd630
Fix further pipeline errors
Kircheneer Mar 27, 2021
229820f
Convert all typing_extensions try/except imports to pure typing_exten…
Kircheneer Mar 27, 2021
3d09940
Import TypedDict from typing_extensions in nxos.py
Kircheneer Mar 27, 2021
53d7995
Fix Callable import in mock.py
Kircheneer May 1, 2021
10c0c38
Black
Kircheneer Jun 4, 2021
f7c36a0
Black
Kircheneer Jun 4, 2021
37e409a
Black
Kircheneer Jul 25, 2021
81c7a44
Fix linter issues
Kircheneer Jul 25, 2021
5c38927
Fix MyPy issues
Kircheneer Jul 25, 2021
f74e05f
Remove unused import
Kircheneer Jul 25, 2021
47b93ae
Solve type errors
Kircheneer Mar 27, 2021
431ebf4
Add type checker to github actions
Kircheneer Mar 27, 2021
4485899
Fix MyPy issues
Kircheneer Jul 25, 2021
9260bfa
Fix pylama issues
Kircheneer Feb 11, 2022
3bc3ed8
Remove future import.
Kircheneer Feb 11, 2022
a978096
Bump pytest-pythonpath from 0.7.3 to 0.7.4
dependabot[bot] Feb 10, 2022
92119dc
Fix outstanding Mypy errors
Kircheneer Feb 12, 2022
4e675ff
Merge branch 'develop' of https://github.com/napalm-automation/napalm…
Kircheneer Feb 12, 2022
6731176
Fix new type errors from develop rebase.
Kircheneer Feb 12, 2022
ee7e0bb
Re-add new type checking requirements to dev-requirements.
Kircheneer Feb 12, 2022
8c324ef
Apply black.
Kircheneer Feb 12, 2022
e4061c6
Elaborate on assert statement supporting Mypy in convert helper funct…
Kircheneer Feb 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix further pipeline errors
Kircheneer committed Feb 12, 2022

Unverified

This user has not yet uploaded their public signing key.
commit 18907d33a1124043bcfc217b01827cb08db5d1bc
2 changes: 1 addition & 1 deletion napalm/base/base.py
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal
from typing_extensions import Literal # type: ignore

from netmiko import ConnectHandler, NetMikoTimeoutException

2 changes: 1 addition & 1 deletion napalm/base/helpers.py
Original file line number Diff line number Diff line change
@@ -303,7 +303,7 @@ def find_txt(
return str(value)


def convert(to: Callable[[T], R], who: Optional[T], default: R = "") -> R:
def convert(to: Callable[[T], R], who: Optional[T], default: R = "") -> R: # type: ignore
"""
Converts data to a specific datatype.
In case of error, will return a default value.