Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Core: Add py.typed, Remove docs from source dist #12232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 9, 2025
Merged

Conversation

bblommers
Copy link
Contributor

@bblommers bblommers commented Feb 6, 2025

Motivation

In order to actually use the type-hints, we need to add a py.typed-file - see the mypy-docs for more info. We don't have to explicitly configure anything for this file to be part of both the wheel and source dist - we're already including almost all files by default.

I've added types to localstack.state.core.py just because I needed it upstream. There is still a lot of code untyped, so there is an argument that we should not include py.typed (i.e., mark this package ready for type hints) until we know for sure all type-hints are correct. This is a bit of an alternative chicken-and-egg problem - we don't have all the types yet, but we also don't advertise the package as being typed, so there is no rush to work on this. I'm in favour of including py.typed regardless, and use it as a stick - things may break, types may be wrong, but it forces us to improve it.

Related: while building the source dist I also realized that it currently contains a lot of files/folders that we (IMHO) should not include, like the docs and CI workflows. Excluding these reduces the source dist size from 4.3MB to 3.4MB.

@bblommers bblommers added this to the Playground milestone Feb 6, 2025
@bblommers bblommers requested review from thrau and silv-io February 6, 2025 11:31
@bblommers bblommers added the semver: patch Non-breaking changes which can be included in patch releases label Feb 6, 2025
@bblommers
Copy link
Contributor Author

I've noticed that our CI pipeline/Makefile does currently not run MyPy - so all types is basically untested. 😢

I'd be happy to take a (time-boxed) stab at this as well, if necessary.

Copy link

github-actions bot commented Feb 6, 2025

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   1h 52m 45s ⏱️ - 1m 16s
4 083 tests ±0  3 766 ✅ ±0  317 💤 ±0  0 ❌ ±0 
4 085 runs  ±0  3 766 ✅ ±0  319 💤 ±0  0 ❌ ±0 

Results for commit bc3b8e7. ± Comparison against base commit 7f32b7d.

Copy link
Member

@thrau thrau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for adding the type hints! and sorry for missing the PR review

@thrau thrau merged commit 2ec85e4 into master Apr 9, 2025
36 of 38 checks passed
@thrau thrau deleted the core-add-py-typed branch April 9, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants