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, fix import and link issues #1

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/input/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

__all__ = ['Joystick']

import sys
import importlib
import sys

platform_path = '.'.join((__name__, sys.platform))

try:
Joystick = importlib.import_module(platform_path).Joystick # type: ignore
Joystick = importlib.import_module(platform_path).Joystick
except ImportError:
pass
8 changes: 4 additions & 4 deletions jaraco/input/linux2/joystick.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
borrowed from http://entitycrisis.blogspot.com/2008/02/pyglet-joystick.html
"""

from pyglet import event

from glob import glob
import struct
from glob import glob
from select import select

from jaraco.input import NormalizingAxisJoystick as NormalizingJS
from pyglet import event

from jaraco.input.base import NormalizingAxisJoystick as NormalizingJS

# Linux only gives us axis numbers: translate these to meaningful
# names (as found in the XINPUT_GAMEPAD structure)
Expand Down
7 changes: 5 additions & 2 deletions jaraco/input/win32/xinput.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
via the XInput library.
"""

from __future__ import annotations

import ctypes
import sys
import time
from operator import itemgetter, attrgetter
from itertools import count, starmap
from operator import attrgetter, itemgetter
from typing import ClassVar

from pyglet import event

Expand All @@ -16,7 +19,7 @@


class XINPUT_GAMEPAD(ctypes.Structure):
_fields_ = [
_fields_: ClassVar[list[tuple[str, type[ctypes._CData]]]] = [
('buttons', ctypes.c_ushort), # wButtons
('left_trigger', ctypes.c_ubyte), # bLeftTrigger
('right_trigger', ctypes.c_ubyte), # bLeftTrigger
Expand Down
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,

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


[tool.setuptools_scm]


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