diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ca65ef..7fefee7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Development +* Adding a `py.typed` and a type hint stub file and thereby made this package PEP 561 compliant * Release GIL during the computation of the CRC32C hash. A new `gil_release_mode` argument lets users choose between always/never/automatically releasing it (#47). * Add keyword support to `crc32c` function (`crc32c(data, value=0, gil_release_mode=-1)`). * Adding explicit fallthrough annotations diff --git a/MANIFEST.in b/MANIFEST.in index d94aeca..15c74da 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ include *.h include LICENSE* include AUTHORS* +include crc32c/* diff --git a/crc32c/__init__.pyi b/crc32c/__init__.pyi new file mode 100644 index 0000000..5fe0d8a --- /dev/null +++ b/crc32c/__init__.pyi @@ -0,0 +1,7 @@ +from collections.abc import Buffer + +big_endian: int +hardware_based: bool + +def crc32(data: Buffer, value: int = 0, gil_release_mode: int = -1) -> int: ... +def crc32c(data: Buffer, value: int = 0, gil_release_mode: int = -1) -> int: ... diff --git a/crc32c/py.typed b/crc32c/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/setup.py b/setup.py index 15b67c2..496e983 100644 --- a/setup.py +++ b/setup.py @@ -66,6 +66,8 @@ ' in hardware and software'), long_description=long_description, long_description_content_type='text/x-rst', + packages=["crc32c"], + include_package_data=True, classifiers=classifiers, ext_modules=[crcmod_ext], test_suite="test")