From a8f36953df0e5109d4b04463241dca461d9063ba Mon Sep 17 00:00:00 2001 From: Michael Bukachi Date: Fri, 30 Oct 2020 01:29:04 +0300 Subject: [PATCH] feat: Add types --- Makefile | 5 +- flask_googlemaps/__init__.py | 210 ++++++++++++++++++----------------- flask_googlemaps/icons.py | 13 ++- flask_googlemaps/py.typed | 0 poetry.lock | 64 ++++++++++- pyproject.toml | 2 + 6 files changed, 183 insertions(+), 111 deletions(-) create mode 100644 flask_googlemaps/py.typed diff --git a/Makefile b/Makefile index 152595d..d131d58 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: test pep8 clean install build publish tree env +.PHONY: test pep8 types clean install build publish tree env test: pep8 py.test --cov=flask_googlemaps -l --tb=short --maxfail=1 tests/ @@ -6,6 +6,9 @@ test: pep8 pep8: @flake8 flask_googlemaps --ignore=F403 +types: + @mypy --py2 flask_googlemaps + clean: @find ./ -name '*.pyc' -exec rm -f {} \; @find ./ -name 'Thumbs.db' -exec rm -f {} \; diff --git a/flask_googlemaps/__init__.py b/flask_googlemaps/__init__.py index 7df2318..63c0ad1 100644 --- a/flask_googlemaps/__init__.py +++ b/flask_googlemaps/__init__.py @@ -3,11 +3,12 @@ __version__ = "0.4.0" from json import dumps +from typing import Optional, Dict, Any, List, Union, Tuple, Text import requests from flask import Blueprint, Markup, g, render_template -from flask_googlemaps.icons import dots +from flask_googlemaps.icons import dots, Icon DEFAULT_ICON = dots.red DEFAULT_CLUSTER_IMAGE_PATH = "static/images/m" @@ -16,39 +17,40 @@ class Map(object): def __init__( self, - identifier, - lat, - lng, - zoom=13, - maptype="ROADMAP", - markers=None, - varname="map", - style="height:300px;width:300px;margin:0;", - cls="map", - language="en", - region="US", - rectangles=None, - circles=None, - polylines=None, - polygons=None, - zoom_control=True, - maptype_control=True, - scale_control=True, - streetview_control=True, - rotate_control=True, - scroll_wheel=True, - fullscreen_control=True, - collapsible=False, - mapdisplay=False, - cluster=False, - cluster_imagepath=DEFAULT_CLUSTER_IMAGE_PATH, - cluster_gridsize=60, - fit_markers_to_bounds=False, - center_on_user_location=False, - report_clickpos=False, - clickpos_uri="", + identifier, # type: str + lat, # type: float + lng, # type: float + zoom=13, # type: int + maptype="ROADMAP", # type: str + markers=None, # type: Optional[Union[Dict, List, Tuple]] + varname="map", # type: str + style="height:300px;width:300px;margin:0;", # type: str + cls="map", # type: str + language="en", # type: str + region="US", # type: str + rectangles=None, # type: Optional[List[Union[List, Tuple, Tuple[Tuple], Dict]]] + circles=None, # type: Optional[List[Union[List, Tuple, Dict]]] + polylines=None, # type: Optional[List[Union[List, Tuple, Dict]]] + polygons=None, # type: Optional[List[Union[List, Tuple, Dict]]] + zoom_control=True, # type: bool + maptype_control=True, # type: bool + scale_control=True, # type: bool + streetview_control=True, # type: bool + rotate_control=True, # type: bool + scroll_wheel=True, # type: bool + fullscreen_control=True, # type: bool + collapsible=False, # type: bool + mapdisplay=False, # type: bool + cluster=False, # type: bool + cluster_imagepath=DEFAULT_CLUSTER_IMAGE_PATH, # type: str + cluster_gridsize=60, # type: int + fit_markers_to_bounds=False, # type: bool + center_on_user_location=False, # type: bool + report_clickpos=False, # type: bool + clickpos_uri="", # type: str **kwargs ): + # type: (...) -> None """Builds the Map properties""" self.cls = cls self.style = style @@ -58,15 +60,15 @@ def __init__( self.center = (lat, lng) self.zoom = zoom self.maptype = maptype - self.markers = [] + self.markers = [] # type: List[Any] self.build_markers(markers) - self.rectangles = [] + self.rectangles = [] # type: List[Any] self.build_rectangles(rectangles) - self.circles = [] + self.circles = [] # type: List[Any] self.build_circles(circles) - self.polylines = [] + self.polylines = [] # type: List[Any] self.build_polylines(polylines) - self.polygons = [] + self.polygons = [] # type: List[Any] self.build_polygons(polygons) self.identifier = identifier self.zoom_control = zoom_control @@ -89,6 +91,7 @@ def __init__( self.fit_markers_to_bounds = fit_markers_to_bounds def build_markers(self, markers): + # type: (Optional[Union[Dict, List, Tuple]]) -> None if not markers: return if not isinstance(markers, (dict, list, tuple)): @@ -108,6 +111,7 @@ def build_markers(self, markers): self.add_marker(**marker_dict) def build_marker_dict(self, marker, icon=None): + # type: (Union[List, Tuple], Optional[Icon]) -> Dict marker_dict = { "lat": marker[0], "lng": marker[1], @@ -120,6 +124,7 @@ def build_marker_dict(self, marker, icon=None): return marker_dict def add_marker(self, lat=None, lng=None, **kwargs): + # type: (Optional[float], Optional[float], **Any) -> None if lat is not None: kwargs["lat"] = lat if lng is not None: @@ -129,6 +134,7 @@ def add_marker(self, lat=None, lng=None, **kwargs): self.markers.append(kwargs) def build_rectangles(self, rectangles): + # type: (Optional[List[Union[List, Tuple, Tuple[Tuple], Dict]]]) -> None """ Process data to construct rectangles This method is built from the assumption that the rectangles parameter @@ -196,16 +202,17 @@ def build_rectangles(self, rectangles): def build_rectangle_dict( self, - north, - west, - south, - east, - stroke_color="#FF0000", - stroke_opacity=0.8, - stroke_weight=2, - fill_color="#FF0000", - fill_opacity=0.3, + north, # type: float + west, # type: float + south, # type: float + east, # type: float + stroke_color="#FF0000", # type: str + stroke_opacity=0.8, # type: float + stroke_weight=2, # type: int + fill_color="#FF0000", # type: str + fill_opacity=0.3, # type: float ): + # type: (...) -> Dict """ Set a dictionary with the javascript class Rectangle parameters This function sets a default drawing configuration if the user just @@ -232,19 +239,13 @@ def build_rectangle_dict( "stroke_weight": stroke_weight, "fill_color": fill_color, "fill_opacity": fill_opacity, - "bounds": { - "north": north, - "west": west, - "south": south, - "east": east, - }, + "bounds": {"north": north, "west": west, "south": south, "east": east}, } return rectangle - def add_rectangle( - self, north=None, west=None, south=None, east=None, **kwargs - ): + def add_rectangle(self, north=None, west=None, south=None, east=None, **kwargs): + # type: (Optional[float], Optional[float], Optional[float], Optional[float], **Any) -> None """ Adds a rectangle dict to the Map.rectangles attribute The Google Maps API describes a rectangle using the LatLngBounds @@ -279,9 +280,7 @@ def add_rectangle( if east: kwargs["bounds"]["east"] = east - if set(("north", "east", "south", "west")) != set( - kwargs["bounds"].keys() - ): + if set(("north", "east", "south", "west")) != set(kwargs["bounds"].keys()): raise AttributeError("rectangle bounds required to rectangles") kwargs.setdefault("stroke_color", "#FF0000") @@ -293,6 +292,7 @@ def add_rectangle( self.rectangles.append(kwargs) def build_circles(self, circles): + # type: (Optional[List[Union[List, Tuple, Dict]]]) -> None """ Process data to construct rectangles This method is built from the assumption that the circles parameter @@ -329,23 +329,22 @@ def build_circles(self, circles): elif isinstance(circle, (tuple, list)): if len(circle) != 3: raise AttributeError("circle requires center and radius") - circle_dict = self.build_circle_dict( - circle[0], circle[1], circle[2] - ) + circle_dict = self.build_circle_dict(circle[0], circle[1], circle[2]) self.add_circle(**circle_dict) def build_circle_dict( self, - center_lat, - center_lng, - radius, - stroke_color="#FF0000", - stroke_opacity=0.8, - stroke_weight=2, - fill_color="#FF0000", - fill_opacity=0.3, - clickable=True + center_lat, # type: float + center_lng, # type: float + radius, # type: float + stroke_color="#FF0000", # type: str + stroke_opacity=0.8, # type: float + stroke_weight=2, # type: int + fill_color="#FF0000", # type: str + fill_opacity=0.3, # type: float + clickable=True, # type: bool ): + # type: (...) -> Dict """ Set a dictionary with the javascript class Circle parameters This function sets a default drawing configuration if the user just @@ -374,14 +373,13 @@ def build_circle_dict( "fill_opacity": fill_opacity, "center": {"lat": center_lat, "lng": center_lng}, "radius": radius, - "clickable": clickable + "clickable": clickable, } return circle - def add_circle( - self, center_lat=None, center_lng=None, radius=None, **kwargs - ): + def add_circle(self, center_lat=None, center_lng=None, radius=None, **kwargs): + # type: (Optional[float], Optional[float], Optional[float], **Any) -> None """ Adds a circle dict to the Map.circles attribute The circle in a sphere is called "spherical cap" and is defined in the @@ -423,6 +421,7 @@ def add_circle( self.circles.append(kwargs) def build_polylines(self, polylines): + # type: (Optional[List[Union[List, Tuple, Dict]]]) -> None """ Process data to construct polylines This method is built from the assumption that the polylines parameter @@ -486,6 +485,7 @@ def build_polylines(self, polylines): def build_polyline_dict( self, path, stroke_color="#FF0000", stroke_opacity=0.8, stroke_weight=2 ): + # type: (List[Dict], str, float, int) -> Dict """ Set a dictionary with the javascript class Polyline parameters This function sets a default drawing configuration if the user just @@ -517,6 +517,7 @@ def build_polyline_dict( return polyline def add_polyline(self, path=None, **kwargs): + # type: (Optional[List[Dict]], **Any) -> None """ Adds a polyline dict to the Map.polylines attribute The Google Maps API describes a polyline as a "linear overlay of @@ -561,6 +562,7 @@ def add_polyline(self, path=None, **kwargs): self.polylines.append(kwargs) def build_polygons(self, polygons): + # type: (Optional[List[Union[List, Tuple, Dict]]]) -> None """ Process data to construct polygons This method is built from the assumption that the polygons parameter @@ -625,13 +627,14 @@ def build_polygons(self, polygons): def build_polygon_dict( self, - path, - stroke_color="#FF0000", - stroke_opacity=0.8, - stroke_weight=2, - fill_color="#FF0000", - fill_opacity=0.3, + path, # type: List[Dict] + stroke_color="#FF0000", # type: str + stroke_opacity=0.8, # type: float + stroke_weight=2, # type: int + fill_color="#FF0000", # type: str + fill_opacity=0.3, # type: float ): + # type: (...) -> Dict """ Set a dictionary with the javascript class Polygon parameters This function sets a default drawing configuration if the user just @@ -669,6 +672,7 @@ def build_polygon_dict( return polygon def add_polygon(self, path=None, **kwargs): + # type: (Optional[List[Dict]], **Any) -> None """ Adds a polygon dict to the Map.polygons attribute The Google Maps API describes a polyline as a "linear overlay of @@ -716,9 +720,11 @@ def add_polygon(self, path=None, **kwargs): self.polygons.append(kwargs) def render(self, *args, **kwargs): + # type: (*Any, **Any) -> Text return render_template(*args, **kwargs) def as_json(self): + # type: () -> Dict json_dict = { "identifier": self.identifier, "center": self.center, @@ -752,41 +758,47 @@ def as_json(self): @property def js(self): + # type: () -> Markup return Markup( - self.render( - "googlemaps/gmapjs.html", gmap=self, DEFAULT_ICON=DEFAULT_ICON - ) + self.render("googlemaps/gmapjs.html", gmap=self, DEFAULT_ICON=DEFAULT_ICON) ) @property def html(self): + # type: () -> Markup return Markup(self.render("googlemaps/gmap.html", gmap=self)) def googlemap_obj(*args, **kwargs): + # type: (*Any, **Any) -> Map map = Map(*args, **kwargs) return map def googlemap(*args, **kwargs): + # type: (*Any, **Any) -> Markup map = googlemap_obj(*args, **kwargs) return Markup("".join((map.js, map.html))) def googlemap_html(*args, **kwargs): + # type: (*Any, **Any) -> Markup return googlemap_obj(*args, **kwargs).html def googlemap_js(*args, **kwargs): + # type: (*Any, **Any) -> Markup return googlemap_obj(*args, **kwargs).js def set_googlemaps_loaded(): + # type: () -> str g.googlemaps_loaded = True return "" def get_address(API_KEY, lat, lon): + # type: (str, float, float) -> dict add_dict = dict() response = requests.get( "https://maps.googleapis.com/maps/api/geocode/json?latlng=" @@ -794,29 +806,18 @@ def get_address(API_KEY, lat, lon): + "&key=" + API_KEY ).json() - add_dict["zip"] = response["results"][0]["address_components"][-1][ - "long_name" - ] - add_dict["country"] = response["results"][0]["address_components"][-2][ - "long_name" - ] - add_dict["state"] = response["results"][0]["address_components"][-3][ - "long_name" - ] - add_dict["city"] = response["results"][0]["address_components"][-4][ - "long_name" - ] - add_dict["locality"] = response["results"][0]["address_components"][-5][ - "long_name" - ] - add_dict["road"] = response["results"][0]["address_components"][-6][ - "long_name" - ] + add_dict["zip"] = response["results"][0]["address_components"][-1]["long_name"] + add_dict["country"] = response["results"][0]["address_components"][-2]["long_name"] + add_dict["state"] = response["results"][0]["address_components"][-3]["long_name"] + add_dict["city"] = response["results"][0]["address_components"][-4]["long_name"] + add_dict["locality"] = response["results"][0]["address_components"][-5]["long_name"] + add_dict["road"] = response["results"][0]["address_components"][-6]["long_name"] add_dict["formatted_address"] = response["results"][0]["formatted_address"] return add_dict def get_coordinates(API_KEY, address_text): + # type: (str, str) -> Dict response = requests.get( "https://maps.googleapis.com/maps/api/geocode/json?address=" + address_text @@ -827,16 +828,19 @@ def get_coordinates(API_KEY, address_text): def is_googlemaps_loaded(): + # type: () -> bool return getattr(g, "googlemaps_loaded", False) class GoogleMaps(object): def __init__(self, app=None, **kwargs): + # type: (Optional[Any], **str) -> None self.key = kwargs.get("key") if app: self.init_app(app) def init_app(self, app): + # type: (Any) -> None if self.key: app.config["GOOGLEMAPS_KEY"] = self.key self.register_blueprint(app) @@ -845,9 +849,7 @@ def init_app(self, app): app.add_template_global(googlemap_obj) app.add_template_filter(googlemap) app.add_template_global(googlemap) - app.add_template_global( - app.config.get("GOOGLEMAPS_KEY"), name="GOOGLEMAPS_KEY" - ) + app.add_template_global(app.config.get("GOOGLEMAPS_KEY"), name="GOOGLEMAPS_KEY") app.add_template_global(set_googlemaps_loaded) app.add_template_global(is_googlemaps_loaded) diff --git a/flask_googlemaps/icons.py b/flask_googlemaps/icons.py index 1e0f0e2..ccdbc50 100644 --- a/flask_googlemaps/icons.py +++ b/flask_googlemaps/icons.py @@ -9,11 +9,14 @@ __all__ = ["dots", "alpha", "shapes", "pushpin", "paddle"] +from typing import Optional, List + class Icon(object): """Dynamically return dot icon url""" def __init__(self, base_url, options=None): + # type: (str, Optional[List[str]]) -> None self.base_url = base_url self.options = options @@ -24,7 +27,7 @@ def __getattr__(self, item): dots = Icon( base_url="//maps.google.com/mapfiles/ms/icons/{0}-dot.png", options=["blue", "yellow", "green", "red", "pink", "purple", "red"], -) +) # type: Icon alpha = Icon( base_url="//www.google.com/mapfiles/marker{0}.png", @@ -56,7 +59,7 @@ def __getattr__(self, item): "W", "Y", ], -) +) # type: Icon shapes = Icon( base_url="//maps.google.com/mapfiles/kml/shapes/{0}.png", @@ -166,7 +169,7 @@ def __getattr__(self, item): "woman", "yen", ], -) +) # type: Icon pushpin = Icon( base_url="//maps.google.com/mapfiles/kml/pushpin/{0}.png", options=[ @@ -179,7 +182,7 @@ def __getattr__(self, item): "wht-pushpin", "ylw-pushpin", ], -) +) # type: Icon paddle = Icon( base_url="//maps.google.com/mapfiles/kml/paddle/{0}.png", @@ -310,4 +313,4 @@ def __getattr__(self, item): "stop", "route", ], -) +) # type: Icon diff --git a/flask_googlemaps/py.typed b/flask_googlemaps/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/poetry.lock b/poetry.lock index 7c35427..af06769 100644 --- a/poetry.lock +++ b/poetry.lock @@ -495,6 +495,30 @@ version = "8.2.0" [[package]] category = "dev" +description = "Optional static typing for Python" +name = "mypy" +optional = false +python-versions = ">=3.5" +version = "0.790" + +[package.dependencies] +mypy-extensions = ">=0.4.3,<0.5.0" +typed-ast = ">=1.4.0,<1.5.0" +typing-extensions = ">=3.7.4" + +[package.extras] +dmypy = ["psutil (>=4.0)"] + +[[package]] +category = "dev" +description = "Experimental type system extensions for programs checked with the mypy typechecker." +name = "mypy-extensions" +optional = false +python-versions = "*" +version = "0.4.3" + +[[package]] +category = "main" description = "Natural Language Toolkit" name = "nltk" optional = false @@ -823,6 +847,14 @@ optional = false python-versions = "*" version = "1.4.1" +[[package]] +category = "dev" +description = "Backported and Experimental Type Hints for Python 3.5+" +name = "typing-extensions" +optional = false +python-versions = "*" +version = "3.7.4.3" + [[package]] category = "main" description = "HTTP library with thread-safe connection pooling, file post, and more." @@ -877,7 +909,7 @@ docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] testing = ["jaraco.itertools", "func-timeout"] [metadata] -content-hash = "a2bb56deec8d6b530f6eac2049c795ede2f75dd58b8dcea2f1371e4dff831869" +content-hash = "d145b170ae9fb4b3cb6b0215b8b6172e863315c5cbf1de0ffdc7250ca7f83b34" python-versions = ">=3.6" [metadata.files] @@ -1098,6 +1130,11 @@ markupsafe = [ {file = "MarkupSafe-1.1.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:ba59edeaa2fc6114428f1637ffff42da1e311e29382d81b339c1817d37ec93c6"}, {file = "MarkupSafe-1.1.1-cp37-cp37m-win32.whl", hash = "sha256:b00c1de48212e4cc9603895652c5c410df699856a2853135b3967591e4beebc2"}, {file = "MarkupSafe-1.1.1-cp37-cp37m-win_amd64.whl", hash = "sha256:9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c"}, + {file = "MarkupSafe-1.1.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6788b695d50a51edb699cb55e35487e430fa21f1ed838122d722e0ff0ac5ba15"}, + {file = "MarkupSafe-1.1.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:cdb132fc825c38e1aeec2c8aa9338310d29d337bebbd7baa06889d09a60a1fa2"}, + {file = "MarkupSafe-1.1.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:13d3144e1e340870b25e7b10b98d779608c02016d5184cfb9927a9f10c689f42"}, + {file = "MarkupSafe-1.1.1-cp38-cp38-win32.whl", hash = "sha256:596510de112c685489095da617b5bcbbac7dd6384aeebeda4df6025d0256a81b"}, + {file = "MarkupSafe-1.1.1-cp38-cp38-win_amd64.whl", hash = "sha256:e8313f01ba26fbbe36c7be1966a7b7424942f670f38e666995b88d012765b9be"}, {file = "MarkupSafe-1.1.1.tar.gz", hash = "sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b"}, ] mccabe = [ @@ -1120,6 +1157,26 @@ more-itertools = [ {file = "more-itertools-8.2.0.tar.gz", hash = "sha256:b1ddb932186d8a6ac451e1d95844b382f55e12686d51ca0c68b6f61f2ab7a507"}, {file = "more_itertools-8.2.0-py3-none-any.whl", hash = "sha256:5dd8bcf33e5f9513ffa06d5ad33d78f31e1931ac9a18f33d37e77a180d393a7c"}, ] +mypy = [ + {file = "mypy-0.790-cp35-cp35m-macosx_10_6_x86_64.whl", hash = "sha256:bd03b3cf666bff8d710d633d1c56ab7facbdc204d567715cb3b9f85c6e94f669"}, + {file = "mypy-0.790-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:2170492030f6faa537647d29945786d297e4862765f0b4ac5930ff62e300d802"}, + {file = "mypy-0.790-cp35-cp35m-win_amd64.whl", hash = "sha256:e86bdace26c5fe9cf8cb735e7cedfe7850ad92b327ac5d797c656717d2ca66de"}, + {file = "mypy-0.790-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:e97e9c13d67fbe524be17e4d8025d51a7dca38f90de2e462243ab8ed8a9178d1"}, + {file = "mypy-0.790-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:0d34d6b122597d48a36d6c59e35341f410d4abfa771d96d04ae2c468dd201abc"}, + {file = "mypy-0.790-cp36-cp36m-win_amd64.whl", hash = "sha256:72060bf64f290fb629bd4a67c707a66fd88ca26e413a91384b18db3876e57ed7"}, + {file = "mypy-0.790-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:eea260feb1830a627fb526d22fbb426b750d9f5a47b624e8d5e7e004359b219c"}, + {file = "mypy-0.790-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:c614194e01c85bb2e551c421397e49afb2872c88b5830e3554f0519f9fb1c178"}, + {file = "mypy-0.790-cp37-cp37m-win_amd64.whl", hash = "sha256:0a0d102247c16ce93c97066443d11e2d36e6cc2a32d8ccc1f705268970479324"}, + {file = "mypy-0.790-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cf4e7bf7f1214826cf7333627cb2547c0db7e3078723227820d0a2490f117a01"}, + {file = "mypy-0.790-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:af4e9ff1834e565f1baa74ccf7ae2564ae38c8df2a85b057af1dbbc958eb6666"}, + {file = "mypy-0.790-cp38-cp38-win_amd64.whl", hash = "sha256:da56dedcd7cd502ccd3c5dddc656cb36113dd793ad466e894574125945653cea"}, + {file = "mypy-0.790-py3-none-any.whl", hash = "sha256:2842d4fbd1b12ab422346376aad03ff5d0805b706102e475e962370f874a5122"}, + {file = "mypy-0.790.tar.gz", hash = "sha256:2b21ba45ad9ef2e2eb88ce4aeadd0112d0f5026418324176fd494a6824b74975"}, +] +mypy-extensions = [ + {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, + {file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"}, +] nltk = [ {file = "nltk-3.4.5.win32.exe", hash = "sha256:a08bdb4b8a1c13de16743068d9eb61c8c71c2e5d642e8e08205c528035843f82"}, {file = "nltk-3.4.5.zip", hash = "sha256:bed45551259aa2101381bbdd5df37d44ca2669c5c3dad72439fa459b29137d94"}, @@ -1291,6 +1348,11 @@ typed-ast = [ {file = "typed_ast-1.4.1-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:d43943ef777f9a1c42bf4e552ba23ac77a6351de620aa9acf64ad54933ad4d34"}, {file = "typed_ast-1.4.1.tar.gz", hash = "sha256:8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b"}, ] +typing-extensions = [ + {file = "typing_extensions-3.7.4.3-py2-none-any.whl", hash = "sha256:dafc7639cde7f1b6e1acc0f457842a83e722ccca8eef5270af2d74792619a89f"}, + {file = "typing_extensions-3.7.4.3-py3-none-any.whl", hash = "sha256:7cb407020f00f7bfc3cb3e7881628838e69d8f3fcab2f64742a5e76b2f841918"}, + {file = "typing_extensions-3.7.4.3.tar.gz", hash = "sha256:99d4073b617d30288f569d3f13d2bd7548c3a7e4c8de87db09a9d29bb3a4a60c"}, +] urllib3 = [ {file = "urllib3-1.22-py2.py3-none-any.whl", hash = "sha256:06330f386d6e4b195fbfc736b297f58c5a892e4440e54d294d7004e3a9bbea1b"}, {file = "urllib3-1.22.tar.gz", hash = "sha256:cc44da8e1145637334317feebd728bd869a35285b93cbb4cca2577da7e62db4f"}, diff --git a/pyproject.toml b/pyproject.toml index a869fc9..96a4ff4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ classifiers=[ packages = [ {include = "flask_googlemaps"} ] +include = ["flask_googlemaps/py.typed"] [tool.poetry.dependencies] python = ">=3.6" @@ -40,6 +41,7 @@ pylint = "^2.4.4" Pygments = "^2.6.1" pytest = "^5.4.1" pytest-cov = "^2.8.1" +mypy = "^0.790" [build-system] requires = ["poetry>=0.12"]