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 authored and rtobar committed Aug 7, 2024
1 parent fb1b32c commit edacda4
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

* Made this package PEP 561 compliant (#49).
* 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)`).
* Turned ``crc32c`` from a module-only distribution into a package,
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include LICENSE*
include AUTHORS*
include src/crc32c/ext/*.h
include src/crc32c/*.pyi
include src/crc32c/py.typed
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@
classifiers=classifiers,
packages=['crc32c'],
package_dir={'': 'src'},
include_package_data=True,
ext_modules=[crcmod_ext],
test_suite="test")
7 changes: 7 additions & 0 deletions src/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 src/crc32c/py.typed
Empty file.

0 comments on commit edacda4

Please sign in to comment.