Skip to content

Commit

Permalink
Pass mypy and link issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Sep 18, 2024
1 parent 00a5051 commit 0898786
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 28 deletions.
4 changes: 2 additions & 2 deletions jaraco/ui/cmdline.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import argparse

import jaraco.text
from jaraco.classes import meta
from jaraco import text # type: ignore


class Command(metaclass=meta.LeafClassesMeta):
Expand Down Expand Up @@ -39,7 +39,7 @@ def add_subparsers(cls, parser):

@classmethod
def add_parser(cls, subparsers):
cmd_string = text.words(cls.__name__).lowered().dash_separated()
cmd_string = jaraco.text.words(cls.__name__).lowered().dash_separated()
parser = subparsers.add_parser(cmd_string)
parser.set_defaults(action=cls)
cls.add_arguments(parser)
Expand Down
41 changes: 19 additions & 22 deletions jaraco/ui/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,25 @@
This module currently provides a cross-platform getch function
"""

try:
# Windows
from msvcrt import getch # type: ignore
import sys

getch # workaround for https://github.com/kevinw/pyflakes/issues/13
except ImportError:
pass
if sys.platform == "win32":
from msvcrt import getch as getch
else:
try:
# Unix
import sys
import termios
import tty

try:
# Unix
import sys
import tty
import termios
def getch():
fd = sys.stdin.fileno()
old = termios.tcgetattr(fd)
try:
tty.setraw(fd)
return sys.stdin.read(1)
finally:
termios.tcsetattr(fd, termios.TCSADRAIN, old)

def getch(): # type: ignore
fd = sys.stdin.fileno()
old = termios.tcgetattr(fd)
try:
tty.setraw(fd)
return sys.stdin.read(1)
finally:
termios.tcsetattr(fd, termios.TCSADRAIN, old)

except ImportError:
pass
except ImportError:
pass
4 changes: 4 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ explicit_package_bases = True
disable_error_code =
# Disable due to many false positives
overload-overlap,

# jaraco/jaraco.text#17
[mypy-jaraco.text.*]
ignore_missing_imports = True
4 changes: 0 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,3 @@ type = [


[tool.setuptools_scm]


[tool.pytest-enabler.mypy]
# Disabled due to jaraco/skeleton#143

0 comments on commit 0898786

Please sign in to comment.