Skip to content

Commit

Permalink
Upgrade to mypy 1.0.0 to fix CI-CD breakage (ktbyers#3106)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktbyers committed May 5, 2023
1 parent fdd9fb0 commit ca05466
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 21 deletions.
1 change: 1 addition & 0 deletions PLATFORMS.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,3 +279,4 @@
- juniper_junos
- linux
- nokia_sros

1 change: 0 additions & 1 deletion license-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ 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)
tenacity 8.0.1 Apache Software License
ntc-templates 3.0.0 Apache Software License
pyserial 3.5 BSD License
PyYAML 6.0 MIT License
Expand Down
4 changes: 2 additions & 2 deletions netmiko/audiocode/audiocode_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def send_config_set(
enter_config_mode: bool = True,
error_pattern: str = "",
terminator: str = r"/.*>",
bypass_commands: str = None,
bypass_commands: Optional[str] = None,
) -> str:

return super().send_config_set(
Expand Down Expand Up @@ -447,7 +447,7 @@ def _enable_paging(
delay_factor: Optional[float] = 0.5,
) -> str:
"""Not supported"""
pass
return ""

def strip_command(self, command_string: str, output: str) -> str:
# Support for Audiocode_Shell.
Expand Down
7 changes: 0 additions & 7 deletions netmiko/base_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

import paramiko
import serial
from tenacity import retry, stop_after_attempt, wait_exponential
import warnings

from netmiko import log
Expand Down Expand Up @@ -1294,12 +1293,6 @@ def set_terminal_width(
output = self.read_until_prompt()
return output

# Retry by sleeping .33 and then double sleep until 5 attempts (.33, .66, 1.32, etc)
@retry(
wait=wait_exponential(multiplier=0.33, min=0, max=5),
stop=stop_after_attempt(5),
reraise=True,
)
def set_base_prompt(
self,
pri_prompt_terminator: str = "#",
Expand Down
8 changes: 4 additions & 4 deletions netmiko/nokia/nokia_sros.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,13 @@ def save_config(self, *args: Any, **kwargs: Any) -> str:
def send_config_set(
self,
config_commands: Union[str, Sequence[str], Iterator[str], TextIO, None] = None,
exit_config_mode: bool = None,
exit_config_mode: bool = True,
**kwargs: Any,
) -> str:
"""Model driven CLI requires you not exit from configuration mode."""
if exit_config_mode is None:
# Set to False if model-driven CLI
exit_config_mode = False if "@" in self.base_prompt else True
# Set to False if model-driven CLI
if "@" in self.base_prompt:
exit_config_mode = False
return super().send_config_set(
config_commands=config_commands, exit_config_mode=exit_config_mode, **kwargs
)
Expand Down
2 changes: 1 addition & 1 deletion netmiko/session_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def __init__(
buffered_io: Optional[io.BufferedIOBase] = None,
file_mode: str = "write",
file_encoding: str = "utf-8",
no_log: Dict[str, Any] = None,
no_log: Optional[Dict[str, Any]] = None,
record_writes: bool = False,
) -> None:
if no_log is None:
Expand Down
2 changes: 1 addition & 1 deletion netmiko/sixwind/sixwind_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def session_preparation(self) -> None:

def disable_paging(self, *args: Any, **kwargs: Any) -> str:
"""6WIND requires no-pager at the end of command, not implemented at this time."""
pass
return ""

def set_base_prompt(
self,
Expand Down
2 changes: 1 addition & 1 deletion netmiko/terminal_server/terminal_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class TerminalServerTelnet(TerminalServer):

def telnet_login(self, *args: Any, **kwargs: Any) -> str:
# Disable automatic handling of username and password when using terminal server driver
pass
return ""

def std_login(self, *args: Any, **kwargs: Any) -> str:
return super().telnet_login(*args, **kwargs)
2 changes: 1 addition & 1 deletion netmiko/watchguard/fireware_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ def exit_config_mode(self, exit_config: str = "exit", pattern: str = "#") -> str

def save_config(self, *args: Any, **kwargs: Any) -> str:
"""No save config on Watchguard."""
pass
return ""
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
black==22.3.0
mypy==0.961
mypy-extensions==0.4.3
mypy==1.0.0
mypy-extensions==1.0.0
PyYAML==5.4.1
pytest==7.1.2
# Issue with build failure on pyflakes 2.5.0
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def find_version(*file_paths):
"setuptools>=38.4.0",
"paramiko>=2.7.2",
"scp>=0.13.3",
"tenacity",
"pyyaml>=5.3",
"textfsm",
"ntc-templates>=2.0.0",
Expand Down

0 comments on commit ca05466

Please sign in to comment.