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 1, 2023
1 parent 88c2a7e commit 8e0e6ba
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ repos:
# cannot use --warn-unused-ignores because it conflicts with
# --ignore-missing-imports
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.1.1
rev: v0.930
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'
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,11 @@ max-complexity = 15

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

[[tool.mypy.overrides]]
module = [
"ctypes.windll",
"packaging.*",
"platformdirs"
]
ignore_missing_imports = true
6 changes: 3 additions & 3 deletions src/pipx/animate.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ def print_animation(
# https://stackoverflow.com/a/10455937
def win_cursor(visible: bool) -> None:
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 8e0e6ba

Please sign in to comment.