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

Pass mypy and link issues #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading