Add .travis.yml to run mypy. (#192)

* Add typing to modules/tfl.py.

* Add .travis.yml to run mypy.
This commit is contained in:
Valentin Lorentz 2019-11-01 07:10:35 +01:00 committed by jesopo
parent a96582e953
commit 135020b42f
2 changed files with 14 additions and 2 deletions

12
.travis.yml Normal file
View file

@ -0,0 +1,12 @@
language: python
cache: pip
python:
- "3.6"
- "3.7"
- "3.8"
- "3.8-dev"
- "nightly"
install:
- pip3 install mypy -r requirements.txt
script:
- mypy --ignore-missing-imports src ./bitbotd modules/

View file

@ -1,6 +1,6 @@
#--depends-on commands #--depends-on commands
import collections, datetime, re import collections, datetime, re, typing
from src import ModuleManager, utils from src import ModuleManager, utils
URL_BUS = "https://api.tfl.gov.uk/StopPoint/%s/Arrivals" URL_BUS = "https://api.tfl.gov.uk/StopPoint/%s/Arrivals"
@ -22,7 +22,7 @@ PLATFORM_TYPES = ["Northbound", "Southbound", "Eastbound", "Westbound", "Inner R
class Module(ModuleManager.BaseModule): class Module(ModuleManager.BaseModule):
_name = "TFL" _name = "TFL"
result_map = {} result_map: typing.Dict[int, typing.Dict[int, typing.Dict[str, typing.Any]]] = {}
def vehicle_span(self, arrival_time, human=True): def vehicle_span(self, arrival_time, human=True):
vehicle_due_iso8601 = arrival_time vehicle_due_iso8601 = arrival_time