From 5f061fff9d2f1e4261a217e786fb8dea342811c7 Mon Sep 17 00:00:00 2001 From: Ofek Lev Date: Tue, 19 Jan 2021 12:18:53 -0500 Subject: [PATCH] support pep 561 (#88) --- HISTORY.rst | 1 + MANIFEST.in | 1 + coincurve/py.typed | 0 setup.py | 6 +++++- 4 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 coincurve/py.typed diff --git a/HISTORY.rst b/HISTORY.rst index 53953b3d2..de9c1060a 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -13,6 +13,7 @@ master - Upgrade libsecp256k1 to the latest available version - Upgrade libgmp to the latest available version - Introduce ``COINCURVE_UPSTREAM_REF`` environment variable to select an alternative libsecp256k1 version when building from source +- Support PEP 561 type hints 14.0.0 ^^^^^^ diff --git a/MANIFEST.in b/MANIFEST.in index 8f37ef0c4..06dc9ba47 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ +include coincurve/py.typed include setup_support.py recursive-include _cffi_build *.py *.h graft libsecp256k1 diff --git a/coincurve/py.typed b/coincurve/py.typed new file mode 100644 index 000000000..e69de29bb diff --git a/setup.py b/setup.py index 64bb09afe..1bf8e890e 100644 --- a/setup.py +++ b/setup.py @@ -226,13 +226,16 @@ def run(self): _develop.run(self) +package_data = {'coincurve': ['py.typed']} + if BUILDING_FOR_WINDOWS: class Distribution(_Distribution): def is_pure(self): return False - setup_kwargs = dict(package_data={'coincurve': ['*.dll']}, include_package_data=True) + package_data['coincurve'].append('libsecp256k1.dll') + setup_kwargs = dict() else: class Distribution(_Distribution): @@ -272,6 +275,7 @@ def has_c_libraries(self): install_requires=['asn1crypto', 'cffi>=1.3.0'], packages=find_packages(exclude=('_cffi_build', '_cffi_build.*', 'libsecp256k1', 'tests')), + package_data=package_data, distclass=Distribution, zip_safe=False,