From 3007f302bacadb489c8f3b112b07ae2d0d0fe39a Mon Sep 17 00:00:00 2001 From: Mike Appleby <86076+appleby@users.noreply.github.com> Date: Mon, 16 Sep 2019 09:22:27 -0700 Subject: [PATCH] Add a py.typed file for PEP 561 compliance This ensures that mypy can "find" the rcpq package when checking type annotations from pyquil (or any other package that uses rpcq). https://www.python.org/dev/peps/pep-0561/ https://mypy.readthedocs.io/en/latest/installed_packages.html#making-pep-561-compatible-packages --- rpcq/py.typed | 0 setup.py | 4 ++++ 2 files changed, 4 insertions(+) create mode 100644 rpcq/py.typed diff --git a/rpcq/py.typed b/rpcq/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/setup.py b/setup.py index f2fca33..a985c2a 100644 --- a/setup.py +++ b/setup.py @@ -45,6 +45,7 @@ 'rpcq', 'rpcq.external' ], + package_data={'rpcq': ['py.typed']}, url='https://github.com/rigetticomputing/rpcq.git', description='''The RPC framework and message specification for Rigetti QCS.''', long_description=long_description, @@ -59,6 +60,9 @@ ], keywords='quantum rpc qcs', python_requires='>=3.6', + # zip_safe must be disabled in order for mypy to find the installed py.typed file, according to + # https://mypy.readthedocs.io/en/latest/installed_packages.html#making-pep-561-compatible-packages + zip_safe=False ) # restore version.py to its previous state