Configure python-source to include type stubs#231
Merged
Conversation
|
@milesgranger can we get a new release to pypi that includes this change? Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Although source code contains stub files with type annotations, they are not included into the package. And the
__init__.pyis autogenerated by maturin, not used those provided in the source:❯ unzip -l cramjam-2.11.0-cp314-cp314-macosx_11_0_arm64.whl Archive: cramjam-2.11.0-cp314-cp314-macosx_11_0_arm64.whl Length Date Time Name --------- ---------- ----- ---- 5561 07-27-2025 21:10 cramjam-2.11.0.dist-info/METADATA 104 07-27-2025 21:10 cramjam-2.11.0.dist-info/WHEEL 1070 07-27-2025 21:10 cramjam-2.11.0.dist-info/licenses/LICENSE 111 07-27-2025 21:10 cramjam/__init__.py 3722064 07-27-2025 21:10 cramjam/cramjam.cpython-314-darwin.so 480 07-27-2025 21:10 cramjam-2.11.0.dist-info/RECORD --------- ------- 3729390 6 filesAuto-discover of python code doesn't work with this layout, so we have to configure
python-sourceexplicitly. The content of package after this fix:❯ unzip -l dist/cramjam-2.12.0rc1-cp313-cp313-macosx_11_0_arm64.whl Archive: dist/cramjam-2.12.0rc1-cp313-cp313-macosx_11_0_arm64.whl Length Date Time Name --------- ---------- ----- ---- 684 09-28-2025 15:05 cramjam-2.12.0rc1.dist-info/METADATA 104 09-28-2025 15:05 cramjam-2.12.0rc1.dist-info/WHEEL 1070 09-28-2025 15:05 cramjam-2.12.0rc1.dist-info/licenses/LICENSE 1247 09-28-2025 15:05 cramjam/gzip.pyi 5809 09-28-2025 15:05 cramjam/__init__.pyi 4157 09-28-2025 15:05 cramjam/lz4.pyi 23 09-28-2025 15:05 cramjam/__init__.py 1247 09-28-2025 15:05 cramjam/zlib.pyi 2109 09-28-2025 15:05 cramjam/deflate.pyi 3155 09-28-2025 15:05 cramjam/xz.pyi 0 09-28-2025 15:05 cramjam/experimental.pyi 1251 09-28-2025 15:05 cramjam/bzip2.pyi 2020 09-28-2025 15:05 cramjam/brotli.pyi 0 09-28-2025 15:05 cramjam/py.typed 3105 09-28-2025 15:05 cramjam/snappy.pyi 1247 09-28-2025 15:05 cramjam/zstd.pyi 8697136 09-28-2025 15:05 cramjam/cramjam.cpython-313-darwin.so 1377 09-28-2025 15:05 cramjam-2.12.0rc1.dist-info/RECORD --------- ------- 8725741 18 files