Skip to content

Commit

Permalink
Make package PEP 561 compliant; add typehint stub file
Browse files Browse the repository at this point in the history
  • Loading branch information
jonded94 committed Aug 6, 2024
1 parent c67c95b commit 8c5aa10
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include *.h
include LICENSE*
include AUTHORS*
include crc32c/*
7 changes: 7 additions & 0 deletions crc32c/__init__.pyi
Original file line number Diff line number Diff line change
@@ -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: ...
Empty file added crc32c/py.typed
Empty file.
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit 8c5aa10

Please sign in to comment.