Skip to content

Commit

Permalink
make mypy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Dos Moonen committed Aug 2, 2023
1 parent 88c2a7e commit a0fff25
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ repos:
rev: v1.1.1
hooks:
- id: mypy
args: ['--ignore-missing-imports', '--strict-equality','--no-implicit-optional']
args: ['--warn-unused-ignores', '--strict-equality','--no-implicit-optional']
exclude: 'testdata/test_package_specifier/local_extras/setup.py'
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
MAN_DEPENDENCIES = [".", "argparse-manpage[setuptools]"]
LINT_DEPENDENCIES = [
"black==22.8.0",
"mypy==0.930",
"mypy==1.1.1",
"packaging>=20.0",
"ruff==0.0.254",
"types-jinja2",
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,10 @@ max-complexity = 15

[tool.pytest.ini_options]
markers = ["all_packages: test install with maximum number of packages"]

[[tool.mypy.overrides]]
module = [
"packaging.*",
"platformdirs"
]
ignore_missing_imports = true
8 changes: 5 additions & 3 deletions src/pipx/animate.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,13 @@ def print_animation(
# for Windows pre-ANSI-terminal-support (before Windows 10 TH2 (v1511))
# https://stackoverflow.com/a/10455937
def win_cursor(visible: bool) -> None:
if sys.platform != "win32": # hello mypy
return
ci = _CursorInfo()
handle = ctypes.windll.kernel32.GetStdHandle(-11) # type: ignore[attr-defined]
ctypes.windll.kernel32.GetConsoleCursorInfo(handle, ctypes.byref(ci)) # type: ignore[attr-defined]
handle = ctypes.windll.kernel32.GetStdHandle(-11)
ctypes.windll.kernel32.GetConsoleCursorInfo(handle, ctypes.byref(ci))
ci.visible = visible
ctypes.windll.kernel32.SetConsoleCursorInfo(handle, ctypes.byref(ci)) # type: ignore[attr-defined]
ctypes.windll.kernel32.SetConsoleCursorInfo(handle, ctypes.byref(ci))


def hide_cursor() -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def pipx_local_pypiserver(request):
request.config.invocation_params.dir / PIPX_TESTS_DIR / "htpasswd"
)

from passlib.apache import HtpasswdFile
from passlib.apache import HtpasswdFile # type: ignore

ht = HtpasswdFile(pypiserver_htpasswd, new=True)
ht.set_password("username", "password")
Expand Down

0 comments on commit a0fff25

Please sign in to comment.