From c1e3abe4913876045cf4df94c655d10040e2751a Mon Sep 17 00:00:00 2001 From: Derek Kulinski Date: Wed, 12 Dec 2018 11:46:46 -0800 Subject: [PATCH] Make typechecking with mypy possible. --- .gitignore | 1 + README.md | 2 +- mondemand/lwes_transport.py | 3 +++ mondemand/py.typed | 0 setup.cfg | 10 ++++++++-- 5 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 mondemand/py.typed diff --git a/.gitignore b/.gitignore index c2c0b03..6cd1a0d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /.eggs/ /.idea/ /build/ +/dist/ /*.egg-info/ __pycache__/ *.c diff --git a/README.md b/README.md index 630d52c..437b3cf 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ REQUIREMENTS INSTALL ======= -Run `pip install .` +Run `pip install mondemand` Example Run =========== diff --git a/mondemand/lwes_transport.py b/mondemand/lwes_transport.py index 2458d3b..d910c7c 100644 --- a/mondemand/lwes_transport.py +++ b/mondemand/lwes_transport.py @@ -1,5 +1,7 @@ from __future__ import absolute_import +from typing import AnyStr, Optional + from ._mondemand import ffi, lib from .utils import text_to_cstring @@ -7,6 +9,7 @@ class LwesTransport(object): def __init__(self, address, port, interface=None, heartbeat_flag=0, heartbeat_frequency=0, ttl=30): + # type: (AnyStr, int, Optional[AnyStr], int, int, int) -> None transport = lib.mondemand_transport_lwes_create_with_ttl( text_to_cstring(address), port, text_to_cstring(interface) if interface else ffi.NULL, diff --git a/mondemand/py.typed b/mondemand/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/setup.cfg b/setup.cfg index 0259f4d..f90f838 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,14 +17,17 @@ classifiers= Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 + Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Topic :: Software Development :: Libraries :: Python Modules [options] -python_requires= >=2.7, !=3.0, !=3.1, !=3.2, !=3.3, !=3.4 +packages=find: zip_safe=false +python_requires= + >=2.7.*, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* setup_requires= setuptools_scm cffi ~= 1.11.5 @@ -32,4 +35,7 @@ install_requires= cffi ~= 1.11.5 six typing -packages=find: + +[options.package_data] +mondemand= + py.typed