Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ jobs:
# warnings to the .pylintrc-wip file to prevent them from being
# re-introduced
- pylint --rcfile=.pylintrc-wip can/
# mypy checking
- mypy --python-version=3.7 --ignore-missing-imports --no-implicit-optional can/bit_timing.py can/broadcastmanager.py can/bus.py can/interface.py can/listener.py can/logger.py can/message.py can/notifier.py can/player.py can/thread_safe_bus.py can/util.py
- stage: linter
name: "Formatting Checks"
python: "3.7"
Expand Down
4 changes: 3 additions & 1 deletion can/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@

import logging

from typing import Dict, Any

__version__ = "3.2.0"

log = logging.getLogger("can")

rc = dict()
rc: Dict[str, Any] = dict()


class CanError(IOError):
Expand Down
18 changes: 9 additions & 9 deletions can/bit_timing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Union
from typing import Optional, Union


class BitTiming:
Expand Down Expand Up @@ -27,15 +27,15 @@ class BitTiming:

def __init__(
self,
bitrate: int = None,
f_clock: int = None,
brp: int = None,
tseg1: int = None,
tseg2: int = None,
sjw: int = None,
bitrate: Optional[int] = None,
f_clock: Optional[int] = None,
brp: Optional[int] = None,
tseg1: Optional[int] = None,
tseg2: Optional[int] = None,
sjw: Optional[int] = None,
nof_samples: int = 1,
btr0: int = None,
btr1: int = None,
btr0: Optional[int] = None,
btr1: Optional[int] = None,
):
"""
:param int bitrate:
Expand Down
2 changes: 1 addition & 1 deletion can/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from queue import SimpleQueue, Empty
except ImportError:
# Python 3.0 - 3.6
from queue import Queue as SimpleQueue, Empty
from queue import Queue as SimpleQueue, Empty # type: ignore

import asyncio

Expand Down
4 changes: 2 additions & 2 deletions can/thread_safe_bus.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@


try:
from contextlib import nullcontext
from contextlib import nullcontext # type: ignore

except ImportError:

class nullcontext:
class nullcontext: # type: ignore
"""A context manager that does nothing at all.
A fallback for Python 3.7's :class:`contextlib.nullcontext` manager.
"""
Expand Down
2 changes: 2 additions & 0 deletions requirements-lint.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
pylint==2.3.1
black==19.3b0
mypy==0.720
mypy-extensions==0.4.1